From: Yuri Pankov Date: Fri, 11 Jan 2013 17:11:09 +0000 (-0800) Subject: Illumos #1377 `zpool status -D' should tell if there are no DDT entries X-Git-Tag: debian/0.7.9-2~340^2~5 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=240245896aad46d0d41b0f9f257ff2abd09cb29b;p=mirror_zfs-debian.git 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 --- diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 8da4620c..5ad93782 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,