summaryrefslogtreecommitdiff
path: root/include/linux/genhd.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-11-23 16:36:02 +0100
committerJens Axboe <axboe@kernel.dk>2020-12-01 14:53:40 -0700
commit83950d359010a493462d58c712b1124c877d1b3b (patch)
tree303ad13fa9390c8764e8dde72119d789f14df769 /include/linux/genhd.h
parentb309e9936347232c724eaa13f70533128b4864e9 (diff)
block: move the policy field to struct block_device
Move the policy field to struct block_device and rename it to the more descriptive bd_read_only. Also turn the field into a bool as it is used as such. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/genhd.h')
-rw-r--r--include/linux/genhd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 349cf6403ccd..dcbf9ef7610e 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -55,7 +55,7 @@ struct hd_struct {
struct block_device *bdev;
struct device __dev;
- int policy, partno;
+ int partno;
struct rcu_work rcu_work;
};
@@ -278,7 +278,7 @@ extern void set_disk_ro(struct gendisk *disk, int flag);
static inline int get_disk_ro(struct gendisk *disk)
{
- return disk->part0.policy;
+ return disk->part0.bdev->bd_read_only;
}
extern void disk_block_events(struct gendisk *disk);