mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Allow opt-in of zvol blocks in special class
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Kjeld Schouten <kjeld@schouten-lebbing.nl> Signed-off-by: Don Brady <dev.fs.zfs@gmail.com> Closes #14876
This commit is contained in:
+2
-1
@@ -2489,7 +2489,8 @@ dmu_write_policy(objset_t *os, dnode_t *dn, int level, int wp, zio_prop_t *zp)
|
||||
memset(zp->zp_salt, 0, ZIO_DATA_SALT_LEN);
|
||||
memset(zp->zp_iv, 0, ZIO_DATA_IV_LEN);
|
||||
memset(zp->zp_mac, 0, ZIO_DATA_MAC_LEN);
|
||||
zp->zp_zpl_smallblk = DMU_OT_IS_FILE(zp->zp_type) ?
|
||||
zp->zp_zpl_smallblk = (DMU_OT_IS_FILE(zp->zp_type) ||
|
||||
zp->zp_type == DMU_OT_ZVOL) ?
|
||||
os->os_zpl_special_smallblock : 0;
|
||||
zp->zp_storage_type = dn ? dn->dn_storage_type : DMU_OT_NONE;
|
||||
|
||||
|
||||
@@ -2064,11 +2064,11 @@ spa_preferred_class(spa_t *spa, const zio_t *zio)
|
||||
}
|
||||
|
||||
/*
|
||||
* Allow small file blocks in special class in some cases (like
|
||||
* for the dRAID vdev feature). But always leave a reserve of
|
||||
* Allow small file or zvol blocks in special class if opted in by
|
||||
* the special_smallblk property. However, always leave a reserve of
|
||||
* zfs_special_class_metadata_reserve_pct exclusively for metadata.
|
||||
*/
|
||||
if (DMU_OT_IS_FILE(objtype) &&
|
||||
if ((DMU_OT_IS_FILE(objtype) || objtype == DMU_OT_ZVOL) &&
|
||||
has_special_class && zio->io_size <= zp->zp_zpl_smallblk) {
|
||||
metaslab_class_t *special = spa_special_class(spa);
|
||||
uint64_t alloc = metaslab_class_get_alloc(special);
|
||||
|
||||
Reference in New Issue
Block a user