summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2011-07-14 03:19:08 +0000
committerChris Mason <chris.mason@oracle.com>2011-08-01 14:32:30 -0400
commit3150b6996934455d7f2da243939d80a9b839085a (patch)
tree8155ce90c3e9d2dcaec82eae2afc46bb237ce3d5
parent3a6d457ec79d4cdf2313189b4e852e53f2b8d2b2 (diff)
downloadop-kernel-dev-3150b6996934455d7f2da243939d80a9b839085a.zip
op-kernel-dev-3150b6996934455d7f2da243939d80a9b839085a.tar.gz
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>
-rw-r--r--fs/btrfs/extent_io.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 789d0b2..0d69425 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,
tree->ops->clear_bit_hook(tree->mapping->host, state, bits);
}
+static void set_state_bits(struct extent_io_tree *tree,
+ struct extent_state *state, int *bits);
+
/*
* insert an extent_state struct into the tree. 'bits' are set on the
* struct before it is inserted.
@@ -318,7 +321,6 @@ static int insert_state(struct extent_io_tree *tree,
int *bits)
{
struct rb_node *node;
- int bits_to_set = *bits & ~EXTENT_CTLBITS;
if (end < start) {
printk(KERN_ERR "btrfs end < start %llu %llu\n",
@@ -328,11 +330,9 @@ static int insert_state(struct extent_io_tree *tree,
}
state->start = start;
state->end = end;
- set_state_cb(tree, state, bits);
- if (bits_to_set & EXTENT_DIRTY)
- tree->dirty_bytes += end - start + 1;
- state->state |= bits_to_set;
+ set_state_bits(tree, state, bits);
+
node = tree_insert(&tree->state, end, &state->rb_node);
if (node) {
struct extent_state *found;
OpenPOWER on IntegriCloud