Commit f0f975a4 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: use bdev_discard_alignment in part_discard_alignment_show

Use the bdev based alignment helper instead of open coding it.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20220415045258.199825-21-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 4e1462ff
......@@ -206,11 +206,7 @@ static ssize_t part_alignment_offset_show(struct device *dev,
static ssize_t part_discard_alignment_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_discard_alignment(&bdev_get_queue(bdev)->limits,
bdev->bd_start_sect));
return sprintf(buf, "%u\n", bdev_discard_alignment(dev_to_bdev(dev)));
}
static DEVICE_ATTR(partition, 0444, part_partition_show, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment