diff options
author | Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> | 2011-07-13 23:19:08 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-08-01 14:32:30 -0400 |
commit | 3150b6996934455d7f2da243939d80a9b839085a (patch) | |
tree | 8155ce90c3e9d2dcaec82eae2afc46bb237ce3d5 /fs/btrfs/extent_io.c | |
parent | 3a6d457ec79d4cdf2313189b4e852e53f2b8d2b2 (diff) |
Btrfs: clean up for insert_state()
Don't duplicate set_state_bits().
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 789d0b23048f..0d69425d0197 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -303,6 +303,9 @@ static void clear_state_cb(struct extent_io_tree *tree, | |||
303 | tree->ops->clear_bit_hook(tree->mapping->host, state, bits); | 303 | tree->ops->clear_bit_hook(tree->mapping->host, state, bits); |
304 | } | 304 | } |
305 | 305 | ||
306 | static void set_state_bits(struct extent_io_tree *tree, | ||
307 | struct extent_state *state, int *bits); | ||
308 | |||
306 | /* | 309 | /* |
307 | * insert an extent_state struct into the tree. 'bits' are set on the | 310 | * insert an extent_state struct into the tree. 'bits' are set on the |
308 | * struct before it is inserted. | 311 | * struct before it is inserted. |
@@ -318,7 +321,6 @@ static int insert_state(struct extent_io_tree *tree, | |||
318 | int *bits) | 321 | int *bits) |
319 | { | 322 | { |
320 | struct rb_node *node; | 323 | struct rb_node *node; |
321 | int bits_to_set = *bits & ~EXTENT_CTLBITS; | ||
322 | 324 | ||
323 | if (end < start) { | 325 | if (end < start) { |
324 | printk(KERN_ERR "btrfs end < start %llu %llu\n", | 326 | printk(KERN_ERR "btrfs end < start %llu %llu\n", |
@@ -328,11 +330,9 @@ static int insert_state(struct extent_io_tree *tree, | |||
328 | } | 330 | } |
329 | state->start = start; | 331 | state->start = start; |
330 | state->end = end; | 332 | state->end = end; |
331 | set_state_cb(tree, state, bits); | ||
332 | 333 | ||
333 | if (bits_to_set & EXTENT_DIRTY) | 334 | set_state_bits(tree, state, bits); |
334 | tree->dirty_bytes += end - start + 1; | 335 | |
335 | state->state |= bits_to_set; | ||
336 | node = tree_insert(&tree->state, end, &state->rb_node); | 336 | node = tree_insert(&tree->state, end, &state->rb_node); |
337 | if (node) { | 337 | if (node) { |
338 | struct extent_state *found; | 338 | struct extent_state *found; |