Print this page
2619 asynchronous destruction of ZFS file systems
2747 SPA versioning with zfs feature flags
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com>
Approved by: Dan McDonald <danmcd@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mdb/common/modules/zfs/zfs.c
          +++ new/usr/src/cmd/mdb/common/modules/zfs/zfs.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
       24 + * Copyright (c) 2012 by Delphix. All rights reserved.
  24   25   */
  25   26  
  26   27  /* Portions Copyright 2010 Robert Milkowski */
  27   28  
  28   29  #include <mdb/mdb_ctf.h>
  29   30  #include <sys/zfs_context.h>
  30   31  #include <sys/mdb_modapi.h>
  31   32  #include <sys/dbuf.h>
  32   33  #include <sys/dmu_objset.h>
  33   34  #include <sys/dsl_dir.h>
↓ open down ↓ 1196 lines elided ↑ open up ↑
1230 1231                          break;
1231 1232                  case VDEV_AUX_BAD_LABEL:
1232 1233                          aux = "BAD_LABEL";
1233 1234                          break;
1234 1235                  case VDEV_AUX_VERSION_NEWER:
1235 1236                          aux = "VERS_NEWER";
1236 1237                          break;
1237 1238                  case VDEV_AUX_VERSION_OLDER:
1238 1239                          aux = "VERS_OLDER";
1239 1240                          break;
     1241 +                case VDEV_AUX_UNSUP_FEAT:
     1242 +                        aux = "UNSUP_FEAT";
     1243 +                        break;
1240 1244                  case VDEV_AUX_SPARED:
1241 1245                          aux = "SPARED";
1242 1246                          break;
1243 1247                  case VDEV_AUX_ERR_EXCEEDED:
1244 1248                          aux = "ERR_EXCEEDED";
1245 1249                          break;
1246 1250                  case VDEV_AUX_IO_FAILURE:
1247 1251                          aux = "IO_FAILURE";
1248 1252                          break;
1249 1253                  case VDEV_AUX_BAD_LOG:
↓ open down ↓ 925 lines elided ↑ open up ↑
2175 2179                  return (DCMD_USAGE);
2176 2180  
2177 2181          if (GETMEMB(addr, struct spa, spa_dsl_pool, addr) ||
2178 2182              GETMEMB(addr, struct dsl_pool, dp_blkstats, addr) ||
2179 2183              mdb_vread(&stats, sizeof (zfs_all_blkstats_t), addr) == -1) {
2180 2184                  mdb_warn("failed to read data at %p;", addr);
2181 2185                  mdb_printf("maybe no stats? run \"zpool scrub\" first.");
2182 2186                  return (DCMD_ERR);
2183 2187          }
2184 2188  
2185      -        tzb = &stats.zab_type[DN_MAX_LEVELS][DMU_OT_NUMTYPES];
     2189 +        tzb = &stats.zab_type[DN_MAX_LEVELS][DMU_OT_TOTAL];
2186 2190          if (tzb->zb_gangs != 0) {
2187 2191                  mdb_printf("Ganged blocks: %llu\n",
2188 2192                      (longlong_t)tzb->zb_gangs);
2189 2193          }
2190 2194  
2191 2195          ditto = tzb->zb_ditto_2_of_2_samevdev + tzb->zb_ditto_2_of_3_samevdev +
2192 2196              tzb->zb_ditto_3_of_3_samevdev;
2193 2197          if (ditto != 0) {
2194 2198                  mdb_printf("Dittoed blocks on same vdev: %llu\n",
2195 2199                      (longlong_t)ditto);
2196 2200          }
2197 2201  
2198 2202          mdb_printf("\nBlocks\tLSIZE\tPSIZE\tASIZE"
2199 2203              "\t  avg\t comp\t%%Total\tType\n");
2200 2204  
2201      -        for (t = 0; t <= DMU_OT_NUMTYPES; t++) {
     2205 +        for (t = 0; t <= DMU_OT_TOTAL; t++) {
2202 2206                  char csize[NICENUM_BUFLEN], lsize[NICENUM_BUFLEN];
2203 2207                  char psize[NICENUM_BUFLEN], asize[NICENUM_BUFLEN];
2204 2208                  char avg[NICENUM_BUFLEN];
2205 2209                  char comp[NICENUM_BUFLEN], pct[NICENUM_BUFLEN];
2206 2210                  char typename[64];
2207 2211                  int l;
2208 2212  
2209 2213  
2210 2214                  if (t == DMU_OT_DEFERRED)
2211 2215                          strcpy(typename, "deferred free");
     2216 +                else if (t == DMU_OT_OTHER)
     2217 +                        strcpy(typename, "other");
2212 2218                  else if (t == DMU_OT_TOTAL)
2213 2219                          strcpy(typename, "Total");
2214 2220                  else if (mdb_readstr(typename, sizeof (typename),
2215 2221                      (uintptr_t)dmu_ot[t].ot_name) == -1) {
2216 2222                          mdb_warn("failed to read type name");
2217 2223                          return (DCMD_ERR);
2218 2224                  }
2219 2225  
2220 2226                  if (stats.zab_type[DN_MAX_LEVELS][t].zb_asize == 0)
2221 2227                          continue;
↓ open down ↓ 837 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX