diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-06-14 16:10:13 +0200 |
---|---|---|
committer | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-06-14 18:44:20 +0200 |
commit | f617e2fd52484fb74236a597d0f9068ec7d9d2dd (patch) | |
tree | e03dda81d6e049f9f1382f47bcc750b6764dc27b /fs | |
parent | Btrfs: remove call to btrfs_header_nritems with no effect (diff) | |
download | linux-f617e2fd52484fb74236a597d0f9068ec7d9d2dd.tar.xz linux-f617e2fd52484fb74236a597d0f9068ec7d9d2dd.zip |
Btrfs: remove obsolete btrfs_next_leaf call from __resolve_indirect_ref
When resolving indirect refs, we used to call btrfs_next_leaf in case we
didn't find an exact match. While we should find exact matches most of the
time, in case we don't, we must continue searching. Treating those matches
differently depending on the level we're searching doesn't make sense.
Even worse, we might end up searching for a key larger than the largest, in
which case there is no next_leaf and subsequent jobs would fail. This commit
drops the bogous lines.
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/backref.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 3f75895c919b..579131de1b3b 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -294,16 +294,8 @@ static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info, goto out; } - if (level == 0) { - if (ret == 1 && path->slots[0] >= btrfs_header_nritems(eb)) { - ret = btrfs_next_leaf(root, path); - if (ret) - goto out; - eb = path->nodes[0]; - } - + if (level == 0) btrfs_item_key_to_cpu(eb, &key, path->slots[0]); - } ret = add_all_parents(root, path, parents, level, &key, ref->wanted_disk_byte, extent_item_pos); |