diff options
author | Christoph Hellwig <hch@lst.de> | 2022-04-15 06:52:47 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-18 03:49:59 +0200 |
commit | 64dcc7c2717395b7c83ffb10f040d3be795d03c1 (patch) | |
tree | 0895fe0cbbcc8241b1eac7b943e6759e9e3df5bd /block/partitions | |
parent | block: add a bdev_max_zone_append_sectors helper (diff) | |
download | linux-64dcc7c2717395b7c83ffb10f040d3be795d03c1.tar.xz linux-64dcc7c2717395b7c83ffb10f040d3be795d03c1.zip |
block: use bdev_alignment_offset in part_alignment_offset_show
Replace the open coded offset calculation with the proper helper.
This is an ABI change in that the -1 for a misaligned partition is
properly propagated, which can be considered a bug fix and matches
what is done on the whole device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220415045258.199825-17-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/partitions')
-rw-r--r-- | block/partitions/core.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/block/partitions/core.c b/block/partitions/core.c index 2ef8dfa1e5c8..240b3fff521e 100644 --- a/block/partitions/core.c +++ b/block/partitions/core.c @@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev, static ssize_t part_alignment_offset_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct block_device *bdev = dev_to_bdev(dev); - - return sprintf(buf, "%u\n", - queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits, - bdev->bd_start_sect)); + return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev))); } static ssize_t part_discard_alignment_show(struct device *dev, |