From 8bb71c008c5b68c95514322b6fe6fc7197b280f0 Mon Sep 17 00:00:00 2001 From: themylogin Date: Thu, 5 Sep 2024 12:00:21 +0200 Subject: [PATCH] Ignore `fast_dedup` feature --- libzfs.pyx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/libzfs.pyx b/libzfs.pyx index 592f56f..a98b2cb 100644 --- a/libzfs.pyx +++ b/libzfs.pyx @@ -29,6 +29,18 @@ include "config.pxi" include "nvpair.pxi" include "converter.pxi" +IGNORED_FEATURES = {'fast_dedup'} + + +def all_features(): + for i in range(0, zfs.SPA_FEATURES): + feat = &zfs.spa_feature_table[i] + + if feat.fi_uname in IGNORED_FEATURES: + continue + + yield feat + class DatasetType(enum.IntEnum): FILESYSTEM = zfs.ZFS_TYPE_FILESYSTEM @@ -1538,7 +1550,7 @@ cdef class ZFS(object): if enable_all_feat: opts = opts.copy() - for i in range(0, zfs.SPA_FEATURES): + for feat in all_features(): feat = &zfs.spa_feature_table[i] opts['feature@{}'.format(feat.fi_uname)] = 'enabled' @@ -3149,8 +3161,7 @@ cdef class ZFSPool(object): features_nv = NVList(nvl) - for i in range(0, zfs.SPA_FEATURES): - feat = &zfs.spa_feature_table[i] + for feat in all_features(): f = ZPoolFeature.__new__(ZPoolFeature) f.feature = feat f.pool = self