--- old/usr/src/cmd/zdb/zdb.c Tue Feb 3 13:17:16 2009 +++ new/usr/src/cmd/zdb/zdb.c Tue Feb 3 13:17:15 2009 @@ -54,6 +54,7 @@ #undef ZFS_MAXNAMELEN #undef verify #include +#include const char cmdname[] = "zdb"; uint8_t dump_opt[256]; @@ -65,7 +66,7 @@ int zopt_objects = 0; libzfs_handle_t *g_zfs; boolean_t zdb_sig_user_data = B_TRUE; -int zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256; +int zdb_sig_cksumalg = ZIO_CHECKSUM_FUNCTIONS - 1; /* * These libumem hooks provide a reasonable set of defaults for the allocator's @@ -1072,6 +1073,11 @@ zio_compress_table[doi.doi_compress].ci_name); } + if (doi.doi_crypt != ZIO_CRYPT_INHERIT || verbosity >= 6) { + (void) snprintf(aux + strlen(aux), sizeof (aux), " (E=%s)", + zio_crypt_table[doi.doi_crypt].ci_name); + } + (void) printf("%10lld %3u %5s %5s %5s %5s %s%s\n", (u_longlong_t)object, doi.doi_indirection, iblk, dblk, lsize, asize, dmu_ot[doi.doi_type].ot_name, aux); @@ -1479,7 +1485,7 @@ print_sig = B_FALSE; if (print_sig) { - (void) printf("%llu\t%lld\t%lld\t%s\t%s\t%s\t" + (void) printf("%llu\t%lld\t%lld\t%s\t%s\t%s\t%s\t" "%llx:%llx:%llx:%llx\n", (u_longlong_t)BP_GET_LEVEL(bp), (longlong_t)BP_GET_PSIZE(bp), @@ -1487,6 +1493,7 @@ dmu_ot[BP_GET_TYPE(bp)].ot_name, zio_checksum_table[BP_GET_CHECKSUM(bp)].ci_name, zio_compress_table[BP_GET_COMPRESS(bp)].ci_name, + zio_crypt_table[BP_GET_CRYPT(bp)].ci_name, (u_longlong_t)bp->blk_cksum.zc_word[0], (u_longlong_t)bp->blk_cksum.zc_word[1], (u_longlong_t)bp->blk_cksum.zc_word[2], @@ -1845,9 +1852,10 @@ (void) printf("\tBIRTH: %-16llx LEVEL: %-2llu\tFILL: %llx\n", (u_longlong_t)bp->blk_birth, (u_longlong_t)BP_GET_LEVEL(bp), (u_longlong_t)bp->blk_fill); - (void) printf("\tCKFUNC: %-16s\t\tCOMP: %s\n", + (void) printf("\tCKFUNC: %-16s\t\tCOMP: %s\t\tCRYPT: %s\n", zio_checksum_table[BP_GET_CHECKSUM(bp)].ci_name, - zio_compress_table[BP_GET_COMPRESS(bp)].ci_name); + zio_compress_table[BP_GET_COMPRESS(bp)].ci_name, + zio_crypt_table[BP_GET_CRYPT(bp)].ci_name); (void) printf("\tCKSUM: %llx:%llx:%llx:%llx\n", (u_longlong_t)bp->blk_cksum.zc_word[0], (u_longlong_t)bp->blk_cksum.zc_word[1], @@ -2297,6 +2305,8 @@ zdb_sig_cksumalg = ZIO_CHECKSUM_FLETCHER_4; else if (strcmp(endstr, "sha256") == 0) zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256; + else if (strcmp(endstr, "sha256+mac") == 0) + zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256_MAC; else if (strcmp(endstr, "all") == 0) zdb_sig_cksumalg = ZIO_CHECKSUM_FLETCHER_2; else