diff options
author | Christoph Hellwig | 2020-11-23 16:36:02 +0100 |
---|---|---|
committer | Jens Axboe | 2020-12-01 14:53:40 -0700 |
commit | 83950d359010a493462d58c712b1124c877d1b3b (patch) | |
tree | 303ad13fa9390c8764e8dde72119d789f14df769 /block/partitions | |
parent | b309e9936347232c724eaa13f70533128b4864e9 (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 'block/partitions')
-rw-r--r-- | block/partitions/core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c index c068471fa654..060c1be13cd8 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -199,7 +199,7 @@ static ssize_t part_ro_show(struct device *dev, struct device_attribute *attr, char *buf) { struct hd_struct *p = dev_to_part(dev); - return sprintf(buf, "%d\n", p->policy ? 1 : 0); + return sprintf(buf, "%d\n", p->bdev->bd_read_only); } static ssize_t part_alignment_offset_show(struct device *dev, @@ -420,7 +420,7 @@ static struct hd_struct *add_partition(struct gendisk *disk, int partno, bdev->bd_start_sect = start; bdev_set_nr_sectors(bdev, len); p->partno = partno; - p->policy = get_disk_ro(disk); + bdev->bd_read_only = get_disk_ro(disk); if (info) { err = -ENOMEM; |