From fa86b5dbb6d33371df344efb2adb0aba026d097c Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Tue, 8 Oct 2013 09:13:05 -0800 Subject: Illumos 4171, 4172 4171 clean up spa_feature_*() interfaces 4172 implement extensible_dataset feature for use by other zpool features Reviewed by: Max Grossman Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Jerry Jelinek Approved by: Garrett D'Amore a References: https://www.illumos.org/issues/4171 https://www.illumos.org/issues/4172 https://github.com/illumos/illumos-gate/commit/2acef22 Ported-by: Tim Chase Signed-off-by: Brian Behlendorf Closes #2528 --- include/zfeature_common.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'include/zfeature_common.h') diff --git a/include/zfeature_common.h b/include/zfeature_common.h index f4c1088db..084153cb0 100644 --- a/include/zfeature_common.h +++ b/include/zfeature_common.h @@ -37,34 +37,37 @@ extern "C" { struct zfeature_info; +typedef enum spa_feature { + SPA_FEATURE_NONE = -1, + SPA_FEATURE_ASYNC_DESTROY, + SPA_FEATURE_EMPTY_BPOBJ, + SPA_FEATURE_LZ4_COMPRESS, + SPA_FEATURE_SPACEMAP_HISTOGRAM, + SPA_FEATURE_EXTENSIBLE_DATASET, + SPA_FEATURES +} spa_feature_t; + typedef struct zfeature_info { + spa_feature_t fi_feature; const char *fi_uname; /* User-facing feature name */ const char *fi_guid; /* On-disk feature identifier */ const char *fi_desc; /* Feature description */ boolean_t fi_can_readonly; /* Can open pool readonly w/o support? */ boolean_t fi_mos; /* Is the feature necessary to read the MOS? */ - struct zfeature_info **fi_depends; /* array; null terminated */ + /* array of dependencies, terminated by SPA_FEATURE_NONE */ + const spa_feature_t *fi_depends; } zfeature_info_t; typedef int (zfeature_func_t)(zfeature_info_t *fi, void *arg); #define ZFS_FEATURE_DEBUG -typedef enum spa_feature { - SPA_FEATURE_ASYNC_DESTROY, - SPA_FEATURE_EMPTY_BPOBJ, - SPA_FEATURE_LZ4_COMPRESS, - SPA_FEATURE_SPACEMAP_HISTOGRAM, - SPA_FEATURES -} spa_feature_t; - extern zfeature_info_t spa_feature_table[SPA_FEATURES]; extern boolean_t zfeature_is_valid_guid(const char *); extern boolean_t zfeature_is_supported(const char *); -extern int zfeature_lookup_guid(const char *, zfeature_info_t **res); -extern int zfeature_lookup_name(const char *, zfeature_info_t **res); +extern int zfeature_lookup_name(const char *name, spa_feature_t *res); extern void zpool_feature_init(void); -- cgit v1.2.3