From 24975119849656b83468d6feb2d400d5d4e0e837 Mon Sep 17 00:00:00 2001 From: Jeff Schroeder Date: Tue, 20 Nov 2007 10:59:11 -0800 Subject: [PATCH 3/5] CodingStyle convert leading spaces to tabs Signed-off-by: Jeff Schroeder --- dm-ddsnap.c | 66 +++++++++++++++++++++++++++++----------------------------- 1 files changed, 33 insertions(+), 33 deletions(-) diff --git a/dm-ddsnap.c b/dm-ddsnap.c index 29ef5b8..38e244e 100644 --- a/dm-ddsnap.c +++ b/dm-ddsnap.c @@ -45,46 +45,46 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) static int rwpipe(struct file *file, const void *buffer, unsigned int count, - ssize_t (*op)(struct kiocb *, const struct iovec *, unsigned long, loff_t), int mode) + ssize_t (*op)(struct kiocb *, const struct iovec *, unsigned long, loff_t), int mode) #else static int rwpipe(struct file *file, const void *buffer, unsigned int count, - ssize_t (*op)(struct kiocb *, const char *, size_t, loff_t), int mode) + ssize_t (*op)(struct kiocb *, const char *, size_t, loff_t), int mode) #endif { - struct kiocb iocb; - mm_segment_t oldseg; - int err = 0; - trace_off(warn("%s %i bytes", mode == FMODE_READ? "read": "write", count);) - if (!(file->f_mode & mode)) - return -EBADF; - if (!op) - return -EINVAL; - init_sync_kiocb(&iocb, file); // new in 2.5 (hmm) - iocb.ki_pos = file->f_pos; + struct kiocb iocb; + mm_segment_t oldseg; + int err = 0; + trace_off(warn("%s %i bytes", mode == FMODE_READ? "read": "write", count);) + if (!(file->f_mode & mode)) + return -EBADF; + if (!op) + return -EINVAL; + init_sync_kiocb(&iocb, file); // new in 2.5 (hmm) + iocb.ki_pos = file->f_pos; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) - iocb.ki_left = count; + iocb.ki_left = count; #endif - oldseg = get_fs(); - set_fs(get_ds()); - while (count) { + oldseg = get_fs(); + set_fs(get_ds()); + while (count) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) - int chunk = (*op)(&iocb, &(struct iovec){ .iov_base = buffer, .iov_len = count }, - 1, iocb.ki_pos); + int chunk = (*op)(&iocb, &(struct iovec){ .iov_base = buffer, .iov_len = count }, + 1, iocb.ki_pos); #else - int chunk = (*op)(&iocb, buffer, count, iocb.ki_pos); + int chunk = (*op)(&iocb, buffer, count, iocb.ki_pos); #endif - if (chunk <= 0) { - err = chunk? chunk: -EPIPE; - break; - } - BUG_ON(chunk > count); - count -= chunk; - buffer += chunk; - } - set_fs(oldseg); - file->f_pos = iocb.ki_pos; - return err; + if (chunk <= 0) { + err = chunk? chunk: -EPIPE; + break; + } + BUG_ON(chunk > count); + count -= chunk; + buffer += chunk; + } + set_fs(oldseg); + file->f_pos = iocb.ki_pos; + return err; } static inline int readpipe(struct file *file, void *buffer, unsigned int count) @@ -205,12 +205,12 @@ static inline int running(struct devinfo *info) static inline int worker_running(struct devinfo *info) { - return !(info->flags & (FINISH_FLAG|RECOVER_FLAG)); + return !(info->flags & (FINISH_FLAG|RECOVER_FLAG)); } static inline int worker_ready(struct devinfo *info) { - return (worker_running(info) && (info->flags & READY_FLAG)); + return (worker_running(info) && (info->flags & READY_FLAG)); } static void report_error(struct devinfo *info) @@ -1061,7 +1061,7 @@ static int control(struct dm_target *target) case PROTOCOL_ERROR: // !!! FIXME: add a new warn("caught a protocol error message"); - break; + break; default: { struct protocol_error pe = { .err = ERROR_UNKNOWN_MESSAGE, -- 1.5.2.5