btrfs: move btrfs_scratch_superblocks into btrfs_dev_replace_finishing
authorJosef Bacik <josef@toxicpanda.com>
Thu, 20 Aug 2020 15:18:26 +0000 (11:18 -0400)
committerDavid Sterba <dsterba@suse.com>
Fri, 25 Sep 2020 14:40:22 +0000 (16:40 +0200)
commit313b085851c13ca08320372a05a7047ea25d3dd4
tree6fe6b85bcd80720539057c913fe282adffb3c671
parentb5ddcffa37778244d5e786fe32f778edf2bfc93e
btrfs: move btrfs_scratch_superblocks into btrfs_dev_replace_finishing

We need to move the closing of the src_device out of all the device
replace locking, but we definitely want to zero out the superblock
before we commit the last time to make sure the device is properly
removed.  Handle this by pushing btrfs_scratch_superblocks into
btrfs_dev_replace_finishing, and then later on we'll move the src_device
closing and freeing stuff where we need it to be.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/dev-replace.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h