summaryrefslogtreecommitdiffstats
path: root/module/zfs/zfeature_common.c
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 /module/zfs/zfeature_common.c
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 'module/zfs/zfeature_common.c')
-rw-r--r--module/zfs/zfeature_common.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/module/zfs/zfeature_common.c b/module/zfs/zfeature_common.c
index cee544880..5bcc08ade 100644
--- a/module/zfs/zfeature_common.c
+++ b/module/zfs/zfeature_common.c
@@ -88,39 +88,30 @@ zfeature_is_valid_guid(const char *name)
boolean_t
zfeature_is_supported(const char *guid)
{
+ spa_feature_t i;
+
if (zfeature_checks_disable)
return (B_TRUE);
- return (0 == zfeature_lookup_guid(guid, NULL));
-}
-
-int
-zfeature_lookup_guid(const char *guid, zfeature_info_t **res)
-{
- int i;
-
for (i = 0; i < SPA_FEATURES; i++) {
zfeature_info_t *feature = &spa_feature_table[i];
- if (strcmp(guid, feature->fi_guid) == 0) {
- if (res != NULL)
- *res = feature;
- return (0);
- }
+ if (strcmp(guid, feature->fi_guid) == 0)
+ return (B_TRUE);
}
- return (ENOENT);
+ return (B_FALSE);
}
int
-zfeature_lookup_name(const char *name, zfeature_info_t **res)
+zfeature_lookup_name(const char *name, spa_feature_t *res)
{
- int i;
+ spa_feature_t i;
for (i = 0; i < SPA_FEATURES; i++) {
zfeature_info_t *feature = &spa_feature_table[i];
if (strcmp(name, feature->fi_uname) == 0) {
if (res != NULL)
- *res = feature;
+ *res = i;
return (0);
}
}
@@ -129,11 +120,12 @@ zfeature_lookup_name(const char *name, zfeature_info_t **res)
}
static void
-zfeature_register(int fid, const char *guid, const char *name, const char *desc,
- boolean_t readonly, boolean_t mos, zfeature_info_t **deps)
+zfeature_register(spa_feature_t fid, const char *guid, const char *name,
+ const char *desc, boolean_t readonly, boolean_t mos,
+ const spa_feature_t *deps)
{
zfeature_info_t *feature = &spa_feature_table[fid];
- static zfeature_info_t *nodeps[] = { NULL };
+ static spa_feature_t nodeps[] = { SPA_FEATURE_NONE };
ASSERT(name != NULL);
ASSERT(desc != NULL);
@@ -144,6 +136,7 @@ zfeature_register(int fid, const char *guid, const char *name, const char *desc,
if (deps == NULL)
deps = nodeps;
+ feature->fi_feature = fid;
feature->fi_guid = guid;
feature->fi_uname = name;
feature->fi_desc = desc;
@@ -167,4 +160,8 @@ zpool_feature_init(void)
zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM,
"com.delphix:spacemap_histogram", "spacemap_histogram",
"Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL);
+ zfeature_register(SPA_FEATURE_EXTENSIBLE_DATASET,
+ "com.delphix:extensible_dataset", "extensible_dataset",
+ "Enhanced dataset functionality, used by other features.",
+ B_FALSE, B_FALSE, NULL);
}