mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
dnode: allow storage class to be overridden by object type
spa_preferred_class() selects a storage class based on (among other things) the DMU object type. This only works for old-style object types that match only one specific kind of thing. For DMU_OTN_ types we need another way to signal the storage class. This commit allows the object type to be overridden in the IO policy for the purposes of choosing a storage class. It then adds the ability to set the storage type on a dnode hold, such that all writes generated under that hold will get it. This method has two shortcomings: - it would be better if we could "name" a set of storage class preferences rather than it being implied by the object type. - it would be better if this info were stored in the dnode on disk. In the absence of those things, this seems like the smallest possible change. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Sponsored-by: Klara, Inc. Sponsored-by: iXsystems, Inc. Closes #15894
This commit is contained in:
committed by
Brian Behlendorf
parent
e26b3771ee
commit
d54d0fff39
+10
-1
@@ -2010,7 +2010,16 @@ metaslab_class_t *
|
||||
spa_preferred_class(spa_t *spa, const zio_t *zio)
|
||||
{
|
||||
const zio_prop_t *zp = &zio->io_prop;
|
||||
dmu_object_type_t objtype = zp->zp_type;
|
||||
|
||||
/*
|
||||
* Override object type for the purposes of selecting a storage class.
|
||||
* Primarily for DMU_OTN_ types where we can't explicitly control their
|
||||
* storage class; instead, choose a static type most closely matches
|
||||
* what we want.
|
||||
*/
|
||||
dmu_object_type_t objtype =
|
||||
zp->zp_storage_type == DMU_OT_NONE ?
|
||||
zp->zp_type : zp->zp_storage_type;
|
||||
|
||||
/*
|
||||
* ZIL allocations determine their class in zio_alloc_zil().
|
||||
|
||||
Reference in New Issue
Block a user