summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorJohn Garry <john.g.garry@oracle.com>2024-10-30 11:19:00 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-18 08:24:56 +0200
commit02a77b3020a2b8777ead56468e8f1421e640ebd6 (patch)
tree15567ed80cec4a1eac97a6001de7f0cd9c2a73a5 /drivers/block
parent126be03494f2f9d3352910885e28a0f89f2aa576 (diff)
downloadlinux-02a77b3020a2b8777ead56468e8f1421e640ebd6.tar.gz
linux-02a77b3020a2b8777ead56468e8f1421e640ebd6.tar.bz2
linux-02a77b3020a2b8777ead56468e8f1421e640ebd6.zip
loop: Use bdev limit helpers for configuring discard
[ Upstream commit 8d3fd059dd289e6c322e5741ad56794bcce699a2 ] Instead of directly looking at the request_queue limits, use the bdev limits helpers, which is preferable. Signed-off-by: John Garry <john.g.garry@oracle.com> Link: https://lore.kernel.org/r/20241030111900.3981223-1-john.g.garry@oracle.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Stable-dep-of: f5c84eff634b ("loop: Add sanity check for read/write_iter") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/loop.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 8827a768284a..b3355a8d7896 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -710,11 +710,11 @@ static void loop_config_discard(struct loop_device *lo,
* file-backed loop devices: discarded regions read back as zero.
*/
if (S_ISBLK(inode->i_mode)) {
- struct request_queue *backingq = bdev_get_queue(I_BDEV(inode));
+ struct block_device *bdev = I_BDEV(inode);
- max_discard_sectors = backingq->limits.max_write_zeroes_sectors;
- granularity = bdev_discard_granularity(I_BDEV(inode)) ?:
- queue_physical_block_size(backingq);
+ max_discard_sectors = bdev_write_zeroes_sectors(bdev);
+ granularity = bdev_discard_granularity(bdev) ?:
+ bdev_physical_block_size(bdev);
/*
* We use punch hole to reclaim the free space used by the