Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: remove bdev_nonrot()

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>

authored by

Damien Le Moal and committed by
Jens Axboe
ecd92cfe d0e5fc70

+10 -15
+1 -1
drivers/md/raid1.c
··· 1878 1878 if (info->rdev) 1879 1879 return false; 1880 1880 1881 - if (bdev_nonrot(rdev->bdev)) { 1881 + if (!bdev_rot(rdev->bdev)) { 1882 1882 set_bit(Nonrot, &rdev->flags); 1883 1883 WRITE_ONCE(conf->nonrot_disks, conf->nonrot_disks + 1); 1884 1884 }
+1 -1
drivers/md/raid10.c
··· 806 806 if (!do_balance) 807 807 break; 808 808 809 - nonrot = bdev_nonrot(rdev->bdev); 809 + nonrot = !bdev_rot(rdev->bdev); 810 810 has_nonrot_disk |= nonrot; 811 811 pending = atomic_read(&rdev->nr_pending); 812 812 if (min_pending > pending && nonrot) {
+1 -1
drivers/md/raid5.c
··· 7541 7541 rdev_for_each(rdev, mddev) { 7542 7542 if (test_bit(Journal, &rdev->flags)) 7543 7543 continue; 7544 - if (bdev_nonrot(rdev->bdev)) { 7544 + if (!bdev_rot(rdev->bdev)) { 7545 7545 conf->batch_bio_dispatch = false; 7546 7546 break; 7547 7547 }
+1 -1
drivers/target/target_core_file.c
··· 173 173 */ 174 174 dev->dev_attrib.max_write_same_len = 0xFFFF; 175 175 176 - if (bdev_nonrot(bdev)) 176 + if (!bdev_rot(bdev)) 177 177 dev->dev_attrib.is_nonrot = 1; 178 178 } else { 179 179 if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
+1 -1
drivers/target/target_core_iblock.c
··· 148 148 else 149 149 dev->dev_attrib.max_write_same_len = 0xFFFF; 150 150 151 - if (bdev_nonrot(bd)) 151 + if (!bdev_rot(bd)) 152 152 dev->dev_attrib.is_nonrot = 1; 153 153 154 154 target_configure_write_atomic_from_bdev(&dev->dev_attrib, bd);
+2 -2
fs/btrfs/volumes.c
··· 694 694 set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); 695 695 } 696 696 697 - if (!bdev_nonrot(file_bdev(bdev_file))) 697 + if (bdev_rot(file_bdev(bdev_file))) 698 698 fs_devices->rotating = true; 699 699 700 700 if (bdev_max_discard_sectors(file_bdev(bdev_file))) ··· 2919 2919 2920 2920 atomic64_add(device->total_bytes, &fs_info->free_chunk_space); 2921 2921 2922 - if (!bdev_nonrot(device->bdev)) 2922 + if (bdev_rot(device->bdev)) 2923 2923 fs_devices->rotating = true; 2924 2924 2925 2925 orig_super_total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
+1 -1
fs/ext4/mballoc-test.c
··· 72 72 ext4_fsblk_t block; 73 73 int ret; 74 74 75 - /* needed by ext4_mb_init->bdev_nonrot(sb->s_bdev) */ 75 + /* needed by ext4_mb_init->bdev_rot(sb->s_bdev) */ 76 76 sb->s_bdev = kzalloc_obj(*sb->s_bdev); 77 77 if (sb->s_bdev == NULL) 78 78 return -ENOMEM;
+1 -1
fs/ext4/mballoc.c
··· 3836 3836 spin_lock_init(&lg->lg_prealloc_lock); 3837 3837 } 3838 3838 3839 - if (bdev_nonrot(sb->s_bdev)) 3839 + if (!bdev_rot(sb->s_bdev)) 3840 3840 sbi->s_mb_max_linear_groups = 0; 3841 3841 else 3842 3842 sbi->s_mb_max_linear_groups = MB_DEFAULT_LINEAR_LIMIT;
-5
include/linux/blkdev.h
··· 1475 1475 return blk_queue_rot(bdev_get_queue(bdev)); 1476 1476 } 1477 1477 1478 - static inline bool bdev_nonrot(struct block_device *bdev) 1479 - { 1480 - return !bdev_rot(bdev); 1481 - } 1482 - 1483 1478 static inline bool bdev_synchronous(struct block_device *bdev) 1484 1479 { 1485 1480 return bdev->bd_disk->queue->limits.features & BLK_FEAT_SYNCHRONOUS;
+1 -1
mm/swapfile.c
··· 3460 3460 if (si->bdev && bdev_synchronous(si->bdev)) 3461 3461 si->flags |= SWP_SYNCHRONOUS_IO; 3462 3462 3463 - if (si->bdev && bdev_nonrot(si->bdev)) { 3463 + if (si->bdev && !bdev_rot(si->bdev)) { 3464 3464 si->flags |= SWP_SOLIDSTATE; 3465 3465 } else { 3466 3466 atomic_inc(&nr_rotate_swap);