aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zpool
diff options
context:
space:
mode:
authorYuri Pankov <yuri.pankov@nexenta.com>2013-01-11 09:11:09 -0800
committerBrian Behlendorf <behlendorf1@llnl.gov>2013-01-11 09:17:13 -0800
commit240245896aad46d0d41b0f9f257ff2abd09cb29b (patch)
tree16964ab44575b0aad1fcb8ac58c9b84204184fa8 /cmd/zpool
parent844793c3cc6ebf8e850057e41497089131569be0 (diff)
Illumos #1377 `zpool status -D' should tell if there are no DDT entries
1337 `zpool status -D' should tell if there are no DDT entries Reviewed by: Eric Schrock <eric.schrock@delphix.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Reviewed by: George Wilson <gwilson@zfsmail.com> Approved by: Albert Lee <trisk@nexenta.com> References: illumos/illumos-gate@ce72e614c133351311e87bbbe4eba8fea9e77768 illumos changeset: 13432:d1ad8d106d64 https://www.illumos.org/issues/1337 Ported-by: Brian Behlendorf <behlendorf1@llnl.gov>
Diffstat (limited to 'cmd/zpool')
-rw-r--r--cmd/zpool/zpool_main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index 8da4620c0..5ad93782c 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -3725,7 +3725,7 @@ print_scan_status(pool_scan_stat_t *ps)
double fraction_done;
char processed_buf[7], examined_buf[7], total_buf[7], rate_buf[7];
- (void) printf(gettext(" scan: "));
+ (void) printf(gettext(" scan: "));
/* If there's never been a scan, there's not much to say. */
if (ps == NULL || ps->pss_func == POOL_SCAN_NONE ||
@@ -3913,10 +3913,16 @@ print_dedup_stats(nvlist_t *config)
* table continue processing the stats.
*/
if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS,
- (uint64_t **)&ddo, &c) != 0 || ddo->ddo_count == 0)
+ (uint64_t **)&ddo, &c) != 0)
return;
(void) printf("\n");
+ (void) printf(gettext(" dedup: "));
+ if (ddo->ddo_count == 0) {
+ (void) printf(gettext("no DDT entries\n"));
+ return;
+ }
+
(void) printf("DDT entries %llu, size %llu on disk, %llu in core\n",
(u_longlong_t)ddo->ddo_count,
(u_longlong_t)ddo->ddo_dspace,