diff options
Diffstat (limited to 'module')
-rw-r--r-- | module/zcommon/zfs_prop.c | 94 | ||||
-rw-r--r-- | module/zcommon/zpool_prop.c | 126 | ||||
-rw-r--r-- | module/zcommon/zprop_common.c | 29 |
3 files changed, 140 insertions, 109 deletions
diff --git a/module/zcommon/zfs_prop.c b/module/zcommon/zfs_prop.c index 895a86bb4..0d5735066 100644 --- a/module/zcommon/zfs_prop.c +++ b/module/zcommon/zfs_prop.c @@ -589,125 +589,132 @@ zfs_prop_init(void) /* readonly number properties */ zprop_register_number(ZFS_PROP_USED, "used", 0, PROP_READONLY, - ZFS_TYPE_DATASET, "<size>", "USED", sfeatures); + ZFS_TYPE_DATASET, "<size>", "USED", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_AVAILABLE, "available", 0, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "AVAIL", - sfeatures); + B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_REFERENCED, "referenced", 0, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<size>", - "REFER", sfeatures); + "REFER", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_COMPRESSRATIO, "compressratio", 0, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, - "<1.00x or higher if compressed>", "RATIO", sfeatures); + "<1.00x or higher if compressed>", "RATIO", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_REFRATIO, "refcompressratio", 0, PROP_READONLY, ZFS_TYPE_DATASET, - "<1.00x or higher if compressed>", "REFRATIO", sfeatures); + "<1.00x or higher if compressed>", "REFRATIO", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_VOLBLOCKSIZE, "volblocksize", ZVOL_DEFAULT_BLOCKSIZE, PROP_ONETIME, - ZFS_TYPE_VOLUME, "512 to 128k, power of 2", "VOLBLOCK", sfeatures); + ZFS_TYPE_VOLUME, "512 to 128k, power of 2", "VOLBLOCK", B_FALSE, + sfeatures); zprop_register_number(ZFS_PROP_USEDSNAP, "usedbysnapshots", 0, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", - "USEDSNAP", sfeatures); + "USEDSNAP", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_USEDDS, "usedbydataset", 0, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", - "USEDDS", sfeatures); + "USEDDS", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_USEDCHILD, "usedbychildren", 0, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", - "USEDCHILD", sfeatures); + "USEDCHILD", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_USEDREFRESERV, "usedbyrefreservation", 0, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "USEDREFRESERV", - sfeatures); + B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_USERREFS, "userrefs", 0, PROP_READONLY, - ZFS_TYPE_SNAPSHOT, "<count>", "USERREFS", sfeatures); + ZFS_TYPE_SNAPSHOT, "<count>", "USERREFS", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_WRITTEN, "written", 0, PROP_READONLY, - ZFS_TYPE_DATASET, "<size>", "WRITTEN", sfeatures); + ZFS_TYPE_DATASET, "<size>", "WRITTEN", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_LOGICALUSED, "logicalused", 0, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", - "LUSED", sfeatures); + "LUSED", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_LOGICALREFERENCED, "logicalreferenced", 0, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<size>", - "LREFER", sfeatures); + "LREFER", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_FILESYSTEM_COUNT, "filesystem_count", UINT64_MAX, PROP_READONLY, ZFS_TYPE_FILESYSTEM, - "<count>", "FSCOUNT", sfeatures); + "<count>", "FSCOUNT", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_SNAPSHOT_COUNT, "snapshot_count", UINT64_MAX, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, - "<count>", "SSCOUNT", sfeatures); + "<count>", "SSCOUNT", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_GUID, "guid", 0, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<uint64>", "GUID", - sfeatures); + B_TRUE, sfeatures); zprop_register_number(ZFS_PROP_CREATETXG, "createtxg", 0, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<uint64>", "CREATETXG", - sfeatures); + B_TRUE, sfeatures); zprop_register_number(ZFS_PROP_PBKDF2_ITERS, "pbkdf2iters", 0, PROP_ONETIME_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, - "<iters>", "PBKDF2ITERS", sfeatures); + "<iters>", "PBKDF2ITERS", B_TRUE, sfeatures); zprop_register_number(ZFS_PROP_OBJSETID, "objsetid", 0, - PROP_READONLY, ZFS_TYPE_DATASET, "<uint64>", "OBJSETID", sfeatures); + PROP_READONLY, ZFS_TYPE_DATASET, "<uint64>", "OBJSETID", B_TRUE, + sfeatures); /* default number properties */ zprop_register_number(ZFS_PROP_QUOTA, "quota", 0, PROP_DEFAULT, - ZFS_TYPE_FILESYSTEM, "<size> | none", "QUOTA", sfeatures); + ZFS_TYPE_FILESYSTEM, "<size> | none", "QUOTA", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_RESERVATION, "reservation", 0, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, - "<size> | none", "RESERV", sfeatures); + "<size> | none", "RESERV", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_VOLSIZE, "volsize", 0, PROP_DEFAULT, ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME, "<size>", "VOLSIZE", - sfeatures); + B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_REFQUOTA, "refquota", 0, PROP_DEFAULT, - ZFS_TYPE_FILESYSTEM, "<size> | none", "REFQUOTA", sfeatures); + ZFS_TYPE_FILESYSTEM, "<size> | none", "REFQUOTA", B_FALSE, + sfeatures); zprop_register_number(ZFS_PROP_REFRESERVATION, "refreservation", 0, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, - "<size> | none", "REFRESERV", sfeatures); + "<size> | none", "REFRESERV", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_FILESYSTEM_LIMIT, "filesystem_limit", UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM, - "<count> | none", "FSLIMIT", sfeatures); + "<count> | none", "FSLIMIT", B_FALSE, sfeatures); zprop_register_number(ZFS_PROP_SNAPSHOT_LIMIT, "snapshot_limit", UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, - "<count> | none", "SSLIMIT", sfeatures); + "<count> | none", "SSLIMIT", B_FALSE, sfeatures); /* inherit number properties */ zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize", SPA_OLD_MAXBLOCKSIZE, PROP_INHERIT, - ZFS_TYPE_FILESYSTEM, "512 to 1M, power of 2", "RECSIZE", sfeatures); + ZFS_TYPE_FILESYSTEM, "512 to 1M, power of 2", "RECSIZE", B_FALSE, + sfeatures); zprop_register_number(ZFS_PROP_SPECIAL_SMALL_BLOCKS, "special_small_blocks", 0, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, - "zero or 512 to 1M, power of 2", "SPECIAL_SMALL_BLOCKS", sfeatures); + "zero or 512 to 1M, power of 2", "SPECIAL_SMALL_BLOCKS", B_FALSE, + sfeatures); /* hidden properties */ zprop_register_hidden(ZFS_PROP_NUMCLONES, "numclones", PROP_TYPE_NUMBER, - PROP_READONLY, ZFS_TYPE_SNAPSHOT, "NUMCLONES", sfeatures); + PROP_READONLY, ZFS_TYPE_SNAPSHOT, "NUMCLONES", B_FALSE, sfeatures); zprop_register_hidden(ZFS_PROP_NAME, "name", PROP_TYPE_STRING, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "NAME", - sfeatures); + B_TRUE, sfeatures); zprop_register_hidden(ZFS_PROP_ISCSIOPTIONS, "iscsioptions", PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME, "ISCSIOPTIONS", - sfeatures); + B_TRUE, sfeatures); zprop_register_hidden(ZFS_PROP_STMF_SHAREINFO, "stmf_sbd_lu", PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME, - "STMF_SBD_LU", sfeatures); + "STMF_SBD_LU", B_TRUE, sfeatures); zprop_register_hidden(ZFS_PROP_USERACCOUNTING, "useraccounting", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, - "USERACCOUNTING", sfeatures); + "USERACCOUNTING", B_FALSE, sfeatures); zprop_register_hidden(ZFS_PROP_UNIQUE, "unique", PROP_TYPE_NUMBER, - PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE", sfeatures); + PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE", B_FALSE, sfeatures); zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT", - sfeatures); + B_FALSE, sfeatures); zprop_register_hidden(ZFS_PROP_IVSET_GUID, "ivsetguid", PROP_TYPE_NUMBER, PROP_READONLY, - ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "IVSETGUID", sfeatures); + ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "IVSETGUID", B_TRUE, + sfeatures); zprop_register_hidden(ZFS_PROP_PREV_SNAP, "prevsnap", PROP_TYPE_STRING, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "PREVSNAP", - sfeatures); + B_TRUE, sfeatures); zprop_register_hidden(ZFS_PROP_PBKDF2_SALT, "pbkdf2salt", PROP_TYPE_NUMBER, PROP_ONETIME_DEFAULT, - ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "PBKDF2SALT", sfeatures); + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "PBKDF2SALT", B_FALSE, + sfeatures); zprop_register_hidden(ZFS_PROP_KEY_GUID, "keyguid", PROP_TYPE_NUMBER, - PROP_READONLY, ZFS_TYPE_DATASET, "KEYGUID", sfeatures); + PROP_READONLY, ZFS_TYPE_DATASET, "KEYGUID", B_TRUE, sfeatures); zprop_register_hidden(ZFS_PROP_REDACTED, "redacted", PROP_TYPE_NUMBER, - PROP_READONLY, ZFS_TYPE_DATASET, "REDACTED", sfeatures); + PROP_READONLY, ZFS_TYPE_DATASET, "REDACTED", B_FALSE, sfeatures); /* * Properties that are obsolete and not used. These are retained so @@ -715,12 +722,13 @@ zfs_prop_init(void) * have NULL pointers in the zfs_prop_table[]. */ zprop_register_hidden(ZFS_PROP_REMAPTXG, "remaptxg", PROP_TYPE_NUMBER, - PROP_READONLY, ZFS_TYPE_DATASET, "REMAPTXG", sfeatures); + PROP_READONLY, ZFS_TYPE_DATASET, "REMAPTXG", B_FALSE, sfeatures); /* oddball properties */ + /* 'creation' is a number but displayed as human-readable => flex */ zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0, NULL, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, - "<date>", "CREATION", B_FALSE, B_TRUE, NULL, sfeatures); + "<date>", "CREATION", B_FALSE, B_TRUE, B_TRUE, NULL, sfeatures); zfs_mod_list_supported_free(sfeatures); } diff --git a/module/zcommon/zpool_prop.c b/module/zcommon/zpool_prop.c index 44bfe4add..853476a1f 100644 --- a/module/zcommon/zpool_prop.c +++ b/module/zcommon/zpool_prop.c @@ -85,39 +85,45 @@ zpool_prop_init(void) /* readonly number properties */ zprop_register_number(ZPOOL_PROP_SIZE, "size", 0, PROP_READONLY, - ZFS_TYPE_POOL, "<size>", "SIZE", sfeatures); + ZFS_TYPE_POOL, "<size>", "SIZE", B_FALSE, sfeatures); zprop_register_number(ZPOOL_PROP_FREE, "free", 0, PROP_READONLY, - ZFS_TYPE_POOL, "<size>", "FREE", sfeatures); + ZFS_TYPE_POOL, "<size>", "FREE", B_FALSE, sfeatures); zprop_register_number(ZPOOL_PROP_FREEING, "freeing", 0, PROP_READONLY, - ZFS_TYPE_POOL, "<size>", "FREEING", sfeatures); + ZFS_TYPE_POOL, "<size>", "FREEING", B_FALSE, sfeatures); zprop_register_number(ZPOOL_PROP_CHECKPOINT, "checkpoint", 0, - PROP_READONLY, ZFS_TYPE_POOL, "<size>", "CKPOINT", sfeatures); + PROP_READONLY, ZFS_TYPE_POOL, "<size>", "CKPOINT", B_FALSE, + sfeatures); zprop_register_number(ZPOOL_PROP_LEAKED, "leaked", 0, PROP_READONLY, - ZFS_TYPE_POOL, "<size>", "LEAKED", sfeatures); + ZFS_TYPE_POOL, "<size>", "LEAKED", B_FALSE, sfeatures); zprop_register_number(ZPOOL_PROP_ALLOCATED, "allocated", 0, - PROP_READONLY, ZFS_TYPE_POOL, "<size>", "ALLOC", sfeatures); + PROP_READONLY, ZFS_TYPE_POOL, "<size>", "ALLOC", B_FALSE, + sfeatures); zprop_register_number(ZPOOL_PROP_EXPANDSZ, "expandsize", 0, - PROP_READONLY, ZFS_TYPE_POOL, "<size>", "EXPANDSZ", sfeatures); + PROP_READONLY, ZFS_TYPE_POOL, "<size>", "EXPANDSZ", B_FALSE, + sfeatures); zprop_register_number(ZPOOL_PROP_FRAGMENTATION, "fragmentation", 0, - PROP_READONLY, ZFS_TYPE_POOL, "<percent>", "FRAG", sfeatures); + PROP_READONLY, ZFS_TYPE_POOL, "<percent>", "FRAG", B_FALSE, + sfeatures); zprop_register_number(ZPOOL_PROP_CAPACITY, "capacity", 0, PROP_READONLY, - ZFS_TYPE_POOL, "<size>", "CAP", sfeatures); + ZFS_TYPE_POOL, "<size>", "CAP", B_FALSE, sfeatures); zprop_register_number(ZPOOL_PROP_GUID, "guid", 0, PROP_READONLY, - ZFS_TYPE_POOL, "<guid>", "GUID", sfeatures); + ZFS_TYPE_POOL, "<guid>", "GUID", B_TRUE, sfeatures); zprop_register_number(ZPOOL_PROP_LOAD_GUID, "load_guid", 0, PROP_READONLY, ZFS_TYPE_POOL, "<load_guid>", "LOAD_GUID", - sfeatures); + B_TRUE, sfeatures); zprop_register_number(ZPOOL_PROP_HEALTH, "health", 0, PROP_READONLY, - ZFS_TYPE_POOL, "<state>", "HEALTH", sfeatures); + ZFS_TYPE_POOL, "<state>", "HEALTH", B_FALSE, sfeatures); zprop_register_number(ZPOOL_PROP_DEDUPRATIO, "dedupratio", 0, PROP_READONLY, ZFS_TYPE_POOL, "<1.00x or higher if deduped>", - "DEDUP", sfeatures); + "DEDUP", B_FALSE, sfeatures); /* default number properties */ zprop_register_number(ZPOOL_PROP_VERSION, "version", SPA_VERSION, - PROP_DEFAULT, ZFS_TYPE_POOL, "<version>", "VERSION", sfeatures); + PROP_DEFAULT, ZFS_TYPE_POOL, "<version>", "VERSION", B_FALSE, + sfeatures); zprop_register_number(ZPOOL_PROP_ASHIFT, "ashift", 0, PROP_DEFAULT, - ZFS_TYPE_POOL, "<ashift, 9-16, or 0=default>", "ASHIFT", sfeatures); + ZFS_TYPE_POOL, "<ashift, 9-16, or 0=default>", "ASHIFT", B_FALSE, + sfeatures); /* default index (boolean) properties */ zprop_register_index(ZPOOL_PROP_DELEGATION, "delegation", 1, @@ -150,18 +156,18 @@ zpool_prop_init(void) /* hidden properties */ zprop_register_hidden(ZPOOL_PROP_NAME, "name", PROP_TYPE_STRING, - PROP_READONLY, ZFS_TYPE_POOL, "NAME", sfeatures); + PROP_READONLY, ZFS_TYPE_POOL, "NAME", B_TRUE, sfeatures); zprop_register_hidden(ZPOOL_PROP_MAXBLOCKSIZE, "maxblocksize", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_POOL, "MAXBLOCKSIZE", - sfeatures); + B_FALSE, sfeatures); zprop_register_hidden(ZPOOL_PROP_TNAME, "tname", PROP_TYPE_STRING, - PROP_ONETIME, ZFS_TYPE_POOL, "TNAME", sfeatures); + PROP_ONETIME, ZFS_TYPE_POOL, "TNAME", B_TRUE, sfeatures); zprop_register_hidden(ZPOOL_PROP_MAXDNODESIZE, "maxdnodesize", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_POOL, "MAXDNODESIZE", - sfeatures); + B_FALSE, sfeatures); zprop_register_hidden(ZPOOL_PROP_DEDUPDITTO, "dedupditto", PROP_TYPE_NUMBER, PROP_DEFAULT, ZFS_TYPE_POOL, "DEDUPDITTO", - sfeatures); + B_FALSE, sfeatures); zfs_mod_list_supported_free(sfeatures); } @@ -323,67 +329,85 @@ vdev_prop_init(void) /* readonly number properties */ zprop_register_number(VDEV_PROP_SIZE, "size", 0, PROP_READONLY, - ZFS_TYPE_VDEV, "<size>", "SIZE", sfeatures); + ZFS_TYPE_VDEV, "<size>", "SIZE", B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_FREE, "free", 0, PROP_READONLY, - ZFS_TYPE_VDEV, "<size>", "FREE", sfeatures); + ZFS_TYPE_VDEV, "<size>", "FREE", B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_ALLOCATED, "allocated", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<size>", "ALLOC", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<size>", "ALLOC", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_EXPANDSZ, "expandsize", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<size>", "EXPANDSZ", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<size>", "EXPANDSZ", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_FRAGMENTATION, "fragmentation", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<percent>", "FRAG", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<percent>", "FRAG", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_CAPACITY, "capacity", 0, PROP_READONLY, - ZFS_TYPE_VDEV, "<size>", "CAP", sfeatures); + ZFS_TYPE_VDEV, "<size>", "CAP", B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_GUID, "guid", 0, PROP_READONLY, - ZFS_TYPE_VDEV, "<guid>", "GUID", sfeatures); + ZFS_TYPE_VDEV, "<guid>", "GUID", B_TRUE, sfeatures); zprop_register_number(VDEV_PROP_STATE, "state", 0, PROP_READONLY, - ZFS_TYPE_VDEV, "<state>", "STATE", sfeatures); + ZFS_TYPE_VDEV, "<state>", "STATE", B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_BOOTSIZE, "bootsize", 0, PROP_READONLY, - ZFS_TYPE_VDEV, "<size>", "BOOTSIZE", sfeatures); + ZFS_TYPE_VDEV, "<size>", "BOOTSIZE", B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_ASIZE, "asize", 0, PROP_READONLY, - ZFS_TYPE_VDEV, "<asize>", "ASIZE", sfeatures); + ZFS_TYPE_VDEV, "<asize>", "ASIZE", B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_PSIZE, "psize", 0, PROP_READONLY, - ZFS_TYPE_VDEV, "<psize>", "PSIZE", sfeatures); + ZFS_TYPE_VDEV, "<psize>", "PSIZE", B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_ASHIFT, "ashift", 0, PROP_READONLY, - ZFS_TYPE_VDEV, "<ashift>", "ASHIFT", sfeatures); + ZFS_TYPE_VDEV, "<ashift>", "ASHIFT", B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_PARITY, "parity", 0, PROP_READONLY, - ZFS_TYPE_VDEV, "<parity>", "PARITY", sfeatures); + ZFS_TYPE_VDEV, "<parity>", "PARITY", B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_NUMCHILDREN, "numchildren", 0, PROP_READONLY, ZFS_TYPE_VDEV, "<number-of-children>", "NUMCHILD", - sfeatures); + B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_READ_ERRORS, "read_errors", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<errors>", "RDERR", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<errors>", "RDERR", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_WRITE_ERRORS, "write_errors", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<errors>", "WRERR", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<errors>", "WRERR", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_CHECKSUM_ERRORS, "checksum_errors", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<errors>", "CKERR", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<errors>", "CKERR", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_INITIALIZE_ERRORS, "initialize_errors", 0, PROP_READONLY, ZFS_TYPE_VDEV, "<errors>", - "INITERR", sfeatures); + "INITERR", B_FALSE, sfeatures); zprop_register_number(VDEV_PROP_OPS_NULL, "null_ops", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "NULLOP", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "NULLOP", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_OPS_READ, "read_ops", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "READOP", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "READOP", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_OPS_WRITE, "write_ops", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "WRITEOP", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "WRITEOP", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_OPS_FREE, "free_ops", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "FREEOP", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "FREEOP", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_OPS_CLAIM, "claim_ops", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "CLAIMOP", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "CLAIMOP", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_OPS_TRIM, "trim_ops", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "TRIMOP", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<operations>", "TRIMOP", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_BYTES_NULL, "null_bytes", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "NULLBYTE", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "NULLBYTE", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_BYTES_READ, "read_bytes", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "READBYTE", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "READBYTE", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_BYTES_WRITE, "write_bytes", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "WRITEBYTE", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "WRITEBYTE", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_BYTES_FREE, "free_bytes", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "FREEBYTE", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "FREEBYTE", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_BYTES_CLAIM, "claim_bytes", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "CLAIMBYTE", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "CLAIMBYTE", B_FALSE, + sfeatures); zprop_register_number(VDEV_PROP_BYTES_TRIM, "trim_bytes", 0, - PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "TRIMBYTE", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "<bytes>", "TRIMBYTE", B_FALSE, + sfeatures); /* default numeric properties */ @@ -399,7 +423,7 @@ vdev_prop_init(void) /* hidden properties */ zprop_register_hidden(VDEV_PROP_NAME, "name", PROP_TYPE_STRING, - PROP_READONLY, ZFS_TYPE_VDEV, "NAME", sfeatures); + PROP_READONLY, ZFS_TYPE_VDEV, "NAME", B_TRUE, sfeatures); zfs_mod_list_supported_free(sfeatures); } diff --git a/module/zcommon/zprop_common.c b/module/zcommon/zprop_common.c index d7a3ff608..0f4968775 100644 --- a/module/zcommon/zprop_common.c +++ b/module/zcommon/zprop_common.c @@ -97,7 +97,8 @@ void zprop_register_impl(int prop, const char *name, zprop_type_t type, uint64_t numdefault, const char *strdefault, zprop_attr_t attr, int objset_types, const char *values, const char *colname, - boolean_t rightalign, boolean_t visible, const zprop_index_t *idx_tbl, + boolean_t rightalign, boolean_t visible, boolean_t flex, + const zprop_index_t *idx_tbl, const struct zfs_mod_supported_features *sfeatures) { zprop_desc_t *prop_tbl = zprop_get_proptable(objset_types); @@ -122,6 +123,7 @@ zprop_register_impl(int prop, const char *name, zprop_type_t type, pd->pd_visible = visible; pd->pd_zfs_mod_supported = zfs_mod_supported_prop(name, objset_types, sfeatures); + pd->pd_always_flex = flex; pd->pd_table = idx_tbl; pd->pd_table_size = 0; while (idx_tbl && (idx_tbl++)->pi_name != NULL) @@ -134,17 +136,20 @@ zprop_register_string(int prop, const char *name, const char *def, const char *colname, const struct zfs_mod_supported_features *sfeatures) { zprop_register_impl(prop, name, PROP_TYPE_STRING, 0, def, attr, - objset_types, values, colname, B_FALSE, B_TRUE, NULL, sfeatures); + objset_types, values, colname, B_FALSE, B_TRUE, B_FALSE, NULL, + sfeatures); } void zprop_register_number(int prop, const char *name, uint64_t def, zprop_attr_t attr, int objset_types, const char *values, - const char *colname, const struct zfs_mod_supported_features *sfeatures) + const char *colname, boolean_t flex, + const struct zfs_mod_supported_features *sfeatures) { zprop_register_impl(prop, name, PROP_TYPE_NUMBER, def, NULL, attr, - objset_types, values, colname, B_TRUE, B_TRUE, NULL, sfeatures); + objset_types, values, colname, B_TRUE, B_TRUE, flex, NULL, + sfeatures); } void @@ -154,17 +159,18 @@ zprop_register_index(int prop, const char *name, uint64_t def, const struct zfs_mod_supported_features *sfeatures) { zprop_register_impl(prop, name, PROP_TYPE_INDEX, def, NULL, attr, - objset_types, values, colname, B_FALSE, B_TRUE, idx_tbl, sfeatures); + objset_types, values, colname, B_FALSE, B_TRUE, B_FALSE, idx_tbl, + sfeatures); } void zprop_register_hidden(int prop, const char *name, zprop_type_t type, - zprop_attr_t attr, int objset_types, const char *colname, + zprop_attr_t attr, int objset_types, const char *colname, boolean_t flex, const struct zfs_mod_supported_features *sfeatures) { zprop_register_impl(prop, name, type, 0, NULL, attr, objset_types, NULL, colname, - type == PROP_TYPE_NUMBER, B_FALSE, NULL, sfeatures); + type == PROP_TYPE_NUMBER, B_FALSE, flex, NULL, sfeatures); } @@ -440,7 +446,7 @@ zprop_width(int prop, boolean_t *fixed, zfs_type_t type) if (type != ZFS_TYPE_POOL && type != ZFS_TYPE_VDEV) type = ZFS_TYPE_FILESYSTEM; - *fixed = B_TRUE; + *fixed = !pd->pd_always_flex; /* * Start with the width of the column name. @@ -460,12 +466,6 @@ zprop_width(int prop, boolean_t *fixed, zfs_type_t type) if (ret < 5) ret = 5; /* - * 'creation' is handled specially because it's a number - * internally, but displayed as a date string. - */ - if (type == ZFS_TYPE_FILESYSTEM && prop == ZFS_PROP_CREATION) - *fixed = B_FALSE; - /* * 'health' is handled specially because it's a number * internally, but displayed as a fixed 8 character string. */ @@ -482,7 +482,6 @@ zprop_width(int prop, boolean_t *fixed, zfs_type_t type) break; case PROP_TYPE_STRING: - *fixed = B_FALSE; break; } |