mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Make zpool list -vp print individual vdev sizes parsable.
Add argument format to print_one_column(), and use it to call zfs_nicenum_format with, instead of just zfs_nicenum. Don't print "%" for fragmentation or capacity percent values. The calls to print_one_colum is made with ZFS_NICENUM_RAW if cb->cb_literal (zpool list called with -p), and ZFS_NICENUM_1024 if not. Also zpool_get_prop is modified to don't add "%" or "x" if literal. Signed-off-by: Christer Ekholm <che@chrekh.se> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov Closes #4657
This commit is contained in:
committed by
Brian Behlendorf
parent
81b4c075ec
commit
bc2d809387
@@ -337,6 +337,9 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf,
|
||||
case ZPOOL_PROP_FRAGMENTATION:
|
||||
if (intval == UINT64_MAX) {
|
||||
(void) strlcpy(buf, "-", len);
|
||||
} else if (literal) {
|
||||
(void) snprintf(buf, len, "%llu",
|
||||
(u_longlong_t)intval);
|
||||
} else {
|
||||
(void) snprintf(buf, len, "%llu%%",
|
||||
(u_longlong_t)intval);
|
||||
@@ -344,9 +347,14 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf,
|
||||
break;
|
||||
|
||||
case ZPOOL_PROP_DEDUPRATIO:
|
||||
(void) snprintf(buf, len, "%llu.%02llux",
|
||||
(u_longlong_t)(intval / 100),
|
||||
(u_longlong_t)(intval % 100));
|
||||
if (literal)
|
||||
(void) snprintf(buf, len, "%llu.%02llu",
|
||||
(u_longlong_t)(intval / 100),
|
||||
(u_longlong_t)(intval % 100));
|
||||
else
|
||||
(void) snprintf(buf, len, "%llu.%02llux",
|
||||
(u_longlong_t)(intval / 100),
|
||||
(u_longlong_t)(intval % 100));
|
||||
break;
|
||||
|
||||
case ZPOOL_PROP_HEALTH:
|
||||
|
||||
Reference in New Issue
Block a user