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()
3685 scrub_cbdata_t *cb = data; in scrub_callback() local
3697 err = zpool_scan(zhp, cb->cb_type); in scrub_callback()
3711 scrub_cbdata_t cb; in zpool_do_scrub() local
3713 cb.cb_type = POOL_SCAN_SCRUB; in zpool_do_scrub()
3719 cb.cb_type = POOL_SCAN_NONE; in zpool_do_scrub()
3728 cb.cb_argc = argc; in zpool_do_scrub()
3729 cb.cb_argv = argv; in zpool_do_scrub()
3738 return (for_each_pool(argc, argv, B_TRUE, NULL, scrub_callback, &cb)); in zpool_do_scrub()
4321 status_cbdata_t cb = { 0 }; in zpool_do_status() local
4327 cb.cb_verbose = B_TRUE; in zpool_do_status()
4330 cb.cb_explain = B_TRUE; in zpool_do_status()
4333 cb.cb_dedup_stats = B_TRUE; in zpool_do_status()
4351 cb.cb_allpools = B_TRUE; in zpool_do_status()
4353 cb.cb_first = B_TRUE; in zpool_do_status()
4360 status_callback, &cb); in zpool_do_status()
4362 if (argc == 0 && cb.cb_count == 0) in zpool_do_status()
4364 else if (cb.cb_explain && cb.cb_first && cb.cb_allpools) in zpool_do_status()
4666 upgrade_cbdata_t cb = { 0 }; in zpool_do_upgrade() local
4683 cb.cb_version = strtoll(optarg, &end, 10); in zpool_do_upgrade()
4685 !SPA_VERSION_IS_SUPPORTED(cb.cb_version)) { in zpool_do_upgrade()
4703 cb.cb_argc = argc; in zpool_do_upgrade()
4704 cb.cb_argv = argv; in zpool_do_upgrade()
4708 if (cb.cb_version == 0) { in zpool_do_upgrade()
4709 cb.cb_version = SPA_VERSION; in zpool_do_upgrade()
4795 cb.cb_first = B_TRUE; in zpool_do_upgrade()
4796 ret = zpool_iter(g_zfs, upgrade_cb, &cb); in zpool_do_upgrade()
4797 if (ret == 0 && cb.cb_first) { in zpool_do_upgrade()
4798 if (cb.cb_version == SPA_VERSION) { in zpool_do_upgrade()
4807 cb.cb_version); in zpool_do_upgrade()
4811 cb.cb_first = B_TRUE; in zpool_do_upgrade()
4812 ret = zpool_iter(g_zfs, upgrade_list_older_cb, &cb); in zpool_do_upgrade()
4815 if (cb.cb_first) { in zpool_do_upgrade()
4823 cb.cb_first = B_TRUE; in zpool_do_upgrade()
4824 ret = zpool_iter(g_zfs, upgrade_list_disabled_cb, &cb); in zpool_do_upgrade()
4827 if (cb.cb_first) { in zpool_do_upgrade()
4835 upgrade_one, &cb); in zpool_do_upgrade()
4857 hist_cbdata_t *cb = (hist_cbdata_t *)data; in get_history_one() local
4859 cb->first = B_FALSE; in get_history_one()
4888 if (!cb->internal) in get_history_one()
4901 if (!cb->internal) in get_history_one()
4916 if (!cb->internal) in get_history_one()
4931 if (!cb->internal) in get_history_one()
4937 if (!cb->longfmt) { in get_history_one()
5065 zprop_get_cbdata_t cb = { 0 }; in zpool_do_get() local
5071 cb.cb_first = B_TRUE; in zpool_do_get()
5076 cb.cb_sources = ZPROP_SRC_ALL; in zpool_do_get()
5077 cb.cb_columns[0] = GET_COL_NAME; in zpool_do_get()
5078 cb.cb_columns[1] = GET_COL_PROPERTY; in zpool_do_get()
5079 cb.cb_columns[2] = GET_COL_VALUE; in zpool_do_get()
5080 cb.cb_columns[3] = GET_COL_SOURCE; in zpool_do_get()
5081 cb.cb_type = ZFS_TYPE_POOL; in zpool_do_get()
5087 cb.cb_literal = B_TRUE; in zpool_do_get()
5090 cb.cb_scripted = B_TRUE; in zpool_do_get()
5093 bzero(&cb.cb_columns, sizeof (cb.cb_columns)); in zpool_do_get()
5110 cb.cb_columns[i++] = GET_COL_NAME; in zpool_do_get()
5113 cb.cb_columns[i++] = GET_COL_PROPERTY; in zpool_do_get()
5116 cb.cb_columns[i++] = GET_COL_VALUE; in zpool_do_get()
5119 cb.cb_columns[i++] = GET_COL_SOURCE; in zpool_do_get()
5129 cb.cb_columns[0] = GET_COL_NAME; in zpool_do_get()
5130 cb.cb_columns[1] = GET_COL_PROPERTY; in zpool_do_get()
5131 cb.cb_columns[2] = GET_COL_VALUE; in zpool_do_get()
5132 cb.cb_columns[3] = GET_COL_SOURCE; in zpool_do_get()
5159 if (zprop_get_list(g_zfs, argv[0], &cb.cb_proplist, in zpool_do_get()
5166 if (cb.cb_proplist != NULL) { in zpool_do_get()
5169 fake_name.pl_next = cb.cb_proplist; in zpool_do_get()
5170 cb.cb_proplist = &fake_name; in zpool_do_get()
5173 ret = for_each_pool(argc, argv, B_TRUE, &cb.cb_proplist, in zpool_do_get()
5174 get_callback, &cb); in zpool_do_get()
5176 if (cb.cb_proplist == &fake_name) in zpool_do_get()
5179 zprop_free_list(cb.cb_proplist); in zpool_do_get()
5194 set_cbdata_t *cb = (set_cbdata_t *)data; in set_callback() local
5196 error = zpool_set_prop(zhp, cb->cb_propname, cb->cb_value); in set_callback()
5199 cb->cb_any_successful = B_TRUE; in set_callback()
5207 set_cbdata_t cb = { 0 }; in zpool_do_set() local
5232 cb.cb_propname = argv[1]; in zpool_do_set()
5233 cb.cb_value = strchr(cb.cb_propname, '='); in zpool_do_set()
5234 if (cb.cb_value == NULL) { in zpool_do_set()
5240 *(cb.cb_value) = '\0'; in zpool_do_set()
5241 cb.cb_value++; in zpool_do_set()
5244 set_callback, &cb); in zpool_do_set()