Authored by: ilovezfs <ilovezfs@icloud.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Richard Laager <rlaager@wiktel.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov <mail@gmelikov.ru>
OpenZFS-issue: https://www.illumos.org/issues/6603
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/
0803e91
Closes #5573
return (B_FALSE);
}
+static boolean_t
+deps_contains_feature(const spa_feature_t *deps, const spa_feature_t feature)
+{
+ int i;
+
+ for (i = 0; deps[i] != SPA_FEATURE_NONE; i++)
+ if (deps[i] == feature)
+ return (B_TRUE);
+
+ return (B_FALSE);
+}
+
static void
zfeature_register(spa_feature_t fid, const char *guid, const char *name,
const char *desc, zfeature_flags_t flags, const spa_feature_t *deps)
if (deps == NULL)
deps = nodeps;
+ VERIFY(((flags & ZFEATURE_FLAG_PER_DATASET) == 0) ||
+ (deps_contains_feature(deps, SPA_FEATURE_EXTENSIBLE_DATASET)));
+
feature->fi_feature = fid;
feature->fi_guid = guid;
feature->fi_uname = name;