Print this page


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 ↓ 400 lines elided ↑ open up ↑
 401  401  }
 402  402  
 403  403  /* ARGSUSED */
 404  404  static int
 405  405  blkptr(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
 406  406  {
 407  407          blkptr_t bp;
 408  408          dmu_object_type_info_t *doti;
 409  409          zio_compress_info_t *zct;
 410  410          zio_checksum_info_t *zci;
      411 +        zio_crypt_info_t *zcc;
 411  412          int i;
 412  413          char buf[MAXPATHLEN];
 413  414  
 414  415          if (mdb_vread(&bp, sizeof (blkptr_t), addr) == -1) {
 415  416                  mdb_warn("failed to read blkptr_t");
 416  417                  return (DCMD_ERR);
 417  418          }
 418  419  
 419  420          if (read_symbol("dmu_ot", (void **)&doti) != DCMD_OK)
 420  421                  return (DCMD_ERR);
↓ open down ↓ 9 lines elided ↑ open up ↑
 430  431                  zci[i].ci_name = local_strdup(buf);
 431  432          }
 432  433  
 433  434          if (read_symbol("zio_compress_table", (void **)&zct) != DCMD_OK)
 434  435                  return (DCMD_ERR);
 435  436          for (i = 0; i < ZIO_COMPRESS_FUNCTIONS; i++) {
 436  437                  mdb_readstr(buf, sizeof (buf), (uintptr_t)zct[i].ci_name);
 437  438                  zct[i].ci_name = local_strdup(buf);
 438  439          }
 439  440  
      441 +        if (read_symbol("zio_crypt_table", (void **)&zcc) != DCMD_OK)
      442 +                return (DCMD_ERR);
      443 +        for (i = 0; i < ZIO_CRYPT_FUNCTIONS; i++) {
      444 +                mdb_readstr(buf, sizeof (buf), (uintptr_t)zcc[i].ci_name);
      445 +                zcc[i].ci_name = local_strdup(buf);
      446 +        }
      447 +
 440  448          /*
 441  449           * Super-ick warning:  This code is also duplicated in
 442  450           * cmd/zdb.c .   Yeah, I hate code replication, too.
 443  451           */
 444  452          for (i = 0; i < BP_GET_NDVAS(&bp); i++) {
 445  453                  dva_t *dva = &bp.blk_dva[i];
 446  454  
 447  455                  mdb_printf("DVA[%d]: vdev_id %lld / %llx\n", i,
 448  456                      DVA_GET_VDEV(dva), DVA_GET_OFFSET(dva));
 449  457                  mdb_printf("DVA[%d]:       GANG: %-5s  GRID:  %04x\t"
↓ open down ↓ 6 lines elided ↑ open up ↑
 456  464                      DVA_GET_GANG(dva) ? "g" : "",
 457  465                      BP_GET_COMPRESS(&bp) != 0 ? "d" : "");
 458  466          }
 459  467          mdb_printf("LSIZE:  %-16llx\t\tPSIZE: %llx\n",
 460  468              BP_GET_LSIZE(&bp), BP_GET_PSIZE(&bp));
 461  469          mdb_printf("ENDIAN: %6s\t\t\t\t\tTYPE:  %s\n",
 462  470              BP_GET_BYTEORDER(&bp) ? "LITTLE" : "BIG",
 463  471              doti[BP_GET_TYPE(&bp)].ot_name);
 464  472          mdb_printf("BIRTH:  %-16llx   LEVEL: %-2d\tFILL:  %llx\n",
 465  473              bp.blk_birth, BP_GET_LEVEL(&bp), bp.blk_fill);
 466      -        mdb_printf("CKFUNC: %-16s\t\tCOMP:  %s\n",
      474 +        mdb_printf("CKFUNC: %-16s\tCOMP: %s\tCRYPT: %s\n",
 467  475              zci[BP_GET_CHECKSUM(&bp)].ci_name,
 468      -            zct[BP_GET_COMPRESS(&bp)].ci_name);
      476 +            zct[BP_GET_COMPRESS(&bp)].ci_name,
      477 +            zcc[BP_GET_CRYPT(&bp)].ci_name);
 469  478          mdb_printf("CKSUM:  %llx:%llx:%llx:%llx\n",
 470  479              bp.blk_cksum.zc_word[0],
 471  480              bp.blk_cksum.zc_word[1],
 472  481              bp.blk_cksum.zc_word[2],
 473  482              bp.blk_cksum.zc_word[3]);
 474  483  
 475  484          return (DCMD_OK);
 476  485  }
 477  486  
 478  487  /* ARGSUSED */
↓ open down ↓ 1753 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX