diff options
author | Anand Jain <anand.jain@oracle.com> | 2017-11-06 10:28:00 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-01-22 16:08:11 +0100 |
commit | 2c9973847fa0230ea82935a9c486cb38ef599893 (patch) | |
tree | f3e2f3fdc7ccd7ada0cb0b4d3c49dd3f19545966 /fs/btrfs/volumes.c | |
parent | 96b09dde92515956c992c1b330f00399487f47b3 (diff) | |
download | lwn-2c9973847fa0230ea82935a9c486cb38ef599893.tar.gz lwn-2c9973847fa0230ea82935a9c486cb38ef599893.zip |
btrfs: move volume_mutex into the btrfs_rm_device()
A cleanup patch no functional change, we hold volume_mutex before
calling btrfs_rm_device, so move it into the function itself.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 7ea81e1b361f..02b2c9ec6fcd 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1842,6 +1842,7 @@ int btrfs_rm_device(struct btrfs_fs_info *fs_info, const char *device_path, u64 num_devices; int ret = 0; + mutex_lock(&fs_info->volume_mutex); mutex_lock(&uuid_mutex); num_devices = fs_info->fs_devices->num_devices; @@ -1956,6 +1957,7 @@ int btrfs_rm_device(struct btrfs_fs_info *fs_info, const char *device_path, out: mutex_unlock(&uuid_mutex); + mutex_unlock(&fs_info->volume_mutex); return ret; error_undo: |