From e6c59cd171bf141eae232db2f4c33ff79d5862c3 Mon Sep 17 00:00:00 2001 From: наб Date: Fri, 13 Nov 2020 23:38:29 +0100 Subject: zpool: correctly align columns with -p zpool_expand_proplist() now ignores pl_fixed if its new literal argument is true. The rest is a consequence of needing to pass that down. Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia Ziemiao?=~Dska Closes #11202 --- lib/libzfs/libzfs_pool.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libzfs/libzfs_pool.c') diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 16f8e3e7f..c1dc0d75b 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -784,7 +784,8 @@ zpool_set_prop(zpool_handle_t *zhp, const char *propname, const char *propval) } int -zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp) +zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp, + boolean_t literal) { libzfs_handle_t *hdl = zhp->zpool_hdl; zprop_list_t *entry; @@ -863,13 +864,12 @@ zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp) } for (entry = *plp; entry != NULL; entry = entry->pl_next) { - - if (entry->pl_fixed) + if (entry->pl_fixed && !literal) continue; if (entry->pl_prop != ZPROP_INVAL && zpool_get_prop(zhp, entry->pl_prop, buf, sizeof (buf), - NULL, B_FALSE) == 0) { + NULL, literal) == 0) { if (strlen(buf) > entry->pl_width) entry->pl_width = strlen(buf); } -- cgit v1.2.3