OSDN Git Service

btrfs: push __setup_root into btrfs_alloc_root
authorJosef Bacik <josef@toxicpanda.com>
Fri, 24 Jan 2020 14:32:18 +0000 (09:32 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:25 +0000 (17:01 +0100)
commit96dfcb46ffca4803627f7ae74085fbb2bae2acc5
tree32fcfadaf1faf1f62edb2f2a2737d8a335bf43c6
parent3f1c64ce04387773d2b0d8ef6a7e573ff80e4436
btrfs: push __setup_root into btrfs_alloc_root

There's no reason to not init the root at alloc time, and with later
patches it actually causes problems if we error out mounting the fs
before the tree_root is init'ed because we expect it to have a valid ref
count.  Fix this by pushing __setup_root into btrfs_alloc_root.

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/disk-io.c