summaryrefslogtreecommitdiffstats
path: root/include/zfeature_common.h
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2013-10-08 09:13:05 -0800
committerBrian Behlendorf <[email protected]>2014-07-25 16:40:07 -0700
commitfa86b5dbb6d33371df344efb2adb0aba026d097c (patch)
tree1a512e0af9bff65a349468b30881e4cfa26641d5 /include/zfeature_common.h
parent62b693930876ba8d929632e1ba0ae5dc48a85001 (diff)
Illumos 4171, 4172
4171 clean up spa_feature_*() interfaces 4172 implement extensible_dataset feature for use by other zpool features Reviewed by: Max Grossman <[email protected]> Reviewed by: Christopher Siden <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Jerry Jelinek <[email protected]> Approved by: Garrett D'Amore <[email protected]>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 <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2528
Diffstat (limited to 'include/zfeature_common.h')
-rw-r--r--include/zfeature_common.h25
1 files changed, 14 insertions, 11 deletions
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);