Author: mm
Date: Thu Jan  5 08:53:54 2012
New Revision: 229563
URL: http://svn.freebsd.org/changeset/base/229563

Log:
  MFC r227497, r228020:
  
  MFC r227497 [1]:
  Import upstream changesets for the output of the "zpool" command:
  
  952 separate intent logs should be obvious in 'zpool iostat' output
  1337 `zpool status -D' should tell if there are no DDT entries
  
  References:
  https://www.illumos.org/issues/952
  https://www.illumos.org/issues/1337
  
  MFC r228020:
  Fix zfs(8) and zpool(8) context help to repport supported flags.
  
  Obtained from:        Illumos (issues 952, 1337; changesets 13384, 13432) [1]

Modified:
  stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
  stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
Directory Properties:
  stable/9/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c        Thu Jan  5 
08:51:06 2012        (r229562)
+++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c        Thu Jan  5 
08:53:54 2012        (r229563)
@@ -257,7 +257,8 @@ get_usage(zfs_help_t idx)
        case HELP_ROLLBACK:
                return (gettext("\trollback [-rRf] <snapshot>\n"));
        case HELP_SEND:
-               return (gettext("\tsend [-RDp] [-[iI] snapshot] <snapshot>\n"));
+               return (gettext("\tsend [-DvRp] "
+                   "[-i snapshot | -I snapshot] <snapshot>\n"));
        case HELP_SET:
                return (gettext("\tset <property=value> "
                    "<filesystem|volume|snapshot> ...\n"));
@@ -293,11 +294,11 @@ get_usage(zfs_help_t idx)
                    "\tunallow [-r] -s @setname [<perm|@setname>[,...]] "
                    "<filesystem|volume>\n"));
        case HELP_USERSPACE:
-               return (gettext("\tuserspace [-hniHp] [-o field[,...]] "
+               return (gettext("\tuserspace [-niHp] [-o field[,...]] "
                    "[-sS field] ... [-t type[,...]]\n"
                    "\t    <filesystem|snapshot>\n"));
        case HELP_GROUPSPACE:
-               return (gettext("\tgroupspace [-hniHpU] [-o field[,...]] "
+               return (gettext("\tgroupspace [-niHp] [-o field[,...]] "
                    "[-sS field] ... [-t type[,...]]\n"
                    "\t    <filesystem|snapshot>\n"));
        case HELP_HOLD:

Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c    Thu Jan  5 
08:51:06 2012        (r229562)
+++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c    Thu Jan  5 
08:53:54 2012        (r229563)
@@ -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 <solaris.h>
@@ -227,7 +228,7 @@ get_usage(zpool_help_t idx) {
        case HELP_OFFLINE:
                return (gettext("\toffline [-t] <pool> <device> ...\n"));
        case HELP_ONLINE:
-               return (gettext("\tonline <pool> <device> ...\n"));
+               return (gettext("\tonline [-e] <pool> <device> ...\n"));
        case HELP_REPLACE:
                return (gettext("\treplace [-f] <pool> <device> "
                    "[new-device]\n"));
@@ -239,8 +240,7 @@ get_usage(zpool_help_t idx) {
                return (gettext("\tstatus [-vx] [-T d|u] [pool] ... [interval "
                    "[count]]\n"));
        case HELP_UPGRADE:
-               return (gettext("\tupgrade\n"
-                   "\tupgrade -v\n"
+               return (gettext("\tupgrade [-v]\n"
                    "\tupgrade [-V version] <-a | pool ...>\n"));
        case HELP_GET:
                return (gettext("\tget <\"all\" | property[,...]> "
@@ -2206,10 +2206,15 @@ print_vdev_stats(zpool_handle_t *zhp, co
                return;
 
        for (c = 0; c < children; c++) {
-               uint64_t ishole = B_FALSE;
+               uint64_t ishole = B_FALSE, islog = B_FALSE;
 
-               if (nvlist_lookup_uint64(newchild[c],
-                   ZPOOL_CONFIG_IS_HOLE, &ishole) == 0 && ishole)
+               (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_HOLE,
+                   &ishole);
+
+               (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_LOG,
+                   &islog);
+
+               if (ishole || islog)
                        continue;
 
                vname = zpool_vdev_name(g_zfs, zhp, newchild[c], B_FALSE);
@@ -2219,6 +2224,31 @@ print_vdev_stats(zpool_handle_t *zhp, co
        }
 
        /*
+        * Log device section
+        */
+
+       if (num_logs(newnv) > 0) {
+               (void) printf("%-*s      -      -      -      -      -      "
+                   "-\n", cb->cb_namewidth, "logs");
+
+               for (c = 0; c < children; c++) {
+                       uint64_t islog = B_FALSE;
+                       (void) nvlist_lookup_uint64(newchild[c],
+                           ZPOOL_CONFIG_IS_LOG, &islog);
+
+                       if (islog) {
+                               vname = zpool_vdev_name(g_zfs, zhp, newchild[c],
+                                   B_FALSE);
+                               print_vdev_stats(zhp, vname, oldnv ?
+                                   oldchild[c] : NULL, newchild[c],
+                                   cb, depth + 2);
+                               free(vname);
+                       }
+               }
+
+       }
+
+       /*
         * Include level 2 ARC devices in iostat output
         */
        if (nvlist_lookup_nvlist_array(newnv, ZPOOL_CONFIG_L2CACHE,
@@ -3377,7 +3407,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 ||
@@ -3457,7 +3487,7 @@ print_scan_status(pool_scan_stat_t *ps)
        /*
         * do not print estimated time if hours_left is more than 30 days
         */
-       (void) printf(gettext("    %s scanned out of %s at %s/s"),
+       (void) printf(gettext("        %s scanned out of %s at %s/s"),
            examined_buf, total_buf, rate_buf);
        if (hours_left < (30 * 24)) {
                (void) printf(gettext(", %lluh%um to go\n"),
@@ -3468,10 +3498,10 @@ print_scan_status(pool_scan_stat_t *ps)
        }
 
        if (ps->pss_func == POOL_SCAN_RESILVER) {
-               (void) printf(gettext("    %s resilvered, %.2f%% done\n"),
+               (void) printf(gettext("        %s resilvered, %.2f%% done\n"),
                    processed_buf, 100 * fraction_done);
        } else if (ps->pss_func == POOL_SCAN_SCRUB) {
-               (void) printf(gettext("    %s repaired, %.2f%% done\n"),
+               (void) printf(gettext("        %s repaired, %.2f%% done\n"),
                    processed_buf, 100 * fraction_done);
        }
 }
@@ -3565,10 +3595,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,
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to