From b375ace4dfbb6d6956d2f4a6c2b1b82d3713b683 Mon Sep 17 00:00:00 2001 From: Jeff Schroeder Date: Tue, 20 Nov 2007 10:58:26 -0800 Subject: [PATCH 2/5] CodingStyle add spaces around parens and braces Signed-off-by: Jeff Schroeder --- dm-ddsnap.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dm-ddsnap.c b/dm-ddsnap.c index ae04aec..29ef5b8 100644 --- a/dm-ddsnap.c +++ b/dm-ddsnap.c @@ -43,7 +43,7 @@ /* Useful gizmos */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) +#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) #else @@ -61,14 +61,14 @@ static int rwpipe(struct file *file, const void *buffer, unsigned int count, 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) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) iocb.ki_left = count; #endif oldseg = get_fs(); set_fs(get_ds()); while (count) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19) +#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); #else @@ -418,7 +418,7 @@ int replied_rw(struct dm_target *target, struct rw_request *body, unsigned lengt int i, j, submitted = 0; trace(show_pending(info);) - if(snap) { + if (snap) { trace(warn("id = %u, %u ranges, %s %s", body->id, body->count, rw == READ? "read from": "write to", snap? "snapshot": "origin");) } @@ -446,7 +446,7 @@ found: bio = pending->bio; trace(warn("Handle pending IO sector %Lx", (long long)bio->bi_sector);) - if(failed_io) { + if (failed_io) { warn("Unable to handle pending IO server %Lx", (long long)bio->bi_sector); kmem_cache_free(pending_cache, pending); bio_io_error(bio, bio->bi_size); @@ -503,7 +503,7 @@ found: #endif kmem_cache_free(pending_cache, pending); } - if (submitted){ + if (submitted) { kick(info->orgdev->bdev); kick(info->snapdev->bdev); } @@ -718,7 +718,7 @@ socket_error: if (!running(info)) goto out; - warn("halting worker for snapshot %d",info->snap); + warn("halting worker for snapshot %d", info->snap); report_error(info); goto connect; } @@ -759,14 +759,14 @@ void upload_locks(struct devinfo *info) spin_lock_irqsave(&info->end_io_lock, irqflags); info->dont_switch_lists = 1; - while(!list_empty(&info->releases)){ + while (!list_empty(&info->releases)) { entry = info->releases.prev; hook = list_entry(entry, struct hook, list); list_del(entry); kmem_cache_free(end_io_cache, hook); } spin_unlock_irqrestore(&info->end_io_lock, irqflags); - list_for_each_safe(entry, tmp, &info->locked){ + list_for_each_safe(entry, tmp, &info->locked) { chunk_t chunk; hook = list_entry(entry, struct hook, list); @@ -788,7 +788,7 @@ void upload_locks(struct devinfo *info) * list. */ if (worker_ready(info)) { - list_for_each_safe(entry, tmp, &info->locked){ + list_for_each_safe(entry, tmp, &info->locked) { hook = list_entry(entry, struct hook, list); if (hook->old_end_io == NULL) list_move(&hook->list, &info->releases); -- 1.5.2.5