Commit 766a71ef authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

block: return bool from get_disk_ro and bdev_read_only



get_disk_ro and bdev_read_only return boolean conditions,
don't masquerade them as int.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohn Garry <john.g.garry@oracle.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20241119160932.1327864-7-hch@lst.de


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e888810b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -779,13 +779,13 @@ static inline void bdev_clear_flag(struct block_device *bdev, unsigned flag)
	atomic_andnot(flag, &bdev->__bd_flags);
}

static inline int get_disk_ro(struct gendisk *disk)
static inline bool get_disk_ro(struct gendisk *disk)
{
	return bdev_test_flag(disk->part0, BD_READ_ONLY) ||
		test_bit(GD_READ_ONLY, &disk->state);
}

static inline int bdev_read_only(struct block_device *bdev)
static inline bool bdev_read_only(struct block_device *bdev)
{
	return bdev_test_flag(bdev, BD_READ_ONLY) || get_disk_ro(bdev->bd_disk);
}