mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Add zpool properties for allocation class space
The existing zpool properties accounting pool space (size, allocated, fragmentation, expandsize, free, capacity) are based on the normal metaslab class or are cumulative properties of several classes combined. Add properties reporting the space accounting metrics for each metaslab class individually. Also introduce pool-wide AVAIL, USABLE, and USED properties reporting values corresponding to FREE, SIZE, and ALLOC deflated for raidz. Update ZTS to recognize the new properties and validate reported values. While in zpool_get_parsable.cfg, add "fragmentation" to the list of parsable properties. Sponsored-by: Klara, Inc. Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ameer Hamza <ahamza@ixsystems.com> Signed-off-by: Ryan Moeller <ryan.moeller@klarasystems.com> Cloes #18238
This commit is contained in:
committed by
Brian Behlendorf
parent
6ba3f915d0
commit
ac0fd40c8c
@@ -6960,7 +6960,19 @@ collect_vdev_prop(zpool_prop_t prop, uint64_t value, const char *str,
|
||||
|
||||
switch (prop) {
|
||||
case ZPOOL_PROP_SIZE:
|
||||
case ZPOOL_PROP_NORMAL_SIZE:
|
||||
case ZPOOL_PROP_SPECIAL_SIZE:
|
||||
case ZPOOL_PROP_DEDUP_SIZE:
|
||||
case ZPOOL_PROP_LOG_SIZE:
|
||||
case ZPOOL_PROP_ELOG_SIZE:
|
||||
case ZPOOL_PROP_SELOG_SIZE:
|
||||
case ZPOOL_PROP_EXPANDSZ:
|
||||
case ZPOOL_PROP_NORMAL_EXPANDSZ:
|
||||
case ZPOOL_PROP_SPECIAL_EXPANDSZ:
|
||||
case ZPOOL_PROP_DEDUP_EXPANDSZ:
|
||||
case ZPOOL_PROP_LOG_EXPANDSZ:
|
||||
case ZPOOL_PROP_ELOG_EXPANDSZ:
|
||||
case ZPOOL_PROP_SELOG_EXPANDSZ:
|
||||
case ZPOOL_PROP_CHECKPOINT:
|
||||
case ZPOOL_PROP_DEDUPRATIO:
|
||||
case ZPOOL_PROP_DEDUPCACHED:
|
||||
@@ -6971,6 +6983,12 @@ collect_vdev_prop(zpool_prop_t prop, uint64_t value, const char *str,
|
||||
format);
|
||||
break;
|
||||
case ZPOOL_PROP_FRAGMENTATION:
|
||||
case ZPOOL_PROP_NORMAL_FRAGMENTATION:
|
||||
case ZPOOL_PROP_SPECIAL_FRAGMENTATION:
|
||||
case ZPOOL_PROP_DEDUP_FRAGMENTATION:
|
||||
case ZPOOL_PROP_LOG_FRAGMENTATION:
|
||||
case ZPOOL_PROP_ELOG_FRAGMENTATION:
|
||||
case ZPOOL_PROP_SELOG_FRAGMENTATION:
|
||||
if (value == ZFS_FRAG_INVALID) {
|
||||
(void) strlcpy(propval, "-", sizeof (propval));
|
||||
} else if (format == ZFS_NICENUM_RAW) {
|
||||
@@ -6982,6 +7000,12 @@ collect_vdev_prop(zpool_prop_t prop, uint64_t value, const char *str,
|
||||
}
|
||||
break;
|
||||
case ZPOOL_PROP_CAPACITY:
|
||||
case ZPOOL_PROP_NORMAL_CAPACITY:
|
||||
case ZPOOL_PROP_SPECIAL_CAPACITY:
|
||||
case ZPOOL_PROP_DEDUP_CAPACITY:
|
||||
case ZPOOL_PROP_LOG_CAPACITY:
|
||||
case ZPOOL_PROP_ELOG_CAPACITY:
|
||||
case ZPOOL_PROP_SELOG_CAPACITY:
|
||||
/* capacity value is in parts-per-10,000 (aka permyriad) */
|
||||
if (format == ZFS_NICENUM_RAW)
|
||||
(void) snprintf(propval, sizeof (propval), "%llu",
|
||||
|
||||
Reference in New Issue
Block a user