77 /* readonly number properties */ |
77 /* readonly number properties */ |
78 zprop_register_number(ZPOOL_PROP_SIZE, "size", 0, PROP_READONLY, |
78 zprop_register_number(ZPOOL_PROP_SIZE, "size", 0, PROP_READONLY, |
79 ZFS_TYPE_POOL, "<size>", "SIZE"); |
79 ZFS_TYPE_POOL, "<size>", "SIZE"); |
80 zprop_register_number(ZPOOL_PROP_FREE, "free", 0, PROP_READONLY, |
80 zprop_register_number(ZPOOL_PROP_FREE, "free", 0, PROP_READONLY, |
81 ZFS_TYPE_POOL, "<size>", "FREE"); |
81 ZFS_TYPE_POOL, "<size>", "FREE"); |
|
82 zprop_register_number(ZPOOL_PROP_FREEING, "freeing", 0, PROP_READONLY, |
|
83 ZFS_TYPE_POOL, "<size>", "FREEING"); |
82 zprop_register_number(ZPOOL_PROP_ALLOCATED, "allocated", 0, |
84 zprop_register_number(ZPOOL_PROP_ALLOCATED, "allocated", 0, |
83 PROP_READONLY, ZFS_TYPE_POOL, "<size>", "ALLOC"); |
85 PROP_READONLY, ZFS_TYPE_POOL, "<size>", "ALLOC"); |
84 zprop_register_number(ZPOOL_PROP_EXPANDSZ, "expandsize", 0, |
86 zprop_register_number(ZPOOL_PROP_EXPANDSZ, "expandsize", 0, |
85 PROP_READONLY, ZFS_TYPE_POOL, "<size>", "EXPANDSZ"); |
87 PROP_READONLY, ZFS_TYPE_POOL, "<size>", "EXPANDSZ"); |
86 zprop_register_number(ZPOOL_PROP_CAPACITY, "capacity", 0, PROP_READONLY, |
88 zprop_register_number(ZPOOL_PROP_CAPACITY, "capacity", 0, PROP_READONLY, |
164 zpool_prop_default_numeric(zpool_prop_t prop) |
166 zpool_prop_default_numeric(zpool_prop_t prop) |
165 { |
167 { |
166 return (zpool_prop_table[prop].pd_numdefault); |
168 return (zpool_prop_table[prop].pd_numdefault); |
167 } |
169 } |
168 |
170 |
|
171 /* |
|
172 * Returns true if this is a valid feature@ property. |
|
173 */ |
|
174 boolean_t |
|
175 zpool_prop_feature(const char *name) |
|
176 { |
|
177 static const char *prefix = "feature@"; |
|
178 return (strncmp(name, prefix, strlen(prefix)) == 0); |
|
179 } |
|
180 |
|
181 /* |
|
182 * Returns true if this is a valid unsupported@ property. |
|
183 */ |
|
184 boolean_t |
|
185 zpool_prop_unsupported(const char *name) |
|
186 { |
|
187 static const char *prefix = "unsupported@"; |
|
188 return (strncmp(name, prefix, strlen(prefix)) == 0); |
|
189 } |
|
190 |
169 int |
191 int |
170 zpool_prop_string_to_index(zpool_prop_t prop, const char *string, |
192 zpool_prop_string_to_index(zpool_prop_t prop, const char *string, |
171 uint64_t *index) |
193 uint64_t *index) |
172 { |
194 { |
173 return (zprop_string_to_index(prop, string, index, ZFS_TYPE_POOL)); |
195 return (zprop_string_to_index(prop, string, index, ZFS_TYPE_POOL)); |