Lines Matching refs:cb
275 print_prop_cb(int prop, void *cb) in print_prop_cb() argument
277 FILE *fp = cb; in print_prop_cb()
1180 spare_cbdata_t cb; in print_status_config() local
1243 &cb.cb_guid) == 0); in print_status_config()
1244 if (zpool_iter(g_zfs, find_spare, &cb) == 1) { in print_status_config()
1245 if (strcmp(zpool_get_name(cb.cb_zhp), in print_status_config()
1252 zpool_get_name(cb.cb_zhp)); in print_status_config()
1253 zpool_close(cb.cb_zhp); in print_status_config()
2155 print_iostat_separator(iostat_cbdata_t *cb) in print_iostat_separator() argument
2159 for (i = 0; i < cb->cb_namewidth; i++) in print_iostat_separator()
2165 print_iostat_header(iostat_cbdata_t *cb) in print_iostat_header() argument
2168 cb->cb_namewidth, ""); in print_iostat_header()
2170 cb->cb_namewidth, "pool"); in print_iostat_header()
2171 print_iostat_separator(cb); in print_iostat_header()
2193 nvlist_t *newnv, iostat_cbdata_t *cb, int depth) in print_vdev_stats() argument
2213 if (strlen(name) + depth > cb->cb_namewidth) in print_vdev_stats()
2217 (int)(cb->cb_namewidth - strlen(name) - depth), ""); in print_vdev_stats()
2248 if (!cb->cb_verbose) in print_vdev_stats()
2273 newchild[c], cb, depth + 2); in print_vdev_stats()
2283 "-\n", cb->cb_namewidth, "logs"); in print_vdev_stats()
2295 cb, depth + 2); in print_vdev_stats()
2315 "-\n", cb->cb_namewidth, "cache"); in print_vdev_stats()
2320 newchild[c], cb, depth + 2); in print_vdev_stats()
2329 iostat_cbdata_t *cb = data; in refresh_iostat() local
2339 pool_list_remove(cb->cb_list, zhp); in refresh_iostat()
2350 iostat_cbdata_t *cb = data; in print_iostat() local
2356 if (cb->cb_iteration == 1) in print_iostat()
2371 print_vdev_stats(zhp, zpool_get_name(zhp), oldnvroot, newnvroot, cb, 0); in print_iostat()
2373 if (cb->cb_verbose) in print_iostat()
2374 print_iostat_separator(cb); in print_iostat()
2382 iostat_cbdata_t *cb = data; in get_namewidth() local
2388 if (!cb->cb_verbose) in get_namewidth()
2389 cb->cb_namewidth = strlen(zpool_get_name(zhp)); in get_namewidth()
2391 cb->cb_namewidth = max_width(zhp, nvroot, 0, in get_namewidth()
2392 cb->cb_namewidth); in get_namewidth()
2399 if (cb->cb_namewidth < 10) in get_namewidth()
2400 cb->cb_namewidth = 10; in get_namewidth()
2401 if (cb->cb_namewidth > 38) in get_namewidth()
2402 cb->cb_namewidth = 38; in get_namewidth()
2510 iostat_cbdata_t cb; in zpool_do_iostat() local
2554 cb.cb_list = list; in zpool_do_iostat()
2555 cb.cb_verbose = verbose; in zpool_do_iostat()
2556 cb.cb_iteration = 0; in zpool_do_iostat()
2557 cb.cb_namewidth = 0; in zpool_do_iostat()
2570 (void) pool_list_iter(list, B_FALSE, refresh_iostat, &cb); in zpool_do_iostat()
2576 cb.cb_namewidth = 0; in zpool_do_iostat()
2577 (void) pool_list_iter(list, B_FALSE, get_namewidth, &cb); in zpool_do_iostat()
2585 if (++cb.cb_iteration == 1 || verbose) in zpool_do_iostat()
2586 print_iostat_header(&cb); in zpool_do_iostat()
2588 (void) pool_list_iter(list, B_FALSE, print_iostat, &cb); in zpool_do_iostat()
2595 print_iostat_separator(&cb); in zpool_do_iostat()
2632 print_header(list_cbdata_t *cb) in print_header() argument
2634 zprop_list_t *pl = cb->cb_proplist; in print_header()
2643 if (first && cb->cb_verbose) { in print_header()
2648 width = cb->cb_namewidth; in print_header()
2686 print_pool(zpool_handle_t *zhp, list_cbdata_t *cb) in print_pool() argument
2688 zprop_list_t *pl = cb->cb_proplist; in print_pool()
2698 if (first && cb->cb_verbose) { in print_pool()
2703 width = cb->cb_namewidth; in print_pool()
2707 if (cb->cb_scripted) in print_pool()
2718 sizeof (property), NULL, cb->cb_literal) != 0) in print_pool()
2739 if (cb->cb_scripted || (pl->pl_next == NULL && !right_justify)) in print_pool()
2791 list_cbdata_t *cb, int depth) in print_list_stats() argument
2797 boolean_t scripted = cb->cb_scripted; in print_list_stats()
2811 else if (strlen(name) + depth > cb->cb_namewidth) in print_list_stats()
2815 (int)(cb->cb_namewidth - strlen(name) - depth), ""); in print_list_stats()
2858 print_list_stats(zhp, vname, child[c], cb, depth + 2); in print_list_stats()
2864 (void) printf(dashes, cb->cb_namewidth, "log"); in print_list_stats()
2870 print_list_stats(zhp, vname, child[c], cb, depth + 2); in print_list_stats()
2878 (void) printf(dashes, cb->cb_namewidth, "cache"); in print_list_stats()
2881 print_list_stats(zhp, vname, child[c], cb, depth + 2); in print_list_stats()
2889 (void) printf(dashes, cb->cb_namewidth, "spare"); in print_list_stats()
2892 print_list_stats(zhp, vname, child[c], cb, depth + 2); in print_list_stats()
2941 list_cbdata_t cb = { 0 }; in zpool_do_list() local
2954 cb.cb_scripted = B_TRUE; in zpool_do_list()
2960 cb.cb_literal = B_TRUE; in zpool_do_list()
2966 cb.cb_verbose = B_TRUE; in zpool_do_list()
2985 if (zprop_get_list(g_zfs, props, &cb.cb_proplist, ZFS_TYPE_POOL) != 0) in zpool_do_list()
2989 if ((list = pool_list_get(argc, argv, &cb.cb_proplist, in zpool_do_list()
2996 cb.cb_namewidth = 0; in zpool_do_list()
2997 (void) pool_list_iter(list, B_FALSE, get_namewidth, &cb); in zpool_do_list()
3002 if (!cb.cb_scripted && (first || cb.cb_verbose)) { in zpool_do_list()
3003 print_header(&cb); in zpool_do_list()
3006 ret = pool_list_iter(list, B_TRUE, list_callback, &cb); in zpool_do_list()
3018 if (argc == 0 && !cb.cb_scripted && pool_list_count(list) == 0) { in zpool_do_list()
3024 zprop_free_list(cb.cb_proplist); in zpool_do_list()
3687 scrub_cbdata_t *cb = data; in scrub_callback() local
3699 err = zpool_scan(zhp, cb->cb_type); in scrub_callback()
3713 scrub_cbdata_t cb; in zpool_do_scrub() local
3715 cb.cb_type = POOL_SCAN_SCRUB; in zpool_do_scrub()
3721 cb.cb_type = POOL_SCAN_NONE; in zpool_do_scrub()
3730 cb.cb_argc = argc; in zpool_do_scrub()
3731 cb.cb_argv = argv; in zpool_do_scrub()
3740 return (for_each_pool(argc, argv, B_TRUE, NULL, scrub_callback, &cb)); in zpool_do_scrub()
4323 status_cbdata_t cb = { 0 }; in zpool_do_status() local
4329 cb.cb_verbose = B_TRUE; in zpool_do_status()
4332 cb.cb_explain = B_TRUE; in zpool_do_status()
4335 cb.cb_dedup_stats = B_TRUE; in zpool_do_status()
4353 cb.cb_allpools = B_TRUE; in zpool_do_status()
4355 cb.cb_first = B_TRUE; in zpool_do_status()
4362 status_callback, &cb); in zpool_do_status()
4364 if (argc == 0 && cb.cb_count == 0) in zpool_do_status()
4366 else if (cb.cb_explain && cb.cb_first && cb.cb_allpools) in zpool_do_status()
4668 upgrade_cbdata_t cb = { 0 }; in zpool_do_upgrade() local
4685 cb.cb_version = strtoll(optarg, &end, 10); in zpool_do_upgrade()
4687 !SPA_VERSION_IS_SUPPORTED(cb.cb_version)) { in zpool_do_upgrade()
4705 cb.cb_argc = argc; in zpool_do_upgrade()
4706 cb.cb_argv = argv; in zpool_do_upgrade()
4710 if (cb.cb_version == 0) { in zpool_do_upgrade()
4711 cb.cb_version = SPA_VERSION; in zpool_do_upgrade()
4797 cb.cb_first = B_TRUE; in zpool_do_upgrade()
4798 ret = zpool_iter(g_zfs, upgrade_cb, &cb); in zpool_do_upgrade()
4799 if (ret == 0 && cb.cb_first) { in zpool_do_upgrade()
4800 if (cb.cb_version == SPA_VERSION) { in zpool_do_upgrade()
4809 cb.cb_version); in zpool_do_upgrade()
4813 cb.cb_first = B_TRUE; in zpool_do_upgrade()
4814 ret = zpool_iter(g_zfs, upgrade_list_older_cb, &cb); in zpool_do_upgrade()
4817 if (cb.cb_first) { in zpool_do_upgrade()
4825 cb.cb_first = B_TRUE; in zpool_do_upgrade()
4826 ret = zpool_iter(g_zfs, upgrade_list_disabled_cb, &cb); in zpool_do_upgrade()
4829 if (cb.cb_first) { in zpool_do_upgrade()
4837 upgrade_one, &cb); in zpool_do_upgrade()
4859 hist_cbdata_t *cb = (hist_cbdata_t *)data; in get_history_one() local
4861 cb->first = B_FALSE; in get_history_one()
4890 if (!cb->internal) in get_history_one()
4903 if (!cb->internal) in get_history_one()
4918 if (!cb->internal) in get_history_one()
4933 if (!cb->internal) in get_history_one()
4939 if (!cb->longfmt) { in get_history_one()
5067 zprop_get_cbdata_t cb = { 0 }; in zpool_do_get() local
5073 cb.cb_first = B_TRUE; in zpool_do_get()
5078 cb.cb_sources = ZPROP_SRC_ALL; in zpool_do_get()
5079 cb.cb_columns[0] = GET_COL_NAME; in zpool_do_get()
5080 cb.cb_columns[1] = GET_COL_PROPERTY; in zpool_do_get()
5081 cb.cb_columns[2] = GET_COL_VALUE; in zpool_do_get()
5082 cb.cb_columns[3] = GET_COL_SOURCE; in zpool_do_get()
5083 cb.cb_type = ZFS_TYPE_POOL; in zpool_do_get()
5089 cb.cb_literal = B_TRUE; in zpool_do_get()
5092 cb.cb_scripted = B_TRUE; in zpool_do_get()
5095 bzero(&cb.cb_columns, sizeof (cb.cb_columns)); in zpool_do_get()
5112 cb.cb_columns[i++] = GET_COL_NAME; in zpool_do_get()
5115 cb.cb_columns[i++] = GET_COL_PROPERTY; in zpool_do_get()
5118 cb.cb_columns[i++] = GET_COL_VALUE; in zpool_do_get()
5121 cb.cb_columns[i++] = GET_COL_SOURCE; in zpool_do_get()
5131 cb.cb_columns[0] = GET_COL_NAME; in zpool_do_get()
5132 cb.cb_columns[1] = GET_COL_PROPERTY; in zpool_do_get()
5133 cb.cb_columns[2] = GET_COL_VALUE; in zpool_do_get()
5134 cb.cb_columns[3] = GET_COL_SOURCE; in zpool_do_get()
5161 if (zprop_get_list(g_zfs, argv[0], &cb.cb_proplist, in zpool_do_get()
5168 if (cb.cb_proplist != NULL) { in zpool_do_get()
5171 fake_name.pl_next = cb.cb_proplist; in zpool_do_get()
5172 cb.cb_proplist = &fake_name; in zpool_do_get()
5175 ret = for_each_pool(argc, argv, B_TRUE, &cb.cb_proplist, in zpool_do_get()
5176 get_callback, &cb); in zpool_do_get()
5178 if (cb.cb_proplist == &fake_name) in zpool_do_get()
5181 zprop_free_list(cb.cb_proplist); in zpool_do_get()
5196 set_cbdata_t *cb = (set_cbdata_t *)data; in set_callback() local
5198 error = zpool_set_prop(zhp, cb->cb_propname, cb->cb_value); in set_callback()
5201 cb->cb_any_successful = B_TRUE; in set_callback()
5209 set_cbdata_t cb = { 0 }; in zpool_do_set() local
5234 cb.cb_propname = argv[1]; in zpool_do_set()
5235 cb.cb_value = strchr(cb.cb_propname, '='); in zpool_do_set()
5236 if (cb.cb_value == NULL) { in zpool_do_set()
5242 *(cb.cb_value) = '\0'; in zpool_do_set()
5243 cb.cb_value++; in zpool_do_set()
5246 set_callback, &cb); in zpool_do_set()