btrfs: do btrfs_free_stale_devices outside of device_list_add
authorAnand Jain <anand.jain@oracle.com>
Tue, 29 May 2018 04:28:37 +0000 (12:28 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:46 +0000 (13:12 +0200)
commit4306a97449f9a0f9e5229af7889d4401315355aa
treee235494ba6769ec625db65560f73b877688e9bc5
parent959b1c04675735aa51b9a7b3e28963c4141bf3e7
btrfs: do btrfs_free_stale_devices outside of device_list_add

btrfs_free_stale_devices() looks for device path reused for another
filesystem, and deletes the older fs_devices::device entry.

In preparation to handle locking in device_list_add, move
btrfs_free_stale_devices outside as these two functions serve a
different purpose.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c