Skip to content

Commit 766a71e

Browse files
Christoph Hellwigaxboe
authored andcommitted
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>
1 parent e888810 commit 766a71e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/blkdev.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,13 +779,13 @@ static inline void bdev_clear_flag(struct block_device *bdev, unsigned flag)
779779
atomic_andnot(flag, &bdev->__bd_flags);
780780
}
781781

782-
static inline int get_disk_ro(struct gendisk *disk)
782+
static inline bool get_disk_ro(struct gendisk *disk)
783783
{
784784
return bdev_test_flag(disk->part0, BD_READ_ONLY) ||
785785
test_bit(GD_READ_ONLY, &disk->state);
786786
}
787787

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

0 commit comments

Comments
 (0)