]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
btrfs: make btrfs_find_orphan_roots use btrfs_get_fs_root
authorJosef Bacik <josef@toxicpanda.com>
Fri, 24 Jan 2020 14:32:20 +0000 (09:32 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:25 +0000 (17:01 +0100)
commite59d18b45d081d66a2fb1a9d144fa82d4807b18d
treedbcee080ccf7d18a424f7e92712bdd79dc640838
parentf39e457156f919b849eb2c12a7a4452a1f2be15b
btrfs: make btrfs_find_orphan_roots use btrfs_get_fs_root

btrfs_find_orphan_roots has this weird thing where it looks up the root
in cache to see if it is there before just reading the root.  But the
read it uses just reads the root, it doesn't do any of the init work, we
do that by hand here.  But this is unnecessary, all we really want is to
see if the root still exists and add it to the dead roots list to be
cleaned up, otherwise we delete the orphan item.

Fix this by just using btrfs_get_fs_root directly with check_ref set to
false so we get the orphan root items.  Then we just handle in cache and
out of cache roots the same, add them to the dead roots list and carry
on.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
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/root-tree.c