zfs.c revision beb562835cfbfcc73ae96a39ad1ef3e0446d299c
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * CDDL HEADER START
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * The contents of this file are subject to the terms of the
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * Common Development and Distribution License (the "License").
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * You may not use this file except in compliance with the License.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * or http://www.opensolaris.org/os/licensing.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * See the License for the specific language governing permissions
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * and limitations under the License.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * When distributing Covered Code, include this CDDL HEADER in each
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * If applicable, add the following below this CDDL HEADER, with the
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * fields enclosed by brackets "[]" replaced with your own identifying
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * information: Portions Copyright [yyyy] [name of copyright owner]
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * CDDL HEADER END
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane/* Portions Copyright 2010 Robert Milkowski */
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montanegetmember(uintptr_t addr, const char *type, mdb_ctf_id_t *idp,
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane const char *member, int len, void *buf)
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane if (mdb_ctf_lookup_by_name(type, &id) == -1) {
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane mdb_warn("couldn't find type %s", type);
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane mdb_ctf_type_name(*idp, name, sizeof (name));
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane if (mdb_ctf_offsetof(*idp, member, &off) == -1) {
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane mdb_warn("couldn't find member %s of type %s\n", member, type);
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane mdb_warn("member %s of type %s is unsupported bitfield",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane if (mdb_vread(buf, len, addr + off) == -1) {
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane mdb_warn("failed to read %s from %s at %p",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane /* mdb_warn("read %s from %s at %p+%llx\n", member, type, addr, off); */
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane#define GETMEMB(addr, type, member, dest) \
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane getmember(addr, #type, NULL, #member, sizeof (dest), &(dest))
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane#define GETMEMBID(addr, ctfid, member, dest) \
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane getmember(addr, NULL, ctfid, #member, sizeof (dest), &(dest))
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montanegetrefcount(uintptr_t addr, mdb_ctf_id_t *id,
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane if (mdb_ctf_lookup_by_name("struct refcount", &rc_id) == -1) {
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane mdb_warn("couldn't find struct refcount");
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane if (mdb_ctf_offsetof(*id, member, &off) == -1) {
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane mdb_ctf_type_name(*id, name, sizeof (name));
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane mdb_warn("couldn't find member %s of type %s\n", member, name);
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane return (GETMEMBID(addr + off, &rc_id, rc_count, *rc));
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montanefreelist_walk_init(mdb_walk_state_t *wsp)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_warn("must supply starting address\n");
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane wsp->walk_data = 0; /* Index into the freelist */
a8b1f24a577acf3d2bd1154974d6bbe86ddf460bViolette Roche-Montanefreelist_walk_step(mdb_walk_state_t *wsp)
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane uintptr_t number = (uintptr_t)wsp->walk_data;
35f4c9400e583aa53856c929a5fbcb52f66cd96bViolette Roche-Montane char *ddata[] = { "ALLOC", "FREE", "CONDENSE", "INVALID",
abfe66cd244bd02b21219b62a623d75cc4994949Violette Roche-Montane "INVALID", "INVALID", "INVALID", "INVALID" };
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if (mdb_vread(&entry, sizeof (entry), wsp->walk_addr) == -1) {
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane mdb_warn("failed to read freelist entry %p", wsp->walk_addr);
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane wsp->walk_data = (void *)(number + 1);
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf("DEBUG: %3u %10s: txg=%llu pass=%llu\n",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane ddata[SM_DEBUG_ACTION_DECODE(entry)],
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf("Entry: %3u offsets=%08llx-%08llx type=%c "
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane (SM_OFFSET_DECODE(entry) + SM_RUN_DECODE(entry)) <<
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F',
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf(" (raw=%012llx)\n", entry);
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montanedataset_name(uintptr_t addr, char *buf)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if (mdb_ctf_lookup_by_name("struct dsl_dir",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_warn("couldn't find struct dsl_dir");
35f4c9400e583aa53856c929a5fbcb52f66cd96bViolette Roche-Montane if (GETMEMBID(addr, &dd_id, dd_parent, dd_parent) ||
35f4c9400e583aa53856c929a5fbcb52f66cd96bViolette Roche-Montane GETMEMBID(addr, &dd_id, dd_myname, dd_myname)) {
6acb5680cc685afc071ca5bcc358d31690bb1786Jean-Noel Rouvignac if (mdb_ctf_lookup_by_name("struct objset",
6acb5680cc685afc071ca5bcc358d31690bb1786Jean-Noel Rouvignac mdb_warn("couldn't find struct objset");
6acb5680cc685afc071ca5bcc358d31690bb1786Jean-Noel Rouvignac if (mdb_ctf_lookup_by_name("struct dsl_dataset",
6acb5680cc685afc071ca5bcc358d31690bb1786Jean-Noel Rouvignac mdb_warn("couldn't find struct dsl_dataset");
0b4d509011ee8f909711a31d9c1823d00bb368fdViolette Roche-Montane if (GETMEMBID(addr, &os_id, os_dsl_dataset, os_dsl_dataset))
6acb5680cc685afc071ca5bcc358d31690bb1786Jean-Noel Rouvignac if (GETMEMBID(os_dsl_dataset, &ds_id, ds_snapname, ds_snapname) ||
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane GETMEMBID(os_dsl_dataset, &ds_id, ds_dir, ds_dir)) {
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane if (ds_dir && dataset_name(ds_dir, buf))
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montaneenum_lookup(char *out, size_t size, mdb_ctf_id_t id, int val,
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if ((cp = mdb_ctf_enum_name(id, val)) != NULL) {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montanezfs_params(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * This table can be approximately generated by running:
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane * egrep "^[a-z0-9_]+ [a-z0-9_]+( =.*)?;" *.c | cut -d ' ' -f 2
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane static const char *params[] = {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "arc_reduce_dnlc_percent",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "arc_shrink_shift",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_mdcomp_disable",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_prefetch_disable",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfetch_max_streams",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfetch_min_sec_reap",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfetch_block_cap",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfetch_array_rd_sz",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_default_bs",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_default_ibs",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "metaslab_aliquot",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "reference_tracking_enable",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "reference_history",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "spa_max_replication_override",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "spa_mode_global",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_txg_synctime_ms",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_txg_timeout",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_write_limit_min",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_write_limit_max",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_write_limit_shift",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_write_limit_override",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_no_write_throttle",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_vdev_cache_max",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_vdev_cache_size",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_vdev_cache_bshift",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane "vdev_mirror_shift",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane "zfs_vdev_max_pending",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane "zfs_vdev_min_pending",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane "zfs_scrub_limit",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane "zfs_no_scrub_io",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane "zfs_no_scrub_prefetch",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane "zfs_vdev_time_shift",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane "zfs_vdev_ramp_rate",
ae2964516ff5296a50b354b4c1283879a637dc0cViolette Roche-Montane "zfs_vdev_aggregation_limit",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "fzap_default_block_shift",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_immediate_write_sz",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_read_chunk_size",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zfs_nocacheflush",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zil_replay_disable",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "metaslab_gang_bang",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "metaslab_df_alloc_threshold",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "metaslab_df_free_pct",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane "zio_injection_enabled",
6870993d12bf8a2b9d5cd103dc5ccabc42f9bf5dJean-Noel Rouvignac "zvol_immediate_write_sz",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane for (int i = 0; i < sizeof (params) / sizeof (params[0]); i++) {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane uint32_t *val32p = (uint32_t *)&val64;
6acb5680cc685afc071ca5bcc358d31690bb1786Jean-Noel Rouvignac mdb_printf("%s = 0x%x\n", params[i], *val32p);
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf("%s = 0x%llx\n", params[i], val64);
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_warn("variable %s not found", params[i]);
6acb5680cc685afc071ca5bcc358d31690bb1786Jean-Noel Rouvignacblkptr(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
6acb5680cc685afc071ca5bcc358d31690bb1786Jean-Noel Rouvignac mdb_ctf_id_t type_enum, checksum_enum, compress_enum;
6acb5680cc685afc071ca5bcc358d31690bb1786Jean-Noel Rouvignac char type[80], checksum[80], compress[80];
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if (mdb_vread(&blk, sizeof (blkptr_t), addr) == -1) {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if (mdb_ctf_lookup_by_name("enum dmu_object_type", &type_enum) == -1 ||
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_ctf_lookup_by_name("enum zio_checksum", &checksum_enum) == -1 ||
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_ctf_lookup_by_name("enum zio_compress", &compress_enum) == -1) {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_warn("Could not find blkptr enumerated types");
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane enum_lookup(type, sizeof (type), type_enum,
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane enum_lookup(checksum, sizeof (checksum), checksum_enum,
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane BP_GET_CHECKSUM(bp), "ZIO_CHECKSUM_");
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane enum_lookup(compress, sizeof (compress), compress_enum,
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane BP_GET_COMPRESS(bp), "ZIO_COMPRESS_");
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane SPRINTF_BLKPTR(mdb_snprintf, '\n', buf, bp, type, checksum, compress);
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montanedbuf(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf(" addr object lvl blkid holds os\n");
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if (mdb_ctf_lookup_by_name("struct dmu_buf_impl", &id) == -1) {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_warn("couldn't find struct dmu_buf_impl_t");
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if (GETMEMBID(addr, &id, db_objset, objset) ||
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane GETMEMBID(addr, &id, db_level, level) ||
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane GETMEMBID(addr, &id, db_blkid, blkid)) {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if (getrefcount(addr, &id, "db_holds", &holds)) {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if (db.db_object == DMU_META_DNODE_OBJECT)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane (void) mdb_snprintf(objectname, sizeof (objectname), "%llx",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane (void) mdb_snprintf(blkidname, sizeof (blkidname), "%llx",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf("%p %8s %1u %9s %2llu %s\n",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane addr, objectname, level, blkidname, holds, path);
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montanedbuf_stats(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if (mdb_readvar(&ht, "dbuf_hash_table") == -1) {
35f4c9400e583aa53856c929a5fbcb52f66cd96bViolette Roche-Montane mdb_warn("failed to read 'dbuf_hash_table'");
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane for (i = 0; i < HISTOSZ; i++) {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane for (bucket = 0; bucket < ht.hash_table_mask+1; bucket++) {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane (uintptr_t)(ht.hash_table+bucket)) == -1) {
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_warn("failed to read hash bucket %u at %p",
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane if (mdb_vread(&db, sizeof (dmu_buf_impl_t),
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_warn("failed to read dbuf at %p", dbp);
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane for (i = MIN(len, HISTOSZ - 1); i >= 0; i--)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf("hash table has %llu buckets, %llu dbufs "
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane for (i = 0; i < HISTOSZ; i++)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf("hash chain length number of buckets\n");
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane for (i = 0; i <= maxidx; i++)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf("%u %llu\n", i, histo[i]);
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane for (i = 0; i < HISTOSZ; i++)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf("hash chain depth number of dbufs\n");
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane for (i = 0; i <= maxidx; i++)
9fb13259bb1add404edb5dd42c4d51a69096617eViolette Roche-Montane mdb_printf("%u or more %llu %llu%%\n",
35f4c9400e583aa53856c929a5fbcb52f66cd96bViolette Roche-Montane * ::zap_leaf [-v]
35f4c9400e583aa53856c929a5fbcb52f66cd96bViolette Roche-Montane * Print a zap_leaf_phys_t, assumed to be 16k
35f4c9400e583aa53856c929a5fbcb52f66cd96bViolette Roche-Montanezap_leaf(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
zap_leaf_t l;
return (DCMD_USAGE);
if (four)
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_ERR);
if (verbose) {
for (i = 0; i < ZAP_LEAF_HASH_NUMENTRIES(&l); i++) {
for (i = 0; i < ZAP_LEAF_NUMCHUNKS(&l); i++) {
case ZAP_CHUNK_FREE:
if (verbose) {
case ZAP_CHUNK_ENTRY:
if (verbose) {
case ZAP_CHUNK_ARRAY:
if (verbose) {
for (j = 0; j < ZAP_LEAF_ARRAY_BYTES; j++) {
return (DCMD_OK);
typedef struct dbufs_data {
char *osname;
} dbufs_data_t;
return (WALK_ERR);
return (WALK_NEXT);
return (DCMD_USAGE);
if (object) {
if (blkid) {
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
typedef struct abuf_find_data {
return (WALK_ERR);
return (WALK_NEXT);
const char *syms[] = {
return (DCMD_USAGE);
case MDB_TYPE_STRING:
case MDB_TYPE_IMMEDIATE:
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
if (!gotid) {
return (WALK_ERR);
return (WALK_ERR);
return (WALK_ERR);
return (DCMD_ERR);
if (*verbosep)
if (*verbosep)
return (WALK_NEXT);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
int nstats, i;
const char *suffix;
static const char *bytestats[] = {
static const char *extras[] = {
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_USAGE);
switch (shift) {
for (i = 0; i < nstats; i++) {
for (j = 0; bytestats[j]; j++) {
if (bytes) {
for (i = 0; extras[i]; i++) {
return (DCMD_ERR);
extras[i]);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
const char *state;
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_OK);
return (DCMD_OK);
return (DCMD_ERR);
if (config) {
return (DCMD_ERR);
mdb_arg_t v;
&v) != DCMD_OK)
return (DCMD_ERR);
return (DCMD_OK);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_OK);
0, NULL));
int recursive)
int c, children;
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
case VDEV_STATE_CLOSED:
case VDEV_STATE_OFFLINE:
case VDEV_STATE_CANT_OPEN:
case VDEV_STATE_DEGRADED:
case VDEV_STATE_HEALTHY:
case VDEV_STATE_REMOVED:
case VDEV_STATE_FAULTED:
case VDEV_AUX_NONE:
case VDEV_AUX_OPEN_FAILED:
case VDEV_AUX_CORRUPT_DATA:
case VDEV_AUX_NO_REPLICAS:
case VDEV_AUX_BAD_GUID_SUM:
case VDEV_AUX_TOO_SMALL:
case VDEV_AUX_BAD_LABEL:
case VDEV_AUX_VERSION_NEWER:
case VDEV_AUX_VERSION_OLDER:
case VDEV_AUX_SPARED:
case VDEV_AUX_ERR_EXCEEDED:
case VDEV_AUX_IO_FAILURE:
case VDEV_AUX_BAD_LOG:
case VDEV_AUX_EXTERNAL:
case VDEV_AUX_SPLIT_POOL:
if (stats) {
if (stats)
return (DCMD_OK);
return (DCMD_ERR);
for (c = 0; c < children; c++) {
return (DCMD_ERR);
return (DCMD_OK);
return (DCMD_USAGE);
return (DCMD_ERR);
typedef struct metaslab_walk_data {
int mw_curvdev;
int mw_curms;
return (WALK_DONE);
return (WALK_ERR);
return (WALK_ERR);
return (WALK_NEXT);
return (WALK_ERR);
return (WALK_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (WALK_NEXT);
typedef struct mdb_spa {
} mdb_spa_t;
typedef struct mdb_dsl_dir {
typedef struct mdb_dsl_dir_phys {
typedef struct mdb_vdev {
} mdb_vdev_t;
typedef struct mdb_metaslab {
typedef struct space_data {
} space_data_t;
return (WALK_ERR);
return (WALK_NEXT);
argc)
return (DCMD_USAGE);
return (DCMD_USAGE);
if (bits) {
shift = 0;
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_OK);
return (DCMD_OK);
const char *name)
int ret, i;
return (DCMD_ERR);
return (ret);
int ret;
return (DCMD_USAGE);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_OK);
return (ret);
return (DCMD_ERR);
return (DCMD_OK);
#define ZIO_WALK_SELF 0
typedef struct zio_print_args {
int zpa_current_depth;
int zpa_min_depth;
int zpa_max_depth;
int zpa_type;
return (WALK_ERR);
return (WALK_NEXT);
return (WALK_ERR);
return (WALK_NEXT);
return (WALK_ERR);
return (WALK_ERR);
return (DCMD_USAGE);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
addr = 0;
typedef struct txg_list_walk_data {
int lw_txgoff;
int lw_maxoff;
void *lw_obj;
return (WALK_ERR);
for (i = 0; i < TXG_SIZE; i++)
return (WALK_NEXT);
int status;
return (WALK_DONE);
return (WALK_ERR);
return (status);
return (WALK_ERR);
return (WALK_ERR);
return (WALK_ERR);
return (WALK_NEXT);
return (WALK_ERR);
return (WALK_ERR);
return (WALK_NEXT);
return (WALK_ERR);
return (WALK_NEXT);
return (WALK_ERR);
return (WALK_NEXT);
return (WALK_NEXT);
for (i = frac_digits; i; i--)
int index = 0;
index++;
if (index == 0) {
(u_longlong_t)n);
(u_longlong_t)n, u);
return (DCMD_ERR);
return (DCMD_USAGE);
return (DCMD_USAGE);
return (DCMD_ERR);
if (ditto != 0) {
for (t = 0; t <= DMU_OT_NUMTYPES; t++) {
if (t == DMU_OT_DEFERRED)
else if (t == DMU_OT_TOTAL)
return (DCMD_ERR);
return (DCMD_OK);
static int gotid;
if (!gotid) {
return (WALK_ERR);
return (WALK_ERR);
if (removed)
if (holder_is_str)
if (removed) {
return (WALK_NEXT);
static int gotid;
return (DCMD_USAGE);
if (!gotid) {
return (DCMD_ERR);
return (DCMD_ERR);
if (rc_count > 0)
return (DCMD_ERR);
if (rc_removed_count > 0)
return (DCMD_ERR);
return (DCMD_OK);
char *name;
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
return (DCMD_OK);
int attr_count;
return (DCMD_USAGE);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
if (bonus_tab) {
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
if (!verbose) {
return (DCMD_OK);
case ACE_OWNER:
case ACE_EVERYONE:
case ACE_IDENTIFIER_GROUP:
switch (ace_type) {
return (DCMD_OK);
return (DCMD_USAGE);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_USAGE);
return (DCMD_USAGE);
return (DCMD_ERR);
typedef struct acl_dump_args {
int a_argc;
int a_flags;
return (WALK_ERR);
return (WALK_ERR);
return (WALK_NEXT);
return (DCMD_ERR);
return (DCMD_ERR);
return (WALK_NEXT);
return (DCMD_USAGE);
return (DCMD_USAGE);
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_OK);
return (WALK_ERR);
return (WALK_ERR);
return (WALK_NEXT);
return (WALK_ERR);
typedef struct ace_walk_data {
int ace_count;
int ace_version;
return (WALK_ERR);
return (WALK_NEXT);
static int gotid;
int z_ace_count;
if (!gotid) {
return (DCMD_ERR);
return (DCMD_ERR);
return (DCMD_ERR);
int status;
int entry_type;
int allow_type;
return (WALK_DONE);
return (WALK_ERR);
return (WALK_ERR);
switch (entry_type) {
case ACE_OWNER:
case ACE_EVERYONE:
case ACE_IDENTIFIER_GROUP:
switch (allow_type) {
return (status);
abuf_find },
zfs_blkstats },
zfs_acl_dump },
{ NULL }
{ NULL }
const mdb_modinfo_t *
_mdb_init(void)
return (&modinfo);