1337 `zpool status -D' should tell if there are no DDT entries
authorYuri Pankov <yuri.pankov@nexenta.com>
Sat, 13 Aug 2011 13:21:16 -0400
changeset 13432 d1ad8d106d64
parent 13431 e7ec489c7cf5
child 13433 1fde68f76cc6
1337 `zpool status -D' should tell if there are no DDT entries Reviewed by: Eric Schrock <[email protected]> Reviewed by: Igor Kozhukhov <[email protected]> Reviewed by: George Wilson <[email protected]> Approved by: Albert Lee <[email protected]>
usr/src/cmd/zpool/zpool_main.c
--- a/usr/src/cmd/zpool/zpool_main.c	Sat Aug 13 02:06:39 2011 -0700
+++ b/usr/src/cmd/zpool/zpool_main.c	Sat Aug 13 13:21:16 2011 -0400
@@ -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 @@
 	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 @@
 	 * 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,