diff options
author | Matthew Ahrens <[email protected]> | 2013-10-08 09:13:05 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-07-25 16:40:07 -0700 |
commit | fa86b5dbb6d33371df344efb2adb0aba026d097c (patch) | |
tree | 1a512e0af9bff65a349468b30881e4cfa26641d5 /module/zfs/zfs_ioctl.c | |
parent | 62b693930876ba8d929632e1ba0ae5dc48a85001 (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/zfs_ioctl.c')
-rw-r--r-- | module/zfs/zfs_ioctl.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/module/zfs/zfs_ioctl.c b/module/zfs/zfs_ioctl.c index db7683ad9..453571598 100644 --- a/module/zfs/zfs_ioctl.c +++ b/module/zfs/zfs_ioctl.c @@ -245,7 +245,7 @@ static int zfs_fill_zplprops_root(uint64_t, nvlist_t *, nvlist_t *, int zfs_set_prop_nvlist(const char *, zprop_source_t, nvlist_t *, nvlist_t *); static int get_nvlist(uint64_t nvl, uint64_t size, int iflag, nvlist_t **nvp); -static int zfs_prop_activate_feature(spa_t *spa, zfeature_info_t *feature); +static int zfs_prop_activate_feature(spa_t *spa, spa_feature_t feature); static void history_str_free(char *buf) @@ -2347,8 +2347,6 @@ zfs_prop_set_special(const char *dsname, zprop_source_t source, case ZFS_PROP_COMPRESSION: { if (intval == ZIO_COMPRESS_LZ4) { - zfeature_info_t *feature = - &spa_feature_table[SPA_FEATURE_LZ4_COMPRESS]; spa_t *spa; if ((err = spa_open(dsname, &spa, FTAG)) != 0) @@ -2358,9 +2356,10 @@ zfs_prop_set_special(const char *dsname, zprop_source_t source, * Setting the LZ4 compression algorithm activates * the feature. */ - if (!spa_feature_is_active(spa, feature)) { + if (!spa_feature_is_active(spa, + SPA_FEATURE_LZ4_COMPRESS)) { if ((err = zfs_prop_activate_feature(spa, - feature)) != 0) { + SPA_FEATURE_LZ4_COMPRESS)) != 0) { spa_close(spa, FTAG); return (err); } @@ -3631,15 +3630,13 @@ zfs_check_settable(const char *dsname, nvpair_t *pair, cred_t *cr) return (SET_ERROR(ENOTSUP)); if (intval == ZIO_COMPRESS_LZ4) { - zfeature_info_t *feature = - &spa_feature_table[ - SPA_FEATURE_LZ4_COMPRESS]; spa_t *spa; if ((err = spa_open(dsname, &spa, FTAG)) != 0) return (err); - if (!spa_feature_is_enabled(spa, feature)) { + if (!spa_feature_is_enabled(spa, + SPA_FEATURE_LZ4_COMPRESS)) { spa_close(spa, FTAG); return (SET_ERROR(ENOTSUP)); } @@ -3699,9 +3696,9 @@ static int zfs_prop_activate_feature_check(void *arg, dmu_tx_t *tx) { spa_t *spa = dmu_tx_pool(tx)->dp_spa; - zfeature_info_t *feature = arg; + spa_feature_t *featurep = arg; - if (!spa_feature_is_active(spa, feature)) + if (!spa_feature_is_active(spa, *featurep)) return (0); else return (SET_ERROR(EBUSY)); @@ -3715,9 +3712,9 @@ static void zfs_prop_activate_feature_sync(void *arg, dmu_tx_t *tx) { spa_t *spa = dmu_tx_pool(tx)->dp_spa; - zfeature_info_t *feature = arg; + spa_feature_t *featurep = arg; - spa_feature_incr(spa, feature, tx); + spa_feature_incr(spa, *featurep, tx); } /* @@ -3726,14 +3723,14 @@ zfs_prop_activate_feature_sync(void *arg, dmu_tx_t *tx) * as being active. */ static int -zfs_prop_activate_feature(spa_t *spa, zfeature_info_t *feature) +zfs_prop_activate_feature(spa_t *spa, spa_feature_t feature) { int err; /* EBUSY here indicates that the feature is already active */ err = dsl_sync_task(spa_name(spa), zfs_prop_activate_feature_check, zfs_prop_activate_feature_sync, - feature, 2); + &feature, 2); if (err != 0 && err != EBUSY) return (err); |