Skip to content

Commit d47de6a

Browse files
johnpgarryaxboe
authored andcommitted
loop: Simplify discard granularity calc
A bdev discard granularity is always at least SECTOR_SIZE, so don't check for a zero value. Suggested-by: Christoph Hellwig <[email protected]> Signed-off-by: John Garry <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent f187b9b commit d47de6a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/block/loop.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,7 @@ static void loop_config_discard(struct loop_device *lo,
789789
struct block_device *bdev = I_BDEV(inode);
790790

791791
max_discard_sectors = bdev_write_zeroes_sectors(bdev);
792-
granularity = bdev_discard_granularity(bdev) ?:
793-
bdev_physical_block_size(bdev);
792+
granularity = bdev_discard_granularity(bdev);
794793

795794
/*
796795
* We use punch hole to reclaim the free space used by the

0 commit comments

Comments
 (0)