summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-02-21 15:58:43 +0300
committerJens Axboe <axboe@kernel.dk>2024-02-27 19:33:08 +0300
commit738be136327a56e5a67e1942a2c318fb91914a3f (patch)
tree96a50748459c15ad8a40dee4e4d221ebdcde35ef /drivers/block
parent4a718d7dbab873bc24034fc865d3a5442632d1fd (diff)
downloadlinux-738be136327a56e5a67e1942a2c318fb91914a3f.tar.xz
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 <hch@lst.de> Acked-by: Roger Pau Monné <roger.pau@citrix.com> Link: https://lore.kernel.org/r/20240221125845.3610668-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/xen-blkfront.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index f78167cd5a63..1258f24b2855 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -951,8 +951,8 @@ static void blkif_set_queue_limits(struct blkfront_info *info)
if (info->feature_discard) {
blk_queue_max_discard_sectors(rq, UINT_MAX);
- rq->limits.discard_granularity = info->discard_granularity ?:
- info->physical_sector_size;
+ if (info->discard_granularity)
+ rq->limits.discard_granularity = info->discard_granularity;
rq->limits.discard_alignment = info->discard_alignment;
if (info->feature_secdiscard)
blk_queue_max_secure_erase_sectors(rq, UINT_MAX);