summaryrefslogtreecommitdiff
path: root/block/partitions
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-08-31 20:02:33 +0200
committerJens Axboe <axboe@kernel.dk>2020-09-01 16:49:26 -0600
commit7b8917f5e29c377be1db5680249fe30e038cb3eb (patch)
tree08fe31667ad1977295a57dd95c29154ddc069f69 /block/partitions
parente44a6a2359808e0b97ff894569748ad2593b06f9 (diff)
downloadlwn-7b8917f5e29c377be1db5680249fe30e038cb3eb.tar.gz
lwn-7b8917f5e29c377be1db5680249fe30e038cb3eb.zip
block: remove the alignment_offset 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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c
index b1c0b50ca92d..94c2fb39e602 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -199,7 +199,10 @@ static ssize_t part_alignment_offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct hd_struct *p = dev_to_part(dev);
- return sprintf(buf, "%llu\n", (unsigned long long)p->alignment_offset);
+
+ return sprintf(buf, "%u\n",
+ queue_limit_alignment_offset(&part_to_disk(p)->queue->limits,
+ p->start_sect));
}
static ssize_t part_discard_alignment_show(struct device *dev,
@@ -405,8 +408,6 @@ static struct hd_struct *add_partition(struct gendisk *disk, int partno,
pdev = part_to_dev(p);
p->start_sect = start;
- p->alignment_offset =
- queue_limit_alignment_offset(&disk->queue->limits, start);
p->discard_alignment =
queue_limit_discard_alignment(&disk->queue->limits, start);
p->nr_sects = len;