Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/cmd/zdb/zdb.c
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
int zfs_vdev_async_read_max_active; | int zfs_vdev_async_read_max_active; | ||||
#endif | #endif | ||||
const char cmdname[] = "zdb"; | const char cmdname[] = "zdb"; | ||||
uint8_t dump_opt[256]; | uint8_t dump_opt[256]; | ||||
typedef void object_viewer_t(objset_t *, uint64_t, void *data, size_t size); | typedef void object_viewer_t(objset_t *, uint64_t, void *data, size_t size); | ||||
extern void dump_intent_log(zilog_t *); | extern void dump_intent_log(zilog_t *); | ||||
uint64_t *zopt_object = NULL; | static uint64_t *zopt_object = NULL; | ||||
mahrens: I don't see any references to this in zdb_il.c; can we make it "static" too? | |||||
int zopt_objects = 0; | static int zopt_objects = 0; | ||||
libzfs_handle_t *g_zfs; | static libzfs_handle_t *g_zfs; | ||||
uint64_t max_inflight = 1000; | static uint64_t max_inflight = 1000; | ||||
Not Done Inline ActionsThese changes should be upstreamed to Illumos. delphij: These changes should be upstreamed to Illumos. | |||||
/* | /* | ||||
* These libumem hooks provide a reasonable set of defaults for the allocator's | * These libumem hooks provide a reasonable set of defaults for the allocator's | ||||
* debugging facilities. | * debugging facilities. | ||||
*/ | */ | ||||
const char * | const char * | ||||
_umem_debug_init() | _umem_debug_init() | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | usage(void) | ||||
(void) fprintf(stderr, " -t <txg> -- highest txg to use when " | (void) fprintf(stderr, " -t <txg> -- highest txg to use when " | ||||
"searching for uberblocks\n"); | "searching for uberblocks\n"); | ||||
(void) fprintf(stderr, " -I <number of inflight I/Os> -- " | (void) fprintf(stderr, " -I <number of inflight I/Os> -- " | ||||
"specify the maximum number of " | "specify the maximum number of " | ||||
"checksumming I/Os [default is 200]\n"); | "checksumming I/Os [default is 200]\n"); | ||||
(void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " | (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " | ||||
"to make only that option verbose\n"); | "to make only that option verbose\n"); | ||||
(void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); | (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); | ||||
exit(1); | exit(1); | ||||
Not Done Inline ActionsThis is wrong. usage() is supposed to be an exit point. delphij: This is wrong. usage() is supposed to be an exit point. | |||||
} | } | ||||
/* | /* | ||||
* Called for usage errors that are discovered after a call to spa_open(), | * 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. | * dmu_bonus_hold(), or pool_match(). abort() is called for other errors. | ||||
*/ | */ | ||||
static void | static void | ||||
fatal(const char *fmt, ...) | fatal(const char *fmt, ...) | ||||
{ | { | ||||
va_list ap; | va_list ap; | ||||
va_start(ap, fmt); | va_start(ap, fmt); | ||||
(void) fprintf(stderr, "%s: ", cmdname); | (void) fprintf(stderr, "%s: ", cmdname); | ||||
(void) vfprintf(stderr, fmt, ap); | (void) vfprintf(stderr, fmt, ap); | ||||
va_end(ap); | va_end(ap); | ||||
(void) fprintf(stderr, "\n"); | (void) fprintf(stderr, "\n"); | ||||
exit(1); | exit(1); | ||||
Not Done Inline ActionsThis is also wrong, similar to usage() fatal is supposed to be a __dead exit. delphij: This is also wrong, similar to usage() fatal is supposed to be a __dead exit. | |||||
} | } | ||||
/* ARGSUSED */ | /* ARGSUSED */ | ||||
static void | static void | ||||
dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size) | dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size) | ||||
{ | { | ||||
nvlist_t *nv; | nvlist_t *nv; | ||||
size_t nvsize = *(uint64_t *)data; | size_t nvsize = *(uint64_t *)data; | ||||
▲ Show 20 Lines • Show All 1,273 Lines • ▼ Show 20 Lines | dump_deadlist(dsl_deadlist_t *dl) | ||||
/* force the tree to be loaded */ | /* force the tree to be loaded */ | ||||
dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); | dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused); | ||||
for (dle = avl_first(&dl->dl_tree); dle; | for (dle = avl_first(&dl->dl_tree); dle; | ||||
dle = AVL_NEXT(&dl->dl_tree, dle)) { | dle = AVL_NEXT(&dl->dl_tree, dle)) { | ||||
if (dump_opt['d'] >= 5) { | if (dump_opt['d'] >= 5) { | ||||
char buf[128]; | char buf[128]; | ||||
(void) snprintf(buf, sizeof (buf), "mintxg %llu -> ", | (void) snprintf(buf, sizeof (buf), "mintxg %llu -> " | ||||
(longlong_t)dle->dle_mintxg, | "obj %llu", (longlong_t)dle->dle_mintxg, | ||||
Not Done Inline ActionsThis should be upstreamed to Illumos. delphij: This should be upstreamed to Illumos. | |||||
(longlong_t)dle->dle_bpobj.bpo_object); | (longlong_t)dle->dle_bpobj.bpo_object); | ||||
Not Done Inline ActionsI'm not sure about the style here -- I think if I was the author I would have a blank line on after line 1490, but it's not clear if it also matches Illumos code style. delphij: I'm not sure about the style here -- I think if I was the author I would have a blank line on… | |||||
Not Done Inline Actionsdoesn't matter much either way to me. mahrens: doesn't matter much either way to me. | |||||
dump_bpobj(&dle->dle_bpobj, buf, 0); | dump_bpobj(&dle->dle_bpobj, buf, 0); | ||||
} else { | } else { | ||||
(void) printf("mintxg %llu -> obj %llu\n", | (void) printf("mintxg %llu -> obj %llu\n", | ||||
(longlong_t)dle->dle_mintxg, | (longlong_t)dle->dle_mintxg, | ||||
(longlong_t)dle->dle_bpobj.bpo_object); | (longlong_t)dle->dle_bpobj.bpo_object); | ||||
Not Done Inline ActionsThis should be upstreamed too. delphij: This should be upstreamed too. | |||||
} | } | ||||
} | } | ||||
} | } | ||||
static avl_tree_t idx_tree; | static avl_tree_t idx_tree; | ||||
static avl_tree_t domain_tree; | static avl_tree_t domain_tree; | ||||
static boolean_t fuid_table_loaded; | static boolean_t fuid_table_loaded; | ||||
static boolean_t sa_loaded; | static boolean_t sa_loaded; | ||||
▲ Show 20 Lines • Show All 2,199 Lines • Show Last 20 Lines |
I don't see any references to this in zdb_il.c; can we make it "static" too?