diff options
Diffstat (limited to 'usr/src/uts/common/fs/zfs/zfs_ioctl.c')
| -rw-r--r-- | usr/src/uts/common/fs/zfs/zfs_ioctl.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/usr/src/uts/common/fs/zfs/zfs_ioctl.c b/usr/src/uts/common/fs/zfs/zfs_ioctl.c index 84d2218620..ec3254213a 100644 --- a/usr/src/uts/common/fs/zfs/zfs_ioctl.c +++ b/usr/src/uts/common/fs/zfs/zfs_ioctl.c @@ -242,7 +242,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); /* _NOTE(PRINTFLIKE(4)) - this is printf-like, but lint is too whiney */ void @@ -2413,8 +2413,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) @@ -2424,9 +2422,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); } @@ -3698,15 +3697,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)); } @@ -3764,9 +3761,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)); @@ -3780,9 +3777,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); } /* @@ -3791,14 +3788,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); |
