bdev_nonrot() is simply the negative return value of bdev_rot().
So replace all call sites of bdev_nonrot() with calls to bdev_rot()
and remove bdev_nonrot().
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
if (info->rdev)
return false;
- if (bdev_nonrot(rdev->bdev)) {
+ if (!bdev_rot(rdev->bdev)) {
set_bit(Nonrot, &rdev->flags);
WRITE_ONCE(conf->nonrot_disks, conf->nonrot_disks + 1);
}
if (!do_balance)
break;
- nonrot = bdev_nonrot(rdev->bdev);
+ nonrot = !bdev_rot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
if (min_pending > pending && nonrot) {
rdev_for_each(rdev, mddev) {
if (test_bit(Journal, &rdev->flags))
continue;
- if (bdev_nonrot(rdev->bdev)) {
+ if (!bdev_rot(rdev->bdev)) {
conf->batch_bio_dispatch = false;
break;
}
*/
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (bdev_nonrot(bdev))
+ if (!bdev_rot(bdev))
dev->dev_attrib.is_nonrot = 1;
} else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
else
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (bdev_nonrot(bd))
+ if (!bdev_rot(bd))
dev->dev_attrib.is_nonrot = 1;
target_configure_write_atomic_from_bdev(&dev->dev_attrib, bd);
set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
}
- if (!bdev_nonrot(file_bdev(bdev_file)))
+ if (bdev_rot(file_bdev(bdev_file)))
fs_devices->rotating = true;
if (bdev_max_discard_sectors(file_bdev(bdev_file)))
atomic64_add(device->total_bytes, &fs_info->free_chunk_space);
- if (!bdev_nonrot(device->bdev))
+ if (bdev_rot(device->bdev))
fs_devices->rotating = true;
orig_super_total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
ext4_fsblk_t block;
int ret;
- /* needed by ext4_mb_init->bdev_nonrot(sb->s_bdev) */
+ /* needed by ext4_mb_init->bdev_rot(sb->s_bdev) */
sb->s_bdev = kzalloc_obj(*sb->s_bdev);
if (sb->s_bdev == NULL)
return -ENOMEM;
spin_lock_init(&lg->lg_prealloc_lock);
}
- if (bdev_nonrot(sb->s_bdev))
+ if (!bdev_rot(sb->s_bdev))
sbi->s_mb_max_linear_groups = 0;
else
sbi->s_mb_max_linear_groups = MB_DEFAULT_LINEAR_LIMIT;
return blk_queue_rot(bdev_get_queue(bdev));
}
-static inline bool bdev_nonrot(struct block_device *bdev)
-{
- return !bdev_rot(bdev);
-}
-
static inline bool bdev_synchronous(struct block_device *bdev)
{
return bdev->bd_disk->queue->limits.features & BLK_FEAT_SYNCHRONOUS;
if (si->bdev && bdev_synchronous(si->bdev))
si->flags |= SWP_SYNCHRONOUS_IO;
- if (si->bdev && bdev_nonrot(si->bdev)) {
+ if (si->bdev && !bdev_rot(si->bdev)) {
si->flags |= SWP_SOLIDSTATE;
} else {
atomic_inc(&nr_rotate_swap);