Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/FreeBSD]: src/external/cddl/osnet/dist Import new Opensolaris sources fo...
details: https://anonhg.NetBSD.org/src/rev/ec5720470ff7
branches: FreeBSD
changeset: 319383:ec5720470ff7
user: haad <haad%NetBSD.org@localhost>
date: Sat Feb 27 22:29:20 2010 +0000
description:
Import new Opensolaris sources for zfs/dtrace.
Opensolaris mercurial changeset: 11751:58c0c8f4305f
diffstat:
external/cddl/osnet/dist/cmd/zdb/zdb.c | 2050 ++-
external/cddl/osnet/dist/cmd/zdb/zdb_il.c | 145 +-
external/cddl/osnet/dist/cmd/zfs/zfs_iter.c | 80 +-
external/cddl/osnet/dist/cmd/zfs/zfs_iter.h | 6 +-
external/cddl/osnet/dist/cmd/zfs/zfs_main.c | 1042 +-
external/cddl/osnet/dist/cmd/zpool/zpool_main.c | 993 +-
external/cddl/osnet/dist/cmd/zpool/zpool_util.c | 20 +-
external/cddl/osnet/dist/cmd/zpool/zpool_util.h | 5 +-
external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c | 93 +-
external/cddl/osnet/dist/cmd/ztest/ztest.c | 5057 +++++++--
external/cddl/osnet/dist/common/avl/avl.c | 7 +-
external/cddl/osnet/dist/common/nvpair/nvpair.c | 52 +-
external/cddl/osnet/dist/common/zfs/zfs_comutil.c | 46 +-
external/cddl/osnet/dist/common/zfs/zfs_comutil.h | 7 +-
external/cddl/osnet/dist/common/zfs/zfs_deleg.c | 11 +-
external/cddl/osnet/dist/common/zfs/zfs_deleg.h | 10 +-
external/cddl/osnet/dist/common/zfs/zfs_fletcher.c | 246 +
external/cddl/osnet/dist/common/zfs/zfs_fletcher.h | 53 +
external/cddl/osnet/dist/common/zfs/zfs_namecheck.c | 22 +-
external/cddl/osnet/dist/common/zfs/zfs_namecheck.h | 5 +-
external/cddl/osnet/dist/common/zfs/zfs_prop.c | 97 +-
external/cddl/osnet/dist/common/zfs/zfs_prop.h | 6 +-
external/cddl/osnet/dist/common/zfs/zpool_prop.c | 22 +-
external/cddl/osnet/dist/common/zfs/zprop_common.c | 33 +-
external/cddl/osnet/dist/lib/libdtrace/common/drti.c | 15 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_consume.c | 6 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_error.c | 7 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_impl.h | 17 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_module.c | 16 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_pid.c | 4 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_printf.c | 25 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_proc.c | 25 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_program.c | 7 +-
external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c | 50 +-
external/cddl/osnet/dist/lib/libnvpair/libnvpair.c | 155 +-
external/cddl/osnet/dist/lib/libnvpair/libnvpair.h | 5 +-
external/cddl/osnet/dist/lib/libshare/common/libshare.h | 4 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs.h | 213 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_changelist.c | 88 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_config.c | 22 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_dataset.c | 2816 ++--
external/cddl/osnet/dist/lib/libzfs/common/libzfs_fru.c | 452 +
external/cddl/osnet/dist/lib/libzfs/common/libzfs_impl.h | 29 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_import.c | 513 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_mount.c | 100 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_pool.c | 1317 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_sendrecv.c | 872 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_status.c | 80 +-
external/cddl/osnet/dist/lib/libzfs/common/libzfs_util.c | 90 +-
external/cddl/osnet/dist/lib/libzpool/common/taskq.c | 31 +-
external/cddl/osnet/dist/tools/ctf/cvt/ctf.c | 32 +-
external/cddl/osnet/dist/tools/ctf/cvt/tdata.c | 9 +-
external/cddl/osnet/dist/uts/common/dtrace/dtrace.c | 84 +-
external/cddl/osnet/dist/uts/common/dtrace/fasttrap.c | 14 +-
external/cddl/osnet/dist/uts/common/fs/zfs/arc.c | 906 +-
external/cddl/osnet/dist/uts/common/fs/zfs/bplist.c | 44 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dbuf.c | 586 +-
external/cddl/osnet/dist/uts/common/fs/zfs/ddt.c | 1064 ++
external/cddl/osnet/dist/uts/common/fs/zfs/ddt_zap.c | 150 +
external/cddl/osnet/dist/uts/common/fs/zfs/dmu.c | 707 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_object.c | 69 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_objset.c | 1027 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_send.c | 868 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_traverse.c | 199 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_tx.c | 256 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dmu_zfetch.c | 105 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dnode.c | 155 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dnode_sync.c | 69 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dataset.c | 1512 ++-
external/cddl/osnet/dist/uts/common/fs/zfs/dsl_deleg.c | 22 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dsl_dir.c | 230 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dsl_pool.c | 260 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dsl_prop.c | 882 +-
external/cddl/osnet/dist/uts/common/fs/zfs/dsl_synctask.c | 8 +-
external/cddl/osnet/dist/uts/common/fs/zfs/lzjb.c | 30 +-
external/cddl/osnet/dist/uts/common/fs/zfs/metaslab.c | 839 +-
external/cddl/osnet/dist/uts/common/fs/zfs/rrwlock.c | 39 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sha256.c | 115 +-
external/cddl/osnet/dist/uts/common/fs/zfs/spa.c | 3084 ++++-
external/cddl/osnet/dist/uts/common/fs/zfs/spa_config.c | 121 +-
external/cddl/osnet/dist/uts/common/fs/zfs/spa_errlog.c | 15 +-
external/cddl/osnet/dist/uts/common/fs/zfs/spa_history.c | 70 +-
external/cddl/osnet/dist/uts/common/fs/zfs/spa_misc.c | 380 +-
external/cddl/osnet/dist/uts/common/fs/zfs/space_map.c | 234 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/arc.h | 47 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/bplist.h | 13 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dbuf.h | 11 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/ddt.h | 240 +
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu.h | 160 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu_impl.h | 39 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu_objset.h | 83 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu_traverse.h | 13 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu_tx.h | 14 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dmu_zfetch.h | 7 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dnode.h | 25 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dsl_dataset.h | 79 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dsl_deleg.h | 10 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dsl_dir.h | 12 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dsl_pool.h | 30 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/dsl_prop.h | 52 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/metaslab.h | 22 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/metaslab_impl.h | 16 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa.h | 250 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_boot.h | 5 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/spa_impl.h | 78 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/space_map.h | 29 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/txg.h | 10 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/txg_impl.h | 6 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/uberblock.h | 10 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/uberblock_impl.h | 4 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/vdev.h | 41 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/vdev_impl.h | 55 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zap.h | 48 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zap_impl.h | 27 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zap_leaf.h | 34 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_acl.h | 30 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_context.h | 6 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_ctldir.h | 5 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_dir.h | 8 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_fuid.h | 30 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_ioctl.h | 120 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_vfsops.h | 28 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zfs_znode.h | 12 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zil.h | 126 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zil_impl.h | 37 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zio.h | 351 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zio_checksum.h | 25 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zio_compress.h | 16 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zio_impl.h | 172 +-
external/cddl/osnet/dist/uts/common/fs/zfs/sys/zvol.h | 8 +-
external/cddl/osnet/dist/uts/common/fs/zfs/txg.c | 139 +-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev.c | 1369 +-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_cache.c | 43 +-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c | 77 +-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_file.c | 21 +-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_label.c | 178 +-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_mirror.c | 69 +-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_missing.c | 17 +-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_queue.c | 208 +-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_raidz.c | 1559 ++-
external/cddl/osnet/dist/uts/common/fs/zfs/vdev_root.c | 20 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zap.c | 171 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zap_leaf.c | 165 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zap_micro.c | 522 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_acl.c | 662 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_byteswap.c | 33 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c | 224 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_dir.c | 95 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_fm.c | 555 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_fuid.c | 244 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ioctl.c | 2703 ++++-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_log.c | 86 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_replay.c | 120 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_rlock.c | 6 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vfsops.c | 783 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c | 1475 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c | 319 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zil.c | 1277 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zio.c | 1488 ++-
external/cddl/osnet/dist/uts/common/fs/zfs/zio_checksum.c | 138 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zio_compress.c | 102 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zio_inject.c | 161 +-
external/cddl/osnet/dist/uts/common/fs/zfs/zle.c | 86 +
external/cddl/osnet/dist/uts/common/fs/zfs/zvol.c | 811 +-
external/cddl/osnet/dist/uts/common/rpc/xdr.c | 51 +-
external/cddl/osnet/dist/uts/common/rpc/xdr.h | 14 +-
external/cddl/osnet/dist/uts/common/sys/acl.h | 8 +-
external/cddl/osnet/dist/uts/common/sys/avl.h | 6 +-
external/cddl/osnet/dist/uts/common/sys/callb.h | 12 +-
external/cddl/osnet/dist/uts/common/sys/cpupart.h | 17 +-
external/cddl/osnet/dist/uts/common/sys/cpuvar.h | 110 +-
external/cddl/osnet/dist/uts/common/sys/cred.h | 13 +-
external/cddl/osnet/dist/uts/common/sys/debug.h | 40 +-
external/cddl/osnet/dist/uts/common/sys/dtrace.h | 25 +-
external/cddl/osnet/dist/uts/common/sys/fm/fs/zfs.h | 18 +-
external/cddl/osnet/dist/uts/common/sys/fm/protocol.h | 22 +-
external/cddl/osnet/dist/uts/common/sys/fs/zfs.h | 234 +-
external/cddl/osnet/dist/uts/common/sys/nvpair.h | 7 +-
external/cddl/osnet/dist/uts/common/sys/processor.h | 150 +
external/cddl/osnet/dist/uts/common/sys/sysevent.h | 121 +-
external/cddl/osnet/dist/uts/common/sys/sysevent/eventdefs.h | 32 +-
external/cddl/osnet/dist/uts/common/sys/systeminfo.h | 18 +-
external/cddl/osnet/dist/uts/common/sys/taskq.h | 19 +-
external/cddl/osnet/dist/uts/common/sys/taskq_impl.h | 40 +-
184 files changed, 35695 insertions(+), 14884 deletions(-)
diffs (truncated from 77906 to 300 lines):
diff -r 6129478eec66 -r ec5720470ff7 external/cddl/osnet/dist/cmd/zdb/zdb.c
--- a/external/cddl/osnet/dist/cmd/zdb/zdb.c Sat Feb 20 04:33:34 2010 +0000
+++ b/external/cddl/osnet/dist/cmd/zdb/zdb.c Sat Feb 27 22:29:20 2010 +0000
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -51,10 +51,25 @@
#include <sys/zio_compress.h>
#include <sys/zfs_fuid.h>
#include <sys/arc.h>
+#include <sys/ddt.h>
#undef ZFS_MAXNAMELEN
#undef verify
#include <libzfs.h>
+#define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \
+ zio_compress_table[(idx)].ci_name : "UNKNOWN")
+#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \
+ zio_checksum_table[(idx)].ci_name : "UNKNOWN")
+#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \
+ dmu_ot[(idx)].ot_name : "UNKNOWN")
+#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES)
+
+#ifndef lint
+extern int zfs_recover;
+#else
+int zfs_recover;
+#endif
+
const char cmdname[] = "zdb";
uint8_t dump_opt[256];
@@ -64,8 +79,6 @@
uint64_t *zopt_object = NULL;
int zopt_objects = 0;
libzfs_handle_t *g_zfs;
-boolean_t zdb_sig_user_data = B_TRUE;
-int zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256;
/*
* These libumem hooks provide a reasonable set of defaults for the allocator's
@@ -87,42 +100,66 @@
usage(void)
{
(void) fprintf(stderr,
- "Usage: %s [-udibcsvL] [-U cachefile_path] "
- "[-S user:cksumalg] "
- "dataset [object...]\n"
- " %s -C [pool]\n"
- " %s -l dev\n"
- " %s -R pool:vdev:offset:size:flags\n"
- " %s [-p path_to_vdev_dir]\n"
- " %s -e pool | GUID | devid ...\n",
- cmdname, cmdname, cmdname, cmdname, cmdname, cmdname);
-
- (void) fprintf(stderr, " -u uberblock\n");
- (void) fprintf(stderr, " -d datasets\n");
- (void) fprintf(stderr, " -C cached pool configuration\n");
- (void) fprintf(stderr, " -i intent logs\n");
- (void) fprintf(stderr, " -b block statistics\n");
- (void) fprintf(stderr, " -c checksum all data blocks\n");
- (void) fprintf(stderr, " -s report stats on zdb's I/O\n");
- (void) fprintf(stderr, " -S <user|all>:<cksum_alg|all> -- "
- "dump blkptr signatures\n");
- (void) fprintf(stderr, " -v verbose (applies to all others)\n");
+ "Usage: %s [-CumdibcsvhL] poolname [object...]\n"
+ " %s [-div] dataset [object...]\n"
+ " %s -m [-L] poolname [vdev [metaslab...]]\n"
+ " %s -R poolname vdev:offset:size[:flags]\n"
+ " %s -S poolname\n"
+ " %s -l [-u] device\n"
+ " %s -C\n\n",
+ cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname);
+
+ (void) fprintf(stderr, " Dataset name must include at least one "
+ "separator character '/' or '@'\n");
+ (void) fprintf(stderr, " If dataset name is specified, only that "
+ "dataset is dumped\n");
+ (void) fprintf(stderr, " If object numbers are specified, only "
+ "those objects are dumped\n\n");
+ (void) fprintf(stderr, " Options to control amount of output:\n");
+ (void) fprintf(stderr, " -u uberblock\n");
+ (void) fprintf(stderr, " -d dataset(s)\n");
+ (void) fprintf(stderr, " -i intent logs\n");
+ (void) fprintf(stderr, " -C config (or cachefile if alone)\n");
+ (void) fprintf(stderr, " -h pool history\n");
+ (void) fprintf(stderr, " -b block statistics\n");
+ (void) fprintf(stderr, " -m metaslabs\n");
+ (void) fprintf(stderr, " -c checksum all metadata (twice for "
+ "all data) blocks\n");
+ (void) fprintf(stderr, " -s report stats on zdb's I/O\n");
+ (void) fprintf(stderr, " -S simulate dedup to measure effect\n");
+ (void) fprintf(stderr, " -v verbose (applies to all others)\n");
(void) fprintf(stderr, " -l dump label contents\n");
(void) fprintf(stderr, " -L disable leak tracking (do not "
"load spacemaps)\n");
- (void) fprintf(stderr, " -U cachefile_path -- use alternate "
+ (void) fprintf(stderr, " -R read and display block from a "
+ "device\n\n");
+ (void) fprintf(stderr, " Below options are intended for use "
+ "with other options (except -l):\n");
+ (void) fprintf(stderr, " -A ignore assertions (-A), enable "
+ "panic recovery (-AA) or both (-AAA)\n");
+ (void) fprintf(stderr, " -F attempt automatic rewind within "
+ "safe range of transaction groups\n");
+ (void) fprintf(stderr, " -U <cachefile_path> -- use alternate "
"cachefile\n");
- (void) fprintf(stderr, " -R read and display block from a "
- "device\n");
- (void) fprintf(stderr, " -e Pool is exported/destroyed/"
- "has altroot\n");
- (void) fprintf(stderr, " -p <Path to vdev dir> (use with -e)\n");
+ (void) fprintf(stderr, " -X attempt extreme rewind (does not "
+ "work with dataset)\n");
+ (void) fprintf(stderr, " -e pool is exported/destroyed/"
+ "has altroot/not in a cachefile\n");
+ (void) fprintf(stderr, " -p <path> -- use one or more with "
+ "-e to specify path to vdev dir\n");
+ (void) fprintf(stderr, " -t <txg> -- highest txg to use when "
+ "searching for uberblocks\n");
(void) fprintf(stderr, "Specify an option more than once (e.g. -bb) "
"to make only that option verbose\n");
(void) fprintf(stderr, "Default is to dump everything non-verbosely\n");
exit(1);
}
+/*
+ * Called for usage errors that are discovered after a call to spa_open(),
+ * dmu_bonus_hold(), or pool_match(). abort() is called for other errors.
+ */
+
static void
fatal(const char *fmt, ...)
{
@@ -134,69 +171,7 @@
va_end(ap);
(void) fprintf(stderr, "\n");
- abort();
-}
-
-static void
-dump_nvlist(nvlist_t *list, int indent)
-{
- nvpair_t *elem = NULL;
-
- while ((elem = nvlist_next_nvpair(list, elem)) != NULL) {
- switch (nvpair_type(elem)) {
- case DATA_TYPE_STRING:
- {
- char *value;
-
- VERIFY(nvpair_value_string(elem, &value) == 0);
- (void) printf("%*s%s='%s'\n", indent, "",
- nvpair_name(elem), value);
- }
- break;
-
- case DATA_TYPE_UINT64:
- {
- uint64_t value;
-
- VERIFY(nvpair_value_uint64(elem, &value) == 0);
- (void) printf("%*s%s=%llu\n", indent, "",
- nvpair_name(elem), (u_longlong_t)value);
- }
- break;
-
- case DATA_TYPE_NVLIST:
- {
- nvlist_t *value;
-
- VERIFY(nvpair_value_nvlist(elem, &value) == 0);
- (void) printf("%*s%s\n", indent, "",
- nvpair_name(elem));
- dump_nvlist(value, indent + 4);
- }
- break;
-
- case DATA_TYPE_NVLIST_ARRAY:
- {
- nvlist_t **value;
- uint_t c, count;
-
- VERIFY(nvpair_value_nvlist_array(elem, &value,
- &count) == 0);
-
- for (c = 0; c < count; c++) {
- (void) printf("%*s%s[%u]\n", indent, "",
- nvpair_name(elem), c);
- dump_nvlist(value[c], indent + 8);
- }
- }
- break;
-
- default:
-
- (void) printf("bad config type %d for %s\n",
- nvpair_type(elem), nvpair_name(elem));
- }
- }
+ exit(1);
}
/* ARGSUSED */
@@ -207,7 +182,7 @@
size_t nvsize = *(uint64_t *)data;
char *packed = umem_alloc(nvsize, UMEM_NOFAIL);
- VERIFY(0 == dmu_read(os, object, 0, nvsize, packed));
+ VERIFY(0 == dmu_read(os, object, 0, nvsize, packed, DMU_READ_PREFETCH));
VERIFY(nvlist_unpack(packed, nvsize, &nv, 0) == 0);
@@ -316,6 +291,13 @@
}
/*ARGSUSED*/
+static void
+dump_unknown(objset_t *os, uint64_t object, void *data, size_t size)
+{
+ (void) printf("\tUNKNOWN OBJECT TYPE\n");
+}
+
+/*ARGSUSED*/
void
dump_uint8(objset_t *os, uint64_t object, void *data, size_t size)
{
@@ -379,6 +361,14 @@
/*ARGSUSED*/
static void
+dump_ddt_zap(objset_t *os, uint64_t object, void *data, size_t size)
+{
+ dump_zap_stats(os, object);
+ /* contents are printed elsewhere, properly decoded */
+}
+
+/*ARGSUSED*/
+static void
dump_zpldir(objset_t *os, uint64_t object, void *data, size_t size)
{
zap_cursor_t zc;
@@ -433,16 +423,16 @@
alloc = 0;
for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) {
VERIFY(0 == dmu_read(os, smo->smo_object, offset,
- sizeof (entry), &entry));
+ sizeof (entry), &entry, DMU_READ_PREFETCH));
if (SM_DEBUG_DECODE(entry)) {
- (void) printf("\t\t[%4llu] %s: txg %llu, pass %llu\n",
+ (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n",
(u_longlong_t)(offset / sizeof (entry)),
ddata[SM_DEBUG_ACTION_DECODE(entry)],
(u_longlong_t)SM_DEBUG_TXG_DECODE(entry),
(u_longlong_t)SM_DEBUG_SYNCPASS_DECODE(entry));
} else {
- (void) printf("\t\t[%4llu] %c range:"
- " %08llx-%08llx size: %06llx\n",
+ (void) printf("\t [%6llu] %c range:"
+ " %010llx-%010llx size: %06llx\n",
(u_longlong_t)(offset / sizeof (entry)),
SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F',
(u_longlong_t)((SM_OFFSET_DECODE(entry) <<
@@ -465,53 +455,104 @@
}
static void
+dump_metaslab_stats(metaslab_t *msp)
+{
+ char maxbuf[5];
+ space_map_t *sm = &msp->ms_map;
+ avl_tree_t *t = sm->sm_pp_root;
+ int free_pct = sm->sm_space * 100 / sm->sm_size;
+
+ nicenum(space_map_maxsize(sm), maxbuf);
+
+ (void) printf("\t %25s %10lu %7s %6s %4s %4d%%\n",
+ "segments", avl_numnodes(t), "maxsize", maxbuf,
+ "freepct", free_pct);
+}
+
+static void
dump_metaslab(metaslab_t *msp)
{
- char freebuf[5];
- space_map_obj_t *smo = &msp->ms_smo;
vdev_t *vd = msp->ms_group->mg_vd;
spa_t *spa = vd->vdev_spa;
-
- nicenum(msp->ms_map.sm_size - smo->smo_alloc, freebuf);
-
- if (dump_opt['d'] <= 5) {
- (void) printf("\t%10llx %10llu %5s\n",
Home |
Main Index |
Thread Index |
Old Index