linux/drivers/block
Christoph Böhmwalder 0c57b39033 drbd: use blk_queue_max_discard_sectors helper
[ Upstream commit 258bea6388 ]

We currently only set q->limits.max_discard_sectors, but that is not
enough. Another field, max_hw_discard_sectors, was introduced in
commit 0034af0365 ("block: make /sys/block/<dev>/queue/discard_max_bytes
writeable").

The difference is that max_discard_sectors can be changed from user
space via sysfs, while max_hw_discard_sectors is the "hardware" upper
limit.

So use this helper, which sets both.

This is also a fixup for commit 998e9cbcd6 ("drbd: cleanup
decide_on_discard_support"): if discards are not supported, that does
not necessarily mean we also want to disable write_zeroes.

Fixes: 998e9cbcd6 ("drbd: cleanup decide_on_discard_support")
Reviewed-by: Joel Colledge <joel.colledge@linbit.com>
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Link: https://lore.kernel.org/r/20221109133453.51652-2-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:32:10 +01:00
..
aoe
drbd drbd: use blk_queue_max_discard_sectors helper 2022-12-31 13:32:10 +01:00
mtip32xx
null_blk
paride
rnbd
xen-blkback
zram
amiflop.c
ataflop.c
brd.c
floppy.c
Kconfig
loop.c
Makefile
n64cart.c
nbd.c
pktcdvd.c
ps3disk.c
ps3vram.c
rbd_types.h
rbd.c
sunvdc.c
swim_asm.S
swim.c
swim3.c
ublk_drv.c
virtio_blk.c
xen-blkfront.c
z2ram.c