Skip to content

Commit 17c285a

Browse files
committed
btrfs: use the assigned fs_devices instead of the dereference
We have assigned the %fs_info->fs_devices in %fs_devices as its not modified just use it for the mutex_lock(). Signed-off-by: Anand Jain <[email protected]>
1 parent e2f7c8a commit 17c285a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/btrfs/volumes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,7 +2201,7 @@ static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info)
22012201
INIT_LIST_HEAD(&seed_devices->alloc_list);
22022202
mutex_init(&seed_devices->device_list_mutex);
22032203

2204-
mutex_lock(&fs_info->fs_devices->device_list_mutex);
2204+
mutex_lock(&fs_devices->device_list_mutex);
22052205
list_splice_init_rcu(&fs_devices->devices, &seed_devices->devices,
22062206
synchronize_rcu);
22072207
list_for_each_entry(device, &seed_devices->devices, dev_list)
@@ -2221,7 +2221,7 @@ static int btrfs_prepare_sprout(struct btrfs_fs_info *fs_info)
22212221
generate_random_uuid(fs_devices->fsid);
22222222
memcpy(fs_info->fsid, fs_devices->fsid, BTRFS_FSID_SIZE);
22232223
memcpy(disk_super->fsid, fs_devices->fsid, BTRFS_FSID_SIZE);
2224-
mutex_unlock(&fs_info->fs_devices->device_list_mutex);
2224+
mutex_unlock(&fs_devices->device_list_mutex);
22252225

22262226
super_flags = btrfs_super_flags(disk_super) &
22272227
~BTRFS_SUPER_FLAG_SEEDING;

0 commit comments

Comments
 (0)