diff options
author | Anand Jain <anand.jain@oracle.com> | 2017-04-04 06:40:19 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-04-18 08:07:26 -0400 |
commit | e884f4f06e89616ba32badcc7d87762e39a792e5 (patch) | |
tree | 92c048bb4292f0b45c928ff71e6f20d4c88b134c | |
parent | 42c61ab6760f5f6929ebf5a73b7e32b9aa51fbd5 (diff) |
btrfs: use q which is already obtained from bdev_get_queue
We have already assigned q from bdev_get_queue() so use it.
And rearrange the code for better view.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/volumes.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 2a4eada25743..6cad3233181c 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -1013,14 +1013,13 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices, | |||
1013 | q = bdev_get_queue(bdev); | 1013 | q = bdev_get_queue(bdev); |
1014 | if (blk_queue_discard(q)) | 1014 | if (blk_queue_discard(q)) |
1015 | device->can_discard = 1; | 1015 | device->can_discard = 1; |
1016 | if (!blk_queue_nonrot(q)) | ||
1017 | fs_devices->rotating = 1; | ||
1016 | 1018 | ||
1017 | device->bdev = bdev; | 1019 | device->bdev = bdev; |
1018 | device->in_fs_metadata = 0; | 1020 | device->in_fs_metadata = 0; |
1019 | device->mode = flags; | 1021 | device->mode = flags; |
1020 | 1022 | ||
1021 | if (!blk_queue_nonrot(bdev_get_queue(bdev))) | ||
1022 | fs_devices->rotating = 1; | ||
1023 | |||
1024 | fs_devices->open_devices++; | 1023 | fs_devices->open_devices++; |
1025 | if (device->writeable && | 1024 | if (device->writeable && |
1026 | device->devid != BTRFS_DEV_REPLACE_DEVID) { | 1025 | device->devid != BTRFS_DEV_REPLACE_DEVID) { |
@@ -2422,7 +2421,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path | |||
2422 | fs_info->free_chunk_space += device->total_bytes; | 2421 | fs_info->free_chunk_space += device->total_bytes; |
2423 | spin_unlock(&fs_info->free_chunk_lock); | 2422 | spin_unlock(&fs_info->free_chunk_lock); |
2424 | 2423 | ||
2425 | if (!blk_queue_nonrot(bdev_get_queue(bdev))) | 2424 | if (!blk_queue_nonrot(q)) |
2426 | fs_info->fs_devices->rotating = 1; | 2425 | fs_info->fs_devices->rotating = 1; |
2427 | 2426 | ||
2428 | tmp = btrfs_super_total_bytes(fs_info->super_copy); | 2427 | tmp = btrfs_super_total_bytes(fs_info->super_copy); |