diff options
author | Christoph Hellwig <hch@lst.de> | 2020-08-31 21:02:34 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-09-02 01:49:26 +0300 |
commit | 7cf34d97ab45203b975396393ded9d3867dfa8bf (patch) | |
tree | 67f8c18b472ef61230e37cd14c200fc3e2a9396e /block/partitions | |
parent | 7b8917f5e29c377be1db5680249fe30e038cb3eb (diff) | |
download | linux-7cf34d97ab45203b975396393ded9d3867dfa8bf.tar.xz |
block: remove the discard_alignment field from struct hd_struct
The alignment offset is only used in slow path callers, so just calculate
it on the fly.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/partitions')
-rw-r--r-- | block/partitions/core.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c index 94c2fb39e602..e596a85bba1e 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -209,7 +209,10 @@ static ssize_t part_discard_alignment_show(struct device *dev, struct device_attribute *attr, char *buf) { struct hd_struct *p = dev_to_part(dev); - return sprintf(buf, "%u\n", p->discard_alignment); + + return sprintf(buf, "%u\n", + queue_limit_discard_alignment(&part_to_disk(p)->queue->limits, + p->start_sect)); } static DEVICE_ATTR(partition, 0444, part_partition_show, NULL); @@ -408,8 +411,6 @@ static struct hd_struct *add_partition(struct gendisk *disk, int partno, pdev = part_to_dev(p); p->start_sect = start; - p->discard_alignment = - queue_limit_discard_alignment(&disk->queue->limits, start); p->nr_sects = len; p->partno = partno; p->policy = get_disk_ro(disk); |