提交 6103fb43 编写于 作者: F Filipe Manana 提交者: Josef Bacik

Btrfs: remove unnecessary ref heads rb tree search

When we didn't find the exact ref head we were looking for, if
return_bigger != 0 we set a new search key to match either the
next node after the last one we found or the first one in the
ref heads rb tree, and then did another full tree search. For both
cases this ended up being pointless as we would end up returning
an entry we already had before repeating the search.
Signed-off-by: NFilipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: NJosef Bacik <jbacik@fb.com>
上级 2c6a92b0
...@@ -205,7 +205,6 @@ find_ref_head(struct rb_root *root, u64 bytenr, ...@@ -205,7 +205,6 @@ find_ref_head(struct rb_root *root, u64 bytenr,
struct btrfs_delayed_ref_head *entry; struct btrfs_delayed_ref_head *entry;
int cmp = 0; int cmp = 0;
again:
n = root->rb_node; n = root->rb_node;
entry = NULL; entry = NULL;
while (n) { while (n) {
...@@ -234,9 +233,9 @@ find_ref_head(struct rb_root *root, u64 bytenr, ...@@ -234,9 +233,9 @@ find_ref_head(struct rb_root *root, u64 bytenr,
n = rb_first(root); n = rb_first(root);
entry = rb_entry(n, struct btrfs_delayed_ref_head, entry = rb_entry(n, struct btrfs_delayed_ref_head,
href_node); href_node);
bytenr = entry->node.bytenr; if (last)
return_bigger = 0; *last = entry;
goto again; return entry;
} }
return entry; return entry;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册