Skip to content

Commit 722f6de

Browse files
johnpgarrygregkh
authored andcommitted
loop: Simplify discard granularity calc
[ Upstream commit d47de6a ] 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]> Stable-dep-of: f5c84ef ("loop: Add sanity check for read/write_iter") Signed-off-by: Sasha Levin <[email protected]>
1 parent 02a77b3 commit 722f6de

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
@@ -713,8 +713,7 @@ static void loop_config_discard(struct loop_device *lo,
713713
struct block_device *bdev = I_BDEV(inode);
714714

715715
max_discard_sectors = bdev_write_zeroes_sectors(bdev);
716-
granularity = bdev_discard_granularity(bdev) ?:
717-
bdev_physical_block_size(bdev);
716+
granularity = bdev_discard_granularity(bdev);
718717

719718
/*
720719
* We use punch hole to reclaim the free space used by the

0 commit comments

Comments
 (0)