Commit ecd92cfe authored by Damien Le Moal's avatar Damien Le Moal Committed by Jens Axboe
Browse files

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: default avatarDamien Le Moal <dlemoal@kernel.org>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: default avatarPaul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d0e5fc70
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1878,7 +1878,7 @@ static bool raid1_add_conf(struct r1conf *conf, struct md_rdev *rdev, int disk,
	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);
	}
+1 −1
Original line number Diff line number Diff line
@@ -806,7 +806,7 @@ static struct md_rdev *read_balance(struct r10conf *conf,
		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) {
+1 −1
Original line number Diff line number Diff line
@@ -7541,7 +7541,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
	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;
		}
+1 −1
Original line number Diff line number Diff line
@@ -173,7 +173,7 @@ static int fd_configure_device(struct se_device *dev)
		 */
		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)) {
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ static int iblock_configure_device(struct se_device *dev)
	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);
Loading