summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd/zpool/zpool_main.c6
-rw-r--r--include/sys/fs/zfs.h7
-rw-r--r--lib/libzfs/libzfs_pool.c4
-rw-r--r--module/zfs/spa.c13
4 files changed, 14 insertions, 16 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index 2293e79df..4905927fc 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -511,7 +511,7 @@ static int
add_prop_list(const char *propname, char *propval, nvlist_t **props,
boolean_t poolprop)
{
- zpool_prop_t prop = ZPROP_INVAL;
+ zpool_prop_t prop = ZPOOL_PROP_INVAL;
zfs_prop_t fprop;
nvlist_t *proplist;
const char *normnm;
@@ -529,7 +529,7 @@ add_prop_list(const char *propname, char *propval, nvlist_t **props,
if (poolprop) {
const char *vname = zpool_prop_to_name(ZPOOL_PROP_VERSION);
- if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL &&
+ if ((prop = zpool_name_to_prop(propname)) == ZPOOL_PROP_INVAL &&
!zpool_prop_feature(propname)) {
(void) fprintf(stderr, gettext("property '%s' is "
"not a valid pool property\n"), propname);
@@ -540,7 +540,7 @@ add_prop_list(const char *propname, char *propval, nvlist_t **props,
* feature@ properties and version should not be specified
* at the same time.
*/
- if ((prop == ZPROP_INVAL && zpool_prop_feature(propname) &&
+ if ((prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname) &&
nvlist_exists(proplist, vname)) ||
(prop == ZPOOL_PROP_VERSION &&
prop_list_contains_feature(proplist))) {
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index 473e50082..6b1c3bb56 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -88,7 +88,8 @@ typedef enum dmu_objset_type {
* the property table in module/zcommon/zfs_prop.c.
*/
typedef enum {
- ZFS_PROP_BAD = -1,
+ ZPROP_CONT = -2,
+ ZPROP_INVAL = -1,
ZFS_PROP_TYPE = 0,
ZFS_PROP_CREATION,
ZFS_PROP_USED,
@@ -203,6 +204,7 @@ extern const char *zfs_userquota_prop_prefixes[ZFS_NUM_USERQUOTA_PROPS];
* the property table in module/zcommon/zpool_prop.c.
*/
typedef enum {
+ ZPOOL_PROP_INVAL = -1,
ZPOOL_PROP_NAME,
ZPOOL_PROP_SIZE,
ZPOOL_PROP_CAPACITY,
@@ -238,9 +240,6 @@ typedef enum {
/* Small enough to not hog a whole line of printout in zpool(1M). */
#define ZPROP_MAX_COMMENT 32
-#define ZPROP_CONT -2
-#define ZPROP_INVAL -1
-
#define ZPROP_VALUE "value"
#define ZPROP_SOURCE "source"
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c
index c15f5c8a0..5f1414271 100644
--- a/lib/libzfs/libzfs_pool.c
+++ b/lib/libzfs/libzfs_pool.c
@@ -460,7 +460,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
const char *propname = nvpair_name(elem);
prop = zpool_name_to_prop(propname);
- if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) {
+ if (prop == ZPOOL_PROP_INVAL && zpool_prop_feature(propname)) {
int err;
char *fname = strchr(propname, '@') + 1;
@@ -500,7 +500,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
/*
* Make sure this property is valid and applies to this type.
*/
- if (prop == ZPROP_INVAL) {
+ if (prop == ZPOOL_PROP_INVAL) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"invalid property '%s'"), propname);
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index 75b928620..dac042464 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -353,7 +353,7 @@ spa_prop_get(spa_t *spa, nvlist_t **nvp)
zprop_source_t src = ZPROP_SRC_DEFAULT;
zpool_prop_t prop;
- if ((prop = zpool_name_to_prop(za.za_name)) == ZPROP_INVAL)
+ if ((prop = zpool_name_to_prop(za.za_name)) == ZPOOL_PROP_INVAL)
continue;
switch (za.za_integer_length) {
@@ -440,8 +440,8 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
const char *propname = nvpair_name(elem);
zpool_prop_t prop = zpool_name_to_prop(propname);
- switch ((int)prop) {
- case ZPROP_INVAL:
+ switch (prop) {
+ case ZPOOL_PROP_INVAL:
if (!zpool_prop_feature(propname)) {
error = SET_ERROR(EINVAL);
break;
@@ -698,7 +698,7 @@ spa_prop_set(spa_t *spa, nvlist_t *nvp)
prop == ZPOOL_PROP_READONLY)
continue;
- if (prop == ZPOOL_PROP_VERSION || prop == ZPROP_INVAL) {
+ if (prop == ZPOOL_PROP_VERSION || prop == ZPOOL_PROP_INVAL) {
uint64_t ver;
if (prop == ZPOOL_PROP_VERSION) {
@@ -6541,9 +6541,8 @@ spa_sync_props(void *arg, dmu_tx_t *tx)
zprop_type_t proptype;
spa_feature_t fid;
- prop = zpool_name_to_prop(nvpair_name(elem));
- switch ((int)prop) {
- case ZPROP_INVAL:
+ switch (prop = zpool_name_to_prop(nvpair_name(elem))) {
+ case ZPOOL_PROP_INVAL:
/*
* We checked this earlier in spa_prop_validate().
*/