diff options
author | Brian Behlendorf <[email protected]> | 2022-05-27 17:51:55 +0000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-06-01 14:24:49 -0700 |
commit | 9ce5eb18efba19c615e82836fdd9fa77079087d4 (patch) | |
tree | 40651346129efd5dce3dfaaa82b21f575ca184c0 /module/os/linux/zfs | |
parent | 5a639f0802b2ef4feb6f6fe37599c47a26f9b1f0 (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')
-rw-r--r-- | module/os/linux/zfs/vdev_disk.c | 2 | ||||
-rw-r--r-- | module/os/linux/zfs/zvol_os.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/module/os/linux/zfs/vdev_disk.c b/module/os/linux/zfs/vdev_disk.c index d6f9311be..ed933656d 100644 --- a/module/os/linux/zfs/vdev_disk.c +++ b/module/os/linux/zfs/vdev_disk.c @@ -316,7 +316,7 @@ vdev_disk_open(vdev_t *v, uint64_t *psize, uint64_t *max_psize, v->vdev_nowritecache = B_FALSE; /* Set when device reports it supports TRIM. */ - v->vdev_has_trim = !!blk_queue_discard(q); + v->vdev_has_trim = bdev_discard_supported(vd->vd_bdev); /* Set when device reports it supports secure TRIM. */ v->vdev_has_securetrim = !!blk_queue_discard_secure(q); 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 |