Commit e884f4f0 authored by Anand Jain's avatar Anand Jain Committed by David Sterba

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: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 42c61ab6
...@@ -1013,14 +1013,13 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices, ...@@ -1013,14 +1013,13 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
q = bdev_get_queue(bdev); q = bdev_get_queue(bdev);
if (blk_queue_discard(q)) if (blk_queue_discard(q))
device->can_discard = 1; device->can_discard = 1;
if (!blk_queue_nonrot(q))
fs_devices->rotating = 1;
device->bdev = bdev; device->bdev = bdev;
device->in_fs_metadata = 0; device->in_fs_metadata = 0;
device->mode = flags; device->mode = flags;
if (!blk_queue_nonrot(bdev_get_queue(bdev)))
fs_devices->rotating = 1;
fs_devices->open_devices++; fs_devices->open_devices++;
if (device->writeable && if (device->writeable &&
device->devid != BTRFS_DEV_REPLACE_DEVID) { 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,7 +2421,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
fs_info->free_chunk_space += device->total_bytes; fs_info->free_chunk_space += device->total_bytes;
spin_unlock(&fs_info->free_chunk_lock); spin_unlock(&fs_info->free_chunk_lock);
if (!blk_queue_nonrot(bdev_get_queue(bdev))) if (!blk_queue_nonrot(q))
fs_info->fs_devices->rotating = 1; fs_info->fs_devices->rotating = 1;
tmp = btrfs_super_total_bytes(fs_info->super_copy); tmp = btrfs_super_total_bytes(fs_info->super_copy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment