aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/spa_misc.c
diff options
context:
space:
mode:
authorAllan Jude <[email protected]>2024-07-25 12:47:36 -0400
committerGitHub <[email protected]>2024-07-25 09:47:36 -0700
commitc7ada64bb664d5fab73f255099da5e170e7c82e5 (patch)
tree9470046a2300896c450b8f08a1b2afe299c88d5d /module/zfs/spa_misc.c
parent82f281ad99dabc51b6a5ab66a5bd055717d9fcd1 (diff)
ddt: dedup table quota enforcement
This adds two new pool properties: - dedup_table_size, the total size of all DDTs on the pool; and - dedup_table_quota, the maximum possible size of all DDTs in the pool When set, quota will be enforced by checking when a new entry is about to be created. If the pool is over its dedup quota, the entry won't be created, and the corresponding write will be converted to a regular non-dedup write. Note that existing entries can be updated (ie their refcounts changed), as that reuses the space rather than requiring more. dedup_table_quota can be set to 'auto', which will set it based on the size of the devices backing the "dedup" allocation device. This makes it possible to limit the DDTs to the size of a dedup vdev only, such that when the device fills, no new blocks are deduplicated. Sponsored-by: iXsystems, Inc. Sponsored-By: Klara Inc. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Signed-off-by: Don Brady <[email protected]> Co-authored-by: Don Brady <[email protected]> Co-authored-by: Rob Wing <[email protected]> Co-authored-by: Sean Eric Fagan <[email protected]> Closes #15889
Diffstat (limited to 'module/zfs/spa_misc.c')
-rw-r--r--module/zfs/spa_misc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c
index d1d41bbe7..439e56f0d 100644
--- a/module/zfs/spa_misc.c
+++ b/module/zfs/spa_misc.c
@@ -1996,6 +1996,13 @@ spa_dedup_class(spa_t *spa)
return (spa->spa_dedup_class);
}
+boolean_t
+spa_special_has_ddt(spa_t *spa)
+{
+ return (zfs_ddt_data_is_special &&
+ spa->spa_special_class->mc_groups != 0);
+}
+
/*
* Locate an appropriate allocation class
*/