]> git.proxmox.com Git - mirror_zfs-debian.git/commitdiff
Illumos #1377 `zpool status -D' should tell if there are no DDT entries
authorYuri Pankov <yuri.pankov@nexenta.com>
Fri, 11 Jan 2013 17:11:09 +0000 (09:11 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 11 Jan 2013 17:17:13 +0000 (09:17 -0800)
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>
cmd/zpool/zpool_main.c

index 8da4620c0ae6d34001dc37af5af68cd915e80639..5ad93782c3dde09097be73ceb4e1dbdffadb02e3 100644 (file)
@@ -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,