diff options
author | Anand Jain <Anand.Jain@oracle.com> | 2014-08-13 02:24:19 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-17 16:38:04 -0400 |
commit | d51908ce4e5d7f7b07867180e36b9935094b78f2 (patch) | |
tree | 86ae036c1c55f0bf9543b3ecea11d075030c2945 /fs | |
parent | 56094eecd32cbb80d098eee5a7cbd60f39f4b764 (diff) |
btrfs: preparatory to make btrfs_rm_dev_replace_srcdev() seed aware
There is no logical change in this patch, just a preparatory patch,
so that changes can be easily reasoned.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/volumes.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index ff8386eb3367..096b4a3dc5a9 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -1815,19 +1815,23 @@ error_undo: | |||
1815 | void btrfs_rm_dev_replace_srcdev(struct btrfs_fs_info *fs_info, | 1815 | void btrfs_rm_dev_replace_srcdev(struct btrfs_fs_info *fs_info, |
1816 | struct btrfs_device *srcdev) | 1816 | struct btrfs_device *srcdev) |
1817 | { | 1817 | { |
1818 | struct btrfs_fs_devices *fs_devices; | ||
1819 | |||
1818 | WARN_ON(!mutex_is_locked(&fs_info->fs_devices->device_list_mutex)); | 1820 | WARN_ON(!mutex_is_locked(&fs_info->fs_devices->device_list_mutex)); |
1819 | 1821 | ||
1822 | fs_devices = fs_info->fs_devices; | ||
1823 | |||
1820 | list_del_rcu(&srcdev->dev_list); | 1824 | list_del_rcu(&srcdev->dev_list); |
1821 | list_del_rcu(&srcdev->dev_alloc_list); | 1825 | list_del_rcu(&srcdev->dev_alloc_list); |
1822 | fs_info->fs_devices->num_devices--; | 1826 | fs_devices->num_devices--; |
1823 | if (srcdev->missing) { | 1827 | if (srcdev->missing) { |
1824 | fs_info->fs_devices->missing_devices--; | 1828 | fs_devices->missing_devices--; |
1825 | fs_info->fs_devices->rw_devices++; | 1829 | fs_devices->rw_devices++; |
1826 | } | 1830 | } |
1827 | if (srcdev->can_discard) | 1831 | if (srcdev->can_discard) |
1828 | fs_info->fs_devices->num_can_discard--; | 1832 | fs_devices->num_can_discard--; |
1829 | if (srcdev->bdev) { | 1833 | if (srcdev->bdev) { |
1830 | fs_info->fs_devices->open_devices--; | 1834 | fs_devices->open_devices--; |
1831 | 1835 | ||
1832 | /* | 1836 | /* |
1833 | * zero out the old super if it is not writable | 1837 | * zero out the old super if it is not writable |