]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: move get root out of btrfs_search_slot to a helper
authorLiu Bo <bo.liu@linux.alibaba.com>
Fri, 18 May 2018 03:00:21 +0000 (11:00 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 30 May 2018 14:46:44 +0000 (16:46 +0200)
commit145c7e902e390df0a4bf017e7890da32303bdc4a
treefeda6b6a30825b0c9016f516267363b72a22bd5c
parentf9cf9dbd6687c87760cbe9a55149fafcb6bdf43e
Btrfs: move get root out of btrfs_search_slot to a helper

It's good to have a helper instead of having all get-root details
open-coded.  The new helper locks (if necessary) and sets root node of
the path.

Also invert the checks to make the code flow easier to read.  There is
no functional change in this commit.

Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c