]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: make tree_search_for_insert return extent_state
authorJosef Bacik <josef@toxicpanda.com>
Fri, 9 Sep 2022 21:53:35 +0000 (17:53 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Sep 2022 10:28:04 +0000 (12:28 +0200)
commit111c5dde7e07a2c15190f55fef2676531cd8c22d
treea31c72de126a7ba071e9792569c3ed18c6111796
parentcdca251c6a926bf1221e65831cb9669978b784e3
btrfs: make tree_search_for_insert return extent_state

We use this to search for an extent state, or return the nodes we need
to insert a new extent state.  This means we have the following pattern

node = tree_search_for_insert();
if (!node) {
/* alloc and insert. */
goto again;
}
state = rb_entry(node, struct extent_state, rb_node);

we don't use the node for anything else.  Making
tree_search_for_insert() return the extent_state means we can drop the
rb_node and clean this up by eliminating the rb_entry.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-io-tree.c