From d140632097d53e405c0188ca4160167677377d87 Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Mon, 10 Sep 2007 20:00:27 -0400 Subject: [PATCH] --- yaml --- r: 128452 b: refs/heads/master c: a8c450b211c010ac55190da23ceb6b39b393f411 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/extent_map.c | 44 ++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/[refs] b/[refs] index 9738fd4b36ff..f6692f53bb6a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 011410bd859a481a335d7db1fb559542c5663fd5 +refs/heads/master: a8c450b211c010ac55190da23ceb6b39b393f411 diff --git a/trunk/fs/btrfs/extent_map.c b/trunk/fs/btrfs/extent_map.c index 33f7a18dddf7..370ed97e52f5 100644 --- a/trunk/fs/btrfs/extent_map.c +++ b/trunk/fs/btrfs/extent_map.c @@ -712,28 +712,6 @@ int set_extent_bit(struct extent_map_tree *tree, u64 start, u64 end, int bits, } goto search_again; } - /* - * | ---- desired range ---- | - * | state | - * We need to split the extent, and set the bit - * on the first half - */ - if (state->start <= end && state->end > end) { - set = state->state & bits; - if (exclusive && set) { - *failed_start = start; - err = -EEXIST; - goto out; - } - err = split_state(tree, state, prealloc, end + 1); - BUG_ON(err == -EEXIST); - - prealloc->state |= bits; - merge_state(tree, prealloc); - prealloc = NULL; - goto out; - } - /* * | ---- desired range ---- | * | state | or | state | @@ -756,6 +734,28 @@ int set_extent_bit(struct extent_map_tree *tree, u64 start, u64 end, int bits, start = this_end + 1; goto search_again; } + /* + * | ---- desired range ---- | + * | state | + * We need to split the extent, and set the bit + * on the first half + */ + if (state->start <= end && state->end > end) { + set = state->state & bits; + if (exclusive && set) { + *failed_start = start; + err = -EEXIST; + goto out; + } + err = split_state(tree, state, prealloc, end + 1); + BUG_ON(err == -EEXIST); + + prealloc->state |= bits; + merge_state(tree, prealloc); + prealloc = NULL; + goto out; + } + goto search_again; out: