mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Add physical device size to SIZE column in 'zpool list -v'
Add physical device size/capacity only for physical devices in 'zpool list -v' instead of displaying "-" in the SIZE column. This would make it easier to see the individual device capacity and to determine which spares are large enough to replace which devices. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Dipak Ghosh <dipak.ghosh@hpe.com> Signed-off-by: Akash B <akash-b@hpe.com> Closes #12561 Closes #13106
This commit is contained in:
@@ -6067,6 +6067,7 @@ print_one_column(zpool_prop_t prop, uint64_t value, const char *str,
|
||||
size_t width = zprop_width(prop, &fixed, ZFS_TYPE_POOL);
|
||||
|
||||
switch (prop) {
|
||||
case ZPOOL_PROP_SIZE:
|
||||
case ZPOOL_PROP_EXPANDSZ:
|
||||
case ZPOOL_PROP_CHECKPOINT:
|
||||
case ZPOOL_PROP_DEDUPRATIO:
|
||||
@@ -6162,8 +6163,12 @@ print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
|
||||
* 'toplevel' boolean value is passed to the print_one_column()
|
||||
* to indicate that the value is valid.
|
||||
*/
|
||||
print_one_column(ZPOOL_PROP_SIZE, vs->vs_space, NULL, scripted,
|
||||
toplevel, format);
|
||||
if (vs->vs_pspace)
|
||||
print_one_column(ZPOOL_PROP_SIZE, vs->vs_pspace, NULL,
|
||||
scripted, B_TRUE, format);
|
||||
else
|
||||
print_one_column(ZPOOL_PROP_SIZE, vs->vs_space, NULL,
|
||||
scripted, toplevel, format);
|
||||
print_one_column(ZPOOL_PROP_ALLOCATED, vs->vs_alloc, NULL,
|
||||
scripted, toplevel, format);
|
||||
print_one_column(ZPOOL_PROP_FREE, vs->vs_space - vs->vs_alloc,
|
||||
|
||||
Reference in New Issue
Block a user