diff options
author | Christoph Hellwig <hch@lst.de> | 2024-11-19 17:09:23 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-11-19 19:07:13 -0700 |
commit | 766a71ef65bb217ed8bf1c068ac14c7d3c15d487 (patch) | |
tree | 92c52550bbecf0e40d0c3ca987a507f032789d55 | |
parent | e888810bc4f471f85989a0991aff28d2ac9f783b (diff) |
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: Christoph Hellwig <hch@lst.de>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20241119160932.1327864-7-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | include/linux/blkdev.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 8b4e4692e7fb..08a727b40816 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -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); } |