diff options
author | George Wilson <[email protected]> | 2014-09-12 05:07:20 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-09-23 10:10:42 -0700 |
commit | a05dfd0028fa0c49dec3ceea48995b4d6fe274ca (patch) | |
tree | 48034472afc4054ba8582c3b51fd0850193ebcba /lib/libzfs/libzfs_pool.c | |
parent | b8bcca18f709abd3d1b7649ebdcb4aeab1e2eb61 (diff) |
Illumos 5147 - zpool list -v should show individual disk capacity
The 'zpool list -v' command displays lots of info but excludes the
capacity of each disk. This should be added.
5147 zpool list -v should show individual disk capacity
Reviewed by: Adam Leventhal <[email protected]>
Reviewed by: Christopher Siden <[email protected]>
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Richard Elling <[email protected]>
Approved by: Dan McDonald <[email protected]>
References:
https://www.illumos.org/issues/5147
https://github.com/illumos/illumos-gate/commit/7a09f97
Ported by: Turbo Fredriksson <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #2688
Diffstat (limited to 'lib/libzfs/libzfs_pool.c')
-rw-r--r-- | lib/libzfs/libzfs_pool.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index d50b9c9cc..00ed1a3e3 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. */ #include <ctype.h> @@ -317,7 +317,6 @@ zpool_get_prop_literal(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, case ZPOOL_PROP_FREE: case ZPOOL_PROP_FREEING: case ZPOOL_PROP_LEAKED: - case ZPOOL_PROP_EXPANDSZ: case ZPOOL_PROP_ASHIFT: if (literal) (void) snprintf(buf, len, "%llu", @@ -326,6 +325,17 @@ zpool_get_prop_literal(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, (void) zfs_nicenum(intval, buf, len); break; + case ZPOOL_PROP_EXPANDSZ: + if (intval == 0) { + (void) strlcpy(buf, "-", len); + } else if (literal) { + (void) snprintf(buf, len, "%llu", + (u_longlong_t)intval); + } else { + (void) zfs_nicenum(intval, buf, len); + } + break; + case ZPOOL_PROP_CAPACITY: (void) snprintf(buf, len, "%llu%%", (u_longlong_t)intval); |