aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/linux/zfs/zvol_os.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2022-05-27 17:51:55 +0000
committerBrian Behlendorf <[email protected]>2022-06-01 14:24:49 -0700
commit9ce5eb18efba19c615e82836fdd9fa77079087d4 (patch)
tree40651346129efd5dce3dfaaa82b21f575ca184c0 /module/os/linux/zfs/zvol_os.c
parent5a639f0802b2ef4feb6f6fe37599c47a26f9b1f0 (diff)
Linux 5.19 compat: bdev_max_discard_sectors()
Linux 5.19 commit torvalds/linux@70200574cc removed the blk_queue_discard() helper function. The preferred interface is to now use the bdev_max_discard_sectors() function to check for discard support. Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #13515
Diffstat (limited to 'module/os/linux/zfs/zvol_os.c')
-rw-r--r--module/os/linux/zfs/zvol_os.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/os/linux/zfs/zvol_os.c b/module/os/linux/zfs/zvol_os.c
index 5c509a06a..bb92c65ca 100644
--- a/module/os/linux/zfs/zvol_os.c
+++ b/module/os/linux/zfs/zvol_os.c
@@ -1050,7 +1050,9 @@ zvol_os_create_minor(const char *name)
(zvol_max_discard_blocks * zv->zv_volblocksize) >> 9);
blk_queue_discard_granularity(zv->zv_zso->zvo_queue,
zv->zv_volblocksize);
+#ifdef QUEUE_FLAG_DISCARD
blk_queue_flag_set(QUEUE_FLAG_DISCARD, zv->zv_zso->zvo_queue);
+#endif
#ifdef QUEUE_FLAG_NONROT
blk_queue_flag_set(QUEUE_FLAG_NONROT, zv->zv_zso->zvo_queue);
#endif