Lines Matching defs:cb

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