From 240245896aad46d0d41b0f9f257ff2abd09cb29b Mon Sep 17 00:00:00 2001 From: Yuri Pankov Date: Fri, 11 Jan 2013 09:11:09 -0800 Subject: 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 Reviewed by: Igor Kozhukhov Reviewed by: George Wilson Approved by: Albert Lee References: illumos/illumos-gate@ce72e614c133351311e87bbbe4eba8fea9e77768 illumos changeset: 13432:d1ad8d106d64 https://www.illumos.org/issues/1337 Ported-by: Brian Behlendorf --- cmd/zpool/zpool_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cmd/zpool') 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, -- cgit v1.2.3