MCPcopy Create free account
hub / github.com/F-Stack/f-stack / main

Function main

freebsd/contrib/openzfs/cmd/zdb/zdb.c:8137–8631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8135}
8136
8137int
8138main(int argc, char **argv)
8139{
8140 int c;
8141 struct rlimit rl = { 1024, 1024 };
8142 spa_t *spa = NULL;
8143 objset_t *os = NULL;
8144 int dump_all = 1;
8145 int verbose = 0;
8146 int error = 0;
8147 char **searchdirs = NULL;
8148 int nsearch = 0;
8149 char *target, *target_pool, dsname[ZFS_MAX_DATASET_NAME_LEN];
8150 nvlist_t *policy = NULL;
8151 uint64_t max_txg = UINT64_MAX;
8152 int64_t objset_id = -1;
8153 int flags = ZFS_IMPORT_MISSING_LOG;
8154 int rewind = ZPOOL_NEVER_REWIND;
8155 char *spa_config_path_env, *objset_str;
8156 boolean_t target_is_spa = B_TRUE, dataset_lookup = B_FALSE;
8157 nvlist_t *cfg = NULL;
8158
8159 (void) setrlimit(RLIMIT_NOFILE, &rl);
8160 (void) enable_extended_FILE_stdio(-1, -1);
8161
8162 dprintf_setup(&argc, argv);
8163
8164 /*
8165 * If there is an environment variable SPA_CONFIG_PATH it overrides
8166 * default spa_config_path setting. If -U flag is specified it will
8167 * override this environment variable settings once again.
8168 */
8169 spa_config_path_env = getenv("SPA_CONFIG_PATH");
8170 if (spa_config_path_env != NULL)
8171 spa_config_path = spa_config_path_env;
8172
8173 /*
8174 * For performance reasons, we set this tunable down. We do so before
8175 * the arg parsing section so that the user can override this value if
8176 * they choose.
8177 */
8178 zfs_btree_verify_intensity = 3;
8179
8180 while ((c = getopt(argc, argv,
8181 "AbcCdDeEFGhiI:klLmMo:Op:PqRsSt:uU:vVx:XYyZ")) != -1) {
8182 switch (c) {
8183 case 'b':
8184 case 'c':
8185 case 'C':
8186 case 'd':
8187 case 'D':
8188 case 'E':
8189 case 'G':
8190 case 'h':
8191 case 'i':
8192 case 'l':
8193 case 'm':
8194 case 'M':

Callers

nothing calls this directly

Calls 15

dprintf_setupFunction · 0.85
set_global_varFunction · 0.85
umem_allocFunction · 0.85
umem_freeFunction · 0.85
strchrFunction · 0.85
kernel_initFunction · 0.85
zdb_embedded_blockFunction · 0.85
dump_cachefileFunction · 0.85
dump_labelFunction · 0.85
dump_pathFunction · 0.85
nvlist_allocFunction · 0.85
nvlist_add_uint64Function · 0.85

Tested by

no test coverage detected