diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2024-04-12 01:15:55 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2024-05-02 19:50:29 -0400 |
commit | 01e198f01d55880b79d8f5ac73064ff30a89d98a (patch) | |
tree | 5ba9d3b7f62832b90d82a3c2f7b54d222ee6f6e6 /include | |
parent | 1116b9fa15c09748ae05d2365a305fa22671eb1e (diff) |
bdev: move ->bd_read_only to ->__bd_flags
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blk_types.h | 2 | ||||
-rw-r--r-- | include/linux/blkdev.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 04f92737ab08..f70dd31cbcd1 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -47,7 +47,7 @@ struct block_device { unsigned long bd_stamp; atomic_t __bd_flags; // partition number + flags #define BD_PARTNO 255 // lower 8 bits; assign-once - bool bd_read_only; /* read-only policy */ +#define BD_READ_ONLY (1u<<8) // read-only policy bool bd_write_holder; bool bd_has_submit_bio; dev_t bd_dev; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 99917e5860fd..1fe91231f85b 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -742,13 +742,13 @@ static inline void bdev_clear_flag(struct block_device *bdev, unsigned flag) static inline int get_disk_ro(struct gendisk *disk) { - return disk->part0->bd_read_only || + 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) { - return bdev->bd_read_only || get_disk_ro(bdev->bd_disk); + return bdev_test_flag(bdev, BD_READ_ONLY) || get_disk_ro(bdev->bd_disk); } bool set_capacity_and_notify(struct gendisk *disk, sector_t size); |