Lines Matching refs:cb
277 print_prop_cb(int prop, void *cb) in print_prop_cb() argument
279 FILE *fp = cb; in print_prop_cb()
1182 spare_cbdata_t cb; in print_status_config() local
1245 &cb.cb_guid) == 0); in print_status_config()
1246 if (zpool_iter(g_zfs, find_spare, &cb) == 1) { in print_status_config()
1247 if (strcmp(zpool_get_name(cb.cb_zhp), in print_status_config()
1254 zpool_get_name(cb.cb_zhp)); in print_status_config()
1255 zpool_close(cb.cb_zhp); in print_status_config()
2157 print_iostat_separator(iostat_cbdata_t *cb) in print_iostat_separator() argument
2161 for (i = 0; i < cb->cb_namewidth; i++) in print_iostat_separator()
2167 print_iostat_header(iostat_cbdata_t *cb) in print_iostat_header() argument
2170 cb->cb_namewidth, ""); in print_iostat_header()
2172 cb->cb_namewidth, "pool"); in print_iostat_header()
2173 print_iostat_separator(cb); in print_iostat_header()
2195 nvlist_t *newnv, iostat_cbdata_t *cb, int depth) in print_vdev_stats() argument
2215 if (strlen(name) + depth > cb->cb_namewidth) in print_vdev_stats()
2219 (int)(cb->cb_namewidth - strlen(name) - depth), ""); in print_vdev_stats()
2250 if (!cb->cb_verbose) in print_vdev_stats()
2275 newchild[c], cb, depth + 2); in print_vdev_stats()
2285 "-\n", cb->cb_namewidth, "logs"); in print_vdev_stats()
2297 cb, depth + 2); in print_vdev_stats()
2317 "-\n", cb->cb_namewidth, "cache"); in print_vdev_stats()
2322 newchild[c], cb, depth + 2); in print_vdev_stats()
2331 iostat_cbdata_t *cb = data; in refresh_iostat() local
2341 pool_list_remove(cb->cb_list, zhp); in refresh_iostat()
2352 iostat_cbdata_t *cb = data; in print_iostat() local
2358 if (cb->cb_iteration == 1) in print_iostat()
2373 print_vdev_stats(zhp, zpool_get_name(zhp), oldnvroot, newnvroot, cb, 0); in print_iostat()
2375 if (cb->cb_verbose) in print_iostat()
2376 print_iostat_separator(cb); in print_iostat()
2384 iostat_cbdata_t *cb = data; in get_namewidth() local
2390 if (!cb->cb_verbose) in get_namewidth()
2391 cb->cb_namewidth = strlen(zpool_get_name(zhp)); in get_namewidth()
2393 cb->cb_namewidth = max_width(zhp, nvroot, 0, in get_namewidth()
2394 cb->cb_namewidth); in get_namewidth()
2401 if (cb->cb_namewidth < 10) in get_namewidth()
2402 cb->cb_namewidth = 10; in get_namewidth()
2403 if (cb->cb_namewidth > 38) in get_namewidth()
2404 cb->cb_namewidth = 38; in get_namewidth()
2512 iostat_cbdata_t cb; in zpool_do_iostat() local
2556 cb.cb_list = list; in zpool_do_iostat()
2557 cb.cb_verbose = verbose; in zpool_do_iostat()
2558 cb.cb_iteration = 0; in zpool_do_iostat()
2559 cb.cb_namewidth = 0; in zpool_do_iostat()
2572 (void) pool_list_iter(list, B_FALSE, refresh_iostat, &cb); in zpool_do_iostat()
2578 cb.cb_namewidth = 0; in zpool_do_iostat()
2579 (void) pool_list_iter(list, B_FALSE, get_namewidth, &cb); in zpool_do_iostat()
2587 if (++cb.cb_iteration == 1 || verbose) in zpool_do_iostat()
2588 print_iostat_header(&cb); in zpool_do_iostat()
2590 (void) pool_list_iter(list, B_FALSE, print_iostat, &cb); in zpool_do_iostat()
2597 print_iostat_separator(&cb); in zpool_do_iostat()
2634 print_header(list_cbdata_t *cb) in print_header() argument
2636 zprop_list_t *pl = cb->cb_proplist; in print_header()
2645 if (first && cb->cb_verbose) { in print_header()
2650 width = cb->cb_namewidth; in print_header()
2688 print_pool(zpool_handle_t *zhp, list_cbdata_t *cb) in print_pool() argument
2690 zprop_list_t *pl = cb->cb_proplist; in print_pool()
2700 if (first && cb->cb_verbose) { in print_pool()
2705 width = cb->cb_namewidth; in print_pool()
2709 if (cb->cb_scripted) in print_pool()
2720 sizeof (property), NULL, cb->cb_literal) != 0) in print_pool()
2741 if (cb->cb_scripted || (pl->pl_next == NULL && !right_justify)) in print_pool()
2793 list_cbdata_t *cb, int depth) in print_list_stats() argument
2799 boolean_t scripted = cb->cb_scripted; in print_list_stats()
2813 else if (strlen(name) + depth > cb->cb_namewidth) in print_list_stats()
2817 (int)(cb->cb_namewidth - strlen(name) - depth), ""); in print_list_stats()
2860 print_list_stats(zhp, vname, child[c], cb, depth + 2); in print_list_stats()
2866 (void) printf(dashes, cb->cb_namewidth, "log"); in print_list_stats()
2872 print_list_stats(zhp, vname, child[c], cb, depth + 2); in print_list_stats()
2880 (void) printf(dashes, cb->cb_namewidth, "cache"); in print_list_stats()
2883 print_list_stats(zhp, vname, child[c], cb, depth + 2); in print_list_stats()
2891 (void) printf(dashes, cb->cb_namewidth, "spare"); in print_list_stats()
2894 print_list_stats(zhp, vname, child[c], cb, depth + 2); in print_list_stats()
2943 list_cbdata_t cb = { 0 }; in zpool_do_list() local
2956 cb.cb_scripted = B_TRUE; in zpool_do_list()
2962 cb.cb_literal = B_TRUE; in zpool_do_list()
2968 cb.cb_verbose = B_TRUE; in zpool_do_list()
2987 if (zprop_get_list(g_zfs, props, &cb.cb_proplist, ZFS_TYPE_POOL) != 0) in zpool_do_list()
2991 if ((list = pool_list_get(argc, argv, &cb.cb_proplist, in zpool_do_list()
2998 cb.cb_namewidth = 0; in zpool_do_list()
2999 (void) pool_list_iter(list, B_FALSE, get_namewidth, &cb); in zpool_do_list()
3004 if (!cb.cb_scripted && (first || cb.cb_verbose)) { in zpool_do_list()
3005 print_header(&cb); in zpool_do_list()
3008 ret = pool_list_iter(list, B_TRUE, list_callback, &cb); in zpool_do_list()
3020 if (argc == 0 && !cb.cb_scripted && pool_list_count(list) == 0) { in zpool_do_list()
3026 zprop_free_list(cb.cb_proplist); in zpool_do_list()
3660 scrub_cbdata_t *cb = data; in scrub_callback() local
3672 err = zpool_scan(zhp, cb->cb_type); in scrub_callback()
3686 scrub_cbdata_t cb; in zpool_do_scrub() local
3688 cb.cb_type = POOL_SCAN_SCRUB; in zpool_do_scrub()
3694 cb.cb_type = POOL_SCAN_NONE; in zpool_do_scrub()
3703 cb.cb_argc = argc; in zpool_do_scrub()
3704 cb.cb_argv = argv; in zpool_do_scrub()
3713 return (for_each_pool(argc, argv, B_TRUE, NULL, scrub_callback, &cb)); in zpool_do_scrub()
4296 status_cbdata_t cb = { 0 }; in zpool_do_status() local
4302 cb.cb_verbose = B_TRUE; in zpool_do_status()
4305 cb.cb_explain = B_TRUE; in zpool_do_status()
4308 cb.cb_dedup_stats = B_TRUE; in zpool_do_status()
4326 cb.cb_allpools = B_TRUE; in zpool_do_status()
4328 cb.cb_first = B_TRUE; in zpool_do_status()
4335 status_callback, &cb); in zpool_do_status()
4337 if (argc == 0 && cb.cb_count == 0) in zpool_do_status()
4339 else if (cb.cb_explain && cb.cb_first && cb.cb_allpools) in zpool_do_status()
4641 upgrade_cbdata_t cb = { 0 }; in zpool_do_upgrade() local
4658 cb.cb_version = strtoll(optarg, &end, 10); in zpool_do_upgrade()
4660 !SPA_VERSION_IS_SUPPORTED(cb.cb_version)) { in zpool_do_upgrade()
4678 cb.cb_argc = argc; in zpool_do_upgrade()
4679 cb.cb_argv = argv; in zpool_do_upgrade()
4683 if (cb.cb_version == 0) { in zpool_do_upgrade()
4684 cb.cb_version = SPA_VERSION; in zpool_do_upgrade()
4770 cb.cb_first = B_TRUE; in zpool_do_upgrade()
4771 ret = zpool_iter(g_zfs, upgrade_cb, &cb); in zpool_do_upgrade()
4772 if (ret == 0 && cb.cb_first) { in zpool_do_upgrade()
4773 if (cb.cb_version == SPA_VERSION) { in zpool_do_upgrade()
4782 cb.cb_version); in zpool_do_upgrade()
4786 cb.cb_first = B_TRUE; in zpool_do_upgrade()
4787 ret = zpool_iter(g_zfs, upgrade_list_older_cb, &cb); in zpool_do_upgrade()
4790 if (cb.cb_first) { in zpool_do_upgrade()
4798 cb.cb_first = B_TRUE; in zpool_do_upgrade()
4799 ret = zpool_iter(g_zfs, upgrade_list_disabled_cb, &cb); in zpool_do_upgrade()
4802 if (cb.cb_first) { in zpool_do_upgrade()
4810 upgrade_one, &cb); in zpool_do_upgrade()
4832 hist_cbdata_t *cb = (hist_cbdata_t *)data; in get_history_one() local
4834 cb->first = B_FALSE; in get_history_one()
4863 if (!cb->internal) in get_history_one()
4876 if (!cb->internal) in get_history_one()
4891 if (!cb->internal) in get_history_one()
4906 if (!cb->internal) in get_history_one()
4912 if (!cb->longfmt) { in get_history_one()
5040 zprop_get_cbdata_t cb = { 0 }; in zpool_do_get() local
5046 cb.cb_first = B_TRUE; in zpool_do_get()
5051 cb.cb_sources = ZPROP_SRC_ALL; in zpool_do_get()
5052 cb.cb_columns[0] = GET_COL_NAME; in zpool_do_get()
5053 cb.cb_columns[1] = GET_COL_PROPERTY; in zpool_do_get()
5054 cb.cb_columns[2] = GET_COL_VALUE; in zpool_do_get()
5055 cb.cb_columns[3] = GET_COL_SOURCE; in zpool_do_get()
5056 cb.cb_type = ZFS_TYPE_POOL; in zpool_do_get()
5062 cb.cb_literal = B_TRUE; in zpool_do_get()
5065 cb.cb_scripted = B_TRUE; in zpool_do_get()
5068 bzero(&cb.cb_columns, sizeof (cb.cb_columns)); in zpool_do_get()
5085 cb.cb_columns[i++] = GET_COL_NAME; in zpool_do_get()
5088 cb.cb_columns[i++] = GET_COL_PROPERTY; in zpool_do_get()
5091 cb.cb_columns[i++] = GET_COL_VALUE; in zpool_do_get()
5094 cb.cb_columns[i++] = GET_COL_SOURCE; in zpool_do_get()
5104 cb.cb_columns[0] = GET_COL_NAME; in zpool_do_get()
5105 cb.cb_columns[1] = GET_COL_PROPERTY; in zpool_do_get()
5106 cb.cb_columns[2] = GET_COL_VALUE; in zpool_do_get()
5107 cb.cb_columns[3] = GET_COL_SOURCE; in zpool_do_get()
5134 if (zprop_get_list(g_zfs, argv[0], &cb.cb_proplist, in zpool_do_get()
5141 if (cb.cb_proplist != NULL) { in zpool_do_get()
5144 fake_name.pl_next = cb.cb_proplist; in zpool_do_get()
5145 cb.cb_proplist = &fake_name; in zpool_do_get()
5148 ret = for_each_pool(argc, argv, B_TRUE, &cb.cb_proplist, in zpool_do_get()
5149 get_callback, &cb); in zpool_do_get()
5151 if (cb.cb_proplist == &fake_name) in zpool_do_get()
5154 zprop_free_list(cb.cb_proplist); in zpool_do_get()
5169 set_cbdata_t *cb = (set_cbdata_t *)data; in set_callback() local
5171 error = zpool_set_prop(zhp, cb->cb_propname, cb->cb_value); in set_callback()
5174 cb->cb_any_successful = B_TRUE; in set_callback()
5182 set_cbdata_t cb = { 0 }; in zpool_do_set() local
5207 cb.cb_propname = argv[1]; in zpool_do_set()
5208 cb.cb_value = strchr(cb.cb_propname, '='); in zpool_do_set()
5209 if (cb.cb_value == NULL) { in zpool_do_set()
5215 *(cb.cb_value) = '\0'; in zpool_do_set()
5216 cb.cb_value++; in zpool_do_set()
5219 set_callback, &cb); in zpool_do_set()