Skip to content

Commit 738be13

Browse files
Christoph Hellwigaxboe
authored andcommitted
xen-blkfront: rely on the default discard granularity
The block layer now sets the discard granularity to the physical block size default. Take advantage of that in xen-blkfront and only set the discard granularity if explicitly specified. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Roger Pau Monné <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 4a718d7 commit 738be13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/xen-blkfront.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,8 @@ static void blkif_set_queue_limits(struct blkfront_info *info)
951951

952952
if (info->feature_discard) {
953953
blk_queue_max_discard_sectors(rq, UINT_MAX);
954-
rq->limits.discard_granularity = info->discard_granularity ?:
955-
info->physical_sector_size;
954+
if (info->discard_granularity)
955+
rq->limits.discard_granularity = info->discard_granularity;
956956
rq->limits.discard_alignment = info->discard_alignment;
957957
if (info->feature_secdiscard)
958958
blk_queue_max_secure_erase_sectors(rq, UINT_MAX);

0 commit comments

Comments
 (0)