diff options
author | Chris Mason <chris.mason@oracle.com> | 2009-01-05 21:25:51 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-01-05 21:25:51 -0500 |
commit | d397712bcc6a759a560fd247e6053ecae091f958 (patch) | |
tree | 9da8daebb870d8b8b1843507c4621715e23dd31a /fs/btrfs/ordered-data.c | |
parent | 1f3c79a28c8837e8572b98f6d14142d9a6133c56 (diff) |
Btrfs: Fix checkpatch.pl warnings
There were many, most are fixed now. struct-funcs.c generates some warnings
but these are bogus.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ordered-data.c')
-rw-r--r-- | fs/btrfs/ordered-data.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index d9e232227da4..a20940170274 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
@@ -39,11 +39,11 @@ static u64 entry_end(struct btrfs_ordered_extent *entry) | |||
39 | static struct rb_node *tree_insert(struct rb_root *root, u64 file_offset, | 39 | static struct rb_node *tree_insert(struct rb_root *root, u64 file_offset, |
40 | struct rb_node *node) | 40 | struct rb_node *node) |
41 | { | 41 | { |
42 | struct rb_node ** p = &root->rb_node; | 42 | struct rb_node **p = &root->rb_node; |
43 | struct rb_node * parent = NULL; | 43 | struct rb_node *parent = NULL; |
44 | struct btrfs_ordered_extent *entry; | 44 | struct btrfs_ordered_extent *entry; |
45 | 45 | ||
46 | while(*p) { | 46 | while (*p) { |
47 | parent = *p; | 47 | parent = *p; |
48 | entry = rb_entry(parent, struct btrfs_ordered_extent, rb_node); | 48 | entry = rb_entry(parent, struct btrfs_ordered_extent, rb_node); |
49 | 49 | ||
@@ -67,13 +67,13 @@ static struct rb_node *tree_insert(struct rb_root *root, u64 file_offset, | |||
67 | static struct rb_node *__tree_search(struct rb_root *root, u64 file_offset, | 67 | static struct rb_node *__tree_search(struct rb_root *root, u64 file_offset, |
68 | struct rb_node **prev_ret) | 68 | struct rb_node **prev_ret) |
69 | { | 69 | { |
70 | struct rb_node * n = root->rb_node; | 70 | struct rb_node *n = root->rb_node; |
71 | struct rb_node *prev = NULL; | 71 | struct rb_node *prev = NULL; |
72 | struct rb_node *test; | 72 | struct rb_node *test; |
73 | struct btrfs_ordered_extent *entry; | 73 | struct btrfs_ordered_extent *entry; |
74 | struct btrfs_ordered_extent *prev_entry = NULL; | 74 | struct btrfs_ordered_extent *prev_entry = NULL; |
75 | 75 | ||
76 | while(n) { | 76 | while (n) { |
77 | entry = rb_entry(n, struct btrfs_ordered_extent, rb_node); | 77 | entry = rb_entry(n, struct btrfs_ordered_extent, rb_node); |
78 | prev = n; | 78 | prev = n; |
79 | prev_entry = entry; | 79 | prev_entry = entry; |
@@ -88,7 +88,7 @@ static struct rb_node *__tree_search(struct rb_root *root, u64 file_offset, | |||
88 | if (!prev_ret) | 88 | if (!prev_ret) |
89 | return NULL; | 89 | return NULL; |
90 | 90 | ||
91 | while(prev && file_offset >= entry_end(prev_entry)) { | 91 | while (prev && file_offset >= entry_end(prev_entry)) { |
92 | test = rb_next(prev); | 92 | test = rb_next(prev); |
93 | if (!test) | 93 | if (!test) |
94 | break; | 94 | break; |
@@ -102,7 +102,7 @@ static struct rb_node *__tree_search(struct rb_root *root, u64 file_offset, | |||
102 | if (prev) | 102 | if (prev) |
103 | prev_entry = rb_entry(prev, struct btrfs_ordered_extent, | 103 | prev_entry = rb_entry(prev, struct btrfs_ordered_extent, |
104 | rb_node); | 104 | rb_node); |
105 | while(prev && file_offset < entry_end(prev_entry)) { | 105 | while (prev && file_offset < entry_end(prev_entry)) { |
106 | test = rb_prev(prev); | 106 | test = rb_prev(prev); |
107 | if (!test) | 107 | if (!test) |
108 | break; | 108 | break; |
@@ -193,10 +193,8 @@ int btrfs_add_ordered_extent(struct inode *inode, u64 file_offset, | |||
193 | 193 | ||
194 | node = tree_insert(&tree->tree, file_offset, | 194 | node = tree_insert(&tree->tree, file_offset, |
195 | &entry->rb_node); | 195 | &entry->rb_node); |
196 | if (node) { | 196 | BUG_ON(node); |
197 | printk("warning dup entry from add_ordered_extent\n"); | 197 | |
198 | BUG(); | ||
199 | } | ||
200 | set_extent_ordered(&BTRFS_I(inode)->io_tree, file_offset, | 198 | set_extent_ordered(&BTRFS_I(inode)->io_tree, file_offset, |
201 | entry_end(entry) - 1, GFP_NOFS); | 199 | entry_end(entry) - 1, GFP_NOFS); |
202 | 200 | ||
@@ -282,7 +280,7 @@ int btrfs_put_ordered_extent(struct btrfs_ordered_extent *entry) | |||
282 | struct btrfs_ordered_sum *sum; | 280 | struct btrfs_ordered_sum *sum; |
283 | 281 | ||
284 | if (atomic_dec_and_test(&entry->refs)) { | 282 | if (atomic_dec_and_test(&entry->refs)) { |
285 | while(!list_empty(&entry->list)) { | 283 | while (!list_empty(&entry->list)) { |
286 | cur = entry->list.next; | 284 | cur = entry->list.next; |
287 | sum = list_entry(cur, struct btrfs_ordered_sum, list); | 285 | sum = list_entry(cur, struct btrfs_ordered_sum, list); |
288 | list_del(&sum->list); | 286 | list_del(&sum->list); |
@@ -432,11 +430,10 @@ again: | |||
432 | orig_end >> PAGE_CACHE_SHIFT); | 430 | orig_end >> PAGE_CACHE_SHIFT); |
433 | 431 | ||
434 | end = orig_end; | 432 | end = orig_end; |
435 | while(1) { | 433 | while (1) { |
436 | ordered = btrfs_lookup_first_ordered_extent(inode, end); | 434 | ordered = btrfs_lookup_first_ordered_extent(inode, end); |
437 | if (!ordered) { | 435 | if (!ordered) |
438 | break; | 436 | break; |
439 | } | ||
440 | if (ordered->file_offset > orig_end) { | 437 | if (ordered->file_offset > orig_end) { |
441 | btrfs_put_ordered_extent(ordered); | 438 | btrfs_put_ordered_extent(ordered); |
442 | break; | 439 | break; |
@@ -492,7 +489,7 @@ out: | |||
492 | * if none is found | 489 | * if none is found |
493 | */ | 490 | */ |
494 | struct btrfs_ordered_extent * | 491 | struct btrfs_ordered_extent * |
495 | btrfs_lookup_first_ordered_extent(struct inode * inode, u64 file_offset) | 492 | btrfs_lookup_first_ordered_extent(struct inode *inode, u64 file_offset) |
496 | { | 493 | { |
497 | struct btrfs_ordered_inode_tree *tree; | 494 | struct btrfs_ordered_inode_tree *tree; |
498 | struct rb_node *node; | 495 | struct rb_node *node; |
@@ -553,7 +550,7 @@ int btrfs_ordered_update_i_size(struct inode *inode, | |||
553 | * yet | 550 | * yet |
554 | */ | 551 | */ |
555 | node = &ordered->rb_node; | 552 | node = &ordered->rb_node; |
556 | while(1) { | 553 | while (1) { |
557 | node = rb_prev(node); | 554 | node = rb_prev(node); |
558 | if (!node) | 555 | if (!node) |
559 | break; | 556 | break; |
@@ -581,9 +578,8 @@ int btrfs_ordered_update_i_size(struct inode *inode, | |||
581 | * between our ordered extent and the next one. | 578 | * between our ordered extent and the next one. |
582 | */ | 579 | */ |
583 | test = rb_entry(node, struct btrfs_ordered_extent, rb_node); | 580 | test = rb_entry(node, struct btrfs_ordered_extent, rb_node); |
584 | if (test->file_offset > entry_end(ordered)) { | 581 | if (test->file_offset > entry_end(ordered)) |
585 | i_size_test = test->file_offset; | 582 | i_size_test = test->file_offset; |
586 | } | ||
587 | } else { | 583 | } else { |
588 | i_size_test = i_size_read(inode); | 584 | i_size_test = i_size_read(inode); |
589 | } | 585 | } |