summaryrefslogtreecommitdiff
path: root/usr/src/cmd/zpool
diff options
context:
space:
mode:
authorYuri Pankov <yuri.pankov@nexenta.com>2011-08-13 13:21:16 -0400
committerYuri Pankov <yuri.pankov@nexenta.com>2011-08-13 13:21:16 -0400
commitce72e614c133351311e87bbbe4eba8fea9e77768 (patch)
tree3ba8c076e97ecef5a4578eb22e6b04be2c7c5518 /usr/src/cmd/zpool
parent7aa76ffc594f84c1c092911a84f85a79ddb44c73 (diff)
downloadillumos-joyent-ce72e614c133351311e87bbbe4eba8fea9e77768.tar.gz
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>
Diffstat (limited to 'usr/src/cmd/zpool')
-rw-r--r--usr/src/cmd/zpool/zpool_main.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/src/cmd/zpool/zpool_main.c b/usr/src/cmd/zpool/zpool_main.c
index 9e1f30cf69..1cb2e63d1f 100644
--- a/usr/src/cmd/zpool/zpool_main.c
+++ b/usr/src/cmd/zpool/zpool_main.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
#include <assert.h>
@@ -3279,7 +3280,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 ||
@@ -3467,10 +3468,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,