]> 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)
commitd1163c4fc147769fe3f5a4c0cd3a58bda41905f1
treefeda6b6a30825b0c9016f516267363b72a22bd5c
parent5582a6851a373d37c21633425f111a137472137e
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