Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276527
b: refs/heads/master
c: 1cf4ffd
h: refs/heads/master
i:
  276525: dbe8feb
  276523: f30e7fa
  276519: 2919906
  276511: a156f5c
v: v3
  • Loading branch information
Liu Bo authored and Chris Mason committed Dec 8, 2011
1 parent a9a3755 commit 66cc7b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a5d16333612718569ffd26064270e535cb9c3928
refs/heads/master: 1cf4ffdb3289624a6462c94f2ce05545b32ef736
24 changes: 16 additions & 8 deletions trunk/fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -935,8 +935,10 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
node = tree_search(tree, start);
if (!node) {
prealloc = alloc_extent_state_atomic(prealloc);
if (!prealloc)
return -ENOMEM;
if (!prealloc) {
err = -ENOMEM;
goto out;
}
err = insert_state(tree, prealloc, start, end, &bits);
prealloc = NULL;
BUG_ON(err == -EEXIST);
Expand Down Expand Up @@ -992,8 +994,10 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
*/
if (state->start < start) {
prealloc = alloc_extent_state_atomic(prealloc);
if (!prealloc)
return -ENOMEM;
if (!prealloc) {
err = -ENOMEM;
goto out;
}
err = split_state(tree, state, prealloc, start);
BUG_ON(err == -EEXIST);
prealloc = NULL;
Expand Down Expand Up @@ -1024,8 +1028,10 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
this_end = last_start - 1;

prealloc = alloc_extent_state_atomic(prealloc);
if (!prealloc)
return -ENOMEM;
if (!prealloc) {
err = -ENOMEM;
goto out;
}

/*
* Avoid to free 'prealloc' if it can be merged with
Expand All @@ -1051,8 +1057,10 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
*/
if (state->start <= end && state->end > end) {
prealloc = alloc_extent_state_atomic(prealloc);
if (!prealloc)
return -ENOMEM;
if (!prealloc) {
err = -ENOMEM;
goto out;
}

err = split_state(tree, state, prealloc, end + 1);
BUG_ON(err == -EEXIST);
Expand Down

0 comments on commit 66cc7b1

Please sign in to comment.