mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 16:53:58 -05:00
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>
This commit is contained in:
parent
2aba0d19f4
commit
64dcc7c271
1 changed files with 1 additions and 5 deletions
|
@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev,
|
||||||
static ssize_t part_alignment_offset_show(struct device *dev,
|
static ssize_t part_alignment_offset_show(struct device *dev,
|
||||||
struct device_attribute *attr, char *buf)
|
struct device_attribute *attr, char *buf)
|
||||||
{
|
{
|
||||||
struct block_device *bdev = dev_to_bdev(dev);
|
return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev)));
|
||||||
|
|
||||||
return sprintf(buf, "%u\n",
|
|
||||||
queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits,
|
|
||||||
bdev->bd_start_sect));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t part_discard_alignment_show(struct device *dev,
|
static ssize_t part_discard_alignment_show(struct device *dev,
|
||||||
|
|
Loading…
Add table
Reference in a new issue