mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
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 <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #13515
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -1053,7 +1053,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
|
||||
|
||||
Reference in New Issue
Block a user