]> git.baikalelectronics.ru Git - kernel.git/commitdiff
block: use bdev_discard_alignment in part_discard_alignment_show
authorChristoph Hellwig <hch@lst.de>
Fri, 15 Apr 2022 04:52:51 +0000 (06:52 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Apr 2022 01:49:59 +0000 (19:49 -0600)
Use the bdev based alignment helper instead of open coding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20220415045258.199825-21-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/partitions/core.c

index 240b3fff521e4c0a942e2d881707cc6f237718d7..70dec1c78521d5516c134a01bcaedd16c3790ce6 100644 (file)
@@ -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);