]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
block: Drop granularity check in queue_limit_discard_alignment()
authorJohn Garry <john.g.garry@oracle.com>
Tue, 12 Nov 2024 09:21:44 +0000 (09:21 +0000)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Nov 2024 16:09:47 +0000 (09:09 -0700)
lim->discard_granularity is always at least SECTOR_SIZE, so drop the
pointless check for granularity less than SECTOR_SIZE.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20241112092144.4059847-1-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-settings.c

index 0fe16f987cdec7856e80d7f1531a8cc2829fac1f..2f1005da530c7ef6e9caaea1a905b1265abfab02 100644 (file)
@@ -465,8 +465,6 @@ static unsigned int queue_limit_discard_alignment(
        /* Why are these in bytes, not sectors? */
        alignment = lim->discard_alignment >> SECTOR_SHIFT;
        granularity = lim->discard_granularity >> SECTOR_SHIFT;
-       if (!granularity)
-               return 0;
 
        /* Offset of the partition start in 'granularity' sectors */
        offset = sector_div(sector, granularity);