diff --git a/libzfs.pyx b/libzfs.pyx index 592f56f..be05c03 100644 --- a/libzfs.pyx +++ b/libzfs.pyx @@ -29,6 +29,21 @@ include "config.pxi" include "nvpair.pxi" include "converter.pxi" +IGNORED_FEATURES = {'fast_dedup'} + + +cdef all_features(): + features = [] + for i in range(0, zfs.SPA_FEATURES): + feat = &zfs.spa_feature_table[i] + + if feat.fi_uname in IGNORED_FEATURES: + continue + + features.append(feat) + + return features + class DatasetType(enum.IntEnum): FILESYSTEM = zfs.ZFS_TYPE_FILESYSTEM @@ -1538,8 +1553,7 @@ cdef class ZFS(object): if enable_all_feat: opts = opts.copy() - for i in range(0, zfs.SPA_FEATURES): - feat = &zfs.spa_feature_table[i] + for feat in all_features(): opts['feature@{}'.format(feat.fi_uname)] = 'enabled' copts = NVList(otherdict=opts) @@ -3149,8 +3163,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