Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147781
b: refs/heads/master
c: 85d4198
h: refs/heads/master
i:
  147779: 835c532
v: v3
  • Loading branch information
Yan Zheng authored and Chris Mason committed Jun 11, 2009
1 parent 231c9ed commit 29ea4e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 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: fd0fb038d5a308c7faddd1701be5e70aaffec98b
refs/heads/master: 85d4198e40c289dd623cecd16601fa613559bed7
15 changes: 4 additions & 11 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,8 +1056,7 @@ int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
want = extent_ref_type(parent, owner);
if (insert) {
extra_size = btrfs_extent_inline_ref_size(want);
if (owner >= BTRFS_FIRST_FREE_OBJECTID)
path->keep_locks = 1;
path->keep_locks = 1;
} else
extra_size = -1;
ret = btrfs_search_slot(trans, root, &key, path, extra_size, 1);
Expand Down Expand Up @@ -1087,12 +1086,6 @@ int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
#endif
BUG_ON(item_size < sizeof(*ei));

if (owner < BTRFS_FIRST_FREE_OBJECTID && insert &&
item_size + extra_size >= BTRFS_MAX_EXTENT_ITEM_SIZE(root)) {
err = -EAGAIN;
goto out;
}

ei = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_item);
flags = btrfs_extent_flags(leaf, ei);

Expand Down Expand Up @@ -1165,15 +1158,15 @@ int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
* For simplicity, we just do not add new inline back
* ref if there is any kind of item for this block
*/
if (owner >= BTRFS_FIRST_FREE_OBJECTID &&
find_next_key(path, &key) == 0 && key.objectid == bytenr) {
if (find_next_key(path, &key) == 0 && key.objectid == bytenr &&
key.type < BTRFS_BLOCK_GROUP_ITEM_KEY) {
err = -EAGAIN;
goto out;
}
}
*ref_ret = (struct btrfs_extent_inline_ref *)ptr;
out:
if (insert && owner >= BTRFS_FIRST_FREE_OBJECTID) {
if (insert) {
path->keep_locks = 0;
btrfs_unlock_up_safe(path, 1);
}
Expand Down

0 comments on commit 29ea4e6

Please sign in to comment.