diff options
Diffstat (limited to 'usr/src/common/zfs')
-rw-r--r-- | usr/src/common/zfs/zfs_prop.c | 24 | ||||
-rw-r--r-- | usr/src/common/zfs/zfs_prop.h | 3 |
2 files changed, 24 insertions, 3 deletions
diff --git a/usr/src/common/zfs/zfs_prop.c b/usr/src/common/zfs/zfs_prop.c index d4029d15d4..0d00e0aa2c 100644 --- a/usr/src/common/zfs/zfs_prop.c +++ b/usr/src/common/zfs/zfs_prop.c @@ -181,6 +181,8 @@ static prop_desc_t zfs_prop_table[] = { "1 | 2 | 3", "COPIES", B_TRUE, B_TRUE }, { "bootfs", prop_type_string, 0, NULL, prop_default, ZFS_TYPE_POOL, "<filesystem>", "BOOTFS", B_FALSE, B_TRUE }, + { "autoreplace", prop_type_boolean, 0, NULL, prop_default, + ZFS_TYPE_POOL, "on | off", "REPLACE", B_FALSE, B_TRUE }, }; #define ZFS_PROP_COUNT ((sizeof (zfs_prop_table))/(sizeof (prop_desc_t))) @@ -246,6 +248,12 @@ zfs_prop_get_type(zfs_prop_t prop) return (zfs_prop_table[prop].pd_proptype); } +zfs_proptype_t +zpool_prop_get_type(zfs_prop_t prop) +{ + return (zfs_prop_table[prop].pd_proptype); +} + static boolean_t propname_match(const char *p, zfs_prop_t prop, size_t len) { @@ -365,12 +373,24 @@ zfs_prop_default_string(zfs_prop_t prop) return (zfs_prop_table[prop].pd_strdefault); } +const char * +zpool_prop_default_string(zpool_prop_t prop) +{ + return (zfs_prop_table[prop].pd_strdefault); +} + uint64_t zfs_prop_default_numeric(zfs_prop_t prop) { return (zfs_prop_table[prop].pd_numdefault); } +uint64_t +zpool_prop_default_numeric(zpool_prop_t prop) +{ + return (zfs_prop_table[prop].pd_numdefault); +} + /* * Returns TRUE if the property is readonly. */ @@ -382,7 +402,7 @@ zfs_prop_readonly(zfs_prop_t prop) /* * Given a dataset property ID, returns the corresponding name. - * Assuming the zfs dataset propety ID is valid. + * Assuming the zfs dataset property ID is valid. */ const char * zfs_prop_to_name(zfs_prop_t prop) @@ -392,7 +412,7 @@ zfs_prop_to_name(zfs_prop_t prop) /* * Given a pool property ID, returns the corresponding name. - * Assuming the pool propety ID is valid. + * Assuming the pool property ID is valid. */ const char * zpool_prop_to_name(zpool_prop_t prop) diff --git a/usr/src/common/zfs/zfs_prop.h b/usr/src/common/zfs/zfs_prop.h index 133e740ce6..3b18ec561f 100644 --- a/usr/src/common/zfs/zfs_prop.h +++ b/usr/src/common/zfs/zfs_prop.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -47,6 +47,7 @@ typedef enum { } zfs_proptype_t; zfs_proptype_t zfs_prop_get_type(zfs_prop_t); +zfs_proptype_t zpool_prop_get_type(zpool_prop_t); size_t zfs_prop_width(zfs_prop_t, boolean_t *); #ifdef __cplusplus |