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 <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiao?=~Dska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11202
This commit is contained in:
наб
2020-11-13 23:38:29 +01:00
committed by Brian Behlendorf
parent 5f24bd11ee
commit c06118e0b1
5 changed files with 40 additions and 29 deletions
+4 -4
View File
@@ -783,7 +783,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;
@@ -862,13 +863,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);
}