| /netbsd-src/external/cddl/osnet/dist/lib/libzfs/common/ |
| H A D | libzfs_dataset.c | 202 process_user_props(zfs_handle_t *zhp, nvlist_t *props) in process_user_props() argument 204 libzfs_handle_t *hdl = zhp->zfs_hdl; in process_user_props() 231 zpool_add_handle(zfs_handle_t *zhp, const char *pool_name) in zpool_add_handle() argument 233 libzfs_handle_t *hdl = zhp->zfs_hdl; in zpool_add_handle() 245 zpool_find_handle(zfs_handle_t *zhp, const char *pool_name, int len) in zpool_find_handle() argument 247 libzfs_handle_t *hdl = zhp->zfs_hdl; in zpool_find_handle() 262 zpool_handle(zfs_handle_t *zhp) in zpool_handle() argument 268 len = strcspn(zhp->zfs_name, "/@#") + 1; in zpool_handle() 269 pool_name = zfs_alloc(zhp->zfs_hdl, len); in zpool_handle() 270 (void) strlcpy(pool_name, zhp->zfs_name, len); in zpool_handle() [all …]
|
| H A D | libzfs_iter.c | 40 zfs_iter_clones(zfs_handle_t *zhp, zfs_iter_f func, void *data) in zfs_iter_clones() argument 42 nvlist_t *nvl = zfs_get_clones_nvl(zhp); in zfs_iter_clones() 50 zfs_handle_t *clone = zfs_open(zhp->zfs_hdl, nvpair_name(pair), in zfs_iter_clones() 62 zfs_do_list_ioctl(zfs_handle_t *zhp, unsigned long arg, zfs_cmd_t *zc) in zfs_do_list_ioctl() argument 69 (void) strlcpy(zc->zc_name, zhp->zfs_name, sizeof (zc->zc_name)); in zfs_do_list_ioctl() 70 rc = ioctl(zhp->zfs_hdl->libzfs_fd, arg, zc); in zfs_do_list_ioctl() 76 if (zcmd_expand_dst_nvlist(zhp->zfs_hdl, zc) != 0) { in zfs_do_list_ioctl() 92 rc = zfs_standard_error(zhp->zfs_hdl, errno, in zfs_do_list_ioctl() 105 zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data) in zfs_iter_filesystems() argument 111 if (zhp->zfs_type != ZFS_TYPE_FILESYSTEM) in zfs_iter_filesystems() [all …]
|
| H A D | libzfs_mount.c | 228 zfs_is_mounted(zfs_handle_t *zhp, char **where) in zfs_is_mounted() argument 230 return (is_mounted(zhp->zfs_hdl, zfs_get_name(zhp), where)); in zfs_is_mounted() 238 zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t buflen, in zfs_is_mountable() argument 244 if (!zfs_prop_valid_for_type(ZFS_PROP_MOUNTPOINT, zhp->zfs_type)) in zfs_is_mountable() 247 verify(zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, buf, buflen, in zfs_is_mountable() 254 if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF) in zfs_is_mountable() 257 if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) && in zfs_is_mountable() 271 zfs_mount(zfs_handle_t *zhp, const char *options, int flags) in zfs_mount() argument 276 libzfs_handle_t *hdl = zhp->zfs_hdl; in zfs_mount() 286 if (zpool_get_prop_int(zhp->zpool_hdl, ZPOOL_PROP_READONLY, NULL)) in zfs_mount() [all …]
|
| H A D | libzfs_config.c | 220 zpool_get_config(zpool_handle_t *zhp, nvlist_t **oldconfig) in zpool_get_config() argument 223 *oldconfig = zhp->zpool_old_config; in zpool_get_config() 224 return (zhp->zpool_config); in zpool_get_config() 232 zpool_get_features(zpool_handle_t *zhp) in zpool_get_features() argument 236 config = zpool_get_config(zhp, NULL); in zpool_get_features() 243 error = zpool_refresh_stats(zhp, &missing); in zpool_get_features() 248 config = zpool_get_config(zhp, NULL); in zpool_get_features() 265 zpool_refresh_stats(zpool_handle_t *zhp, boolean_t *missing) in zpool_refresh_stats() argument 270 libzfs_handle_t *hdl = zhp->zpool_hdl; in zpool_refresh_stats() 273 (void) strcpy(zc.zc_name, zhp->zpool_name); in zpool_refresh_stats() [all …]
|
| H A D | libzfs_pool.c | 67 zpool_get_all_props(zpool_handle_t *zhp) in zpool_get_all_props() argument 70 libzfs_handle_t *hdl = zhp->zpool_hdl; in zpool_get_all_props() 72 (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_get_all_props() 89 if (zcmd_read_dst_nvlist(hdl, &zc, &zhp->zpool_props) != 0) { in zpool_get_all_props() 100 zpool_props_refresh(zpool_handle_t *zhp) in zpool_props_refresh() argument 104 old_props = zhp->zpool_props; in zpool_props_refresh() 106 if (zpool_get_all_props(zhp) != 0) in zpool_props_refresh() 114 zpool_get_prop_string(zpool_handle_t *zhp, zpool_prop_t prop, in zpool_get_prop_string() argument 122 nvl = zhp->zpool_props; in zpool_get_prop_string() 140 zpool_get_prop_int(zpool_handle_t *zhp, zpool_prop_t prop, zprop_source_t *src) in zpool_get_prop_int() argument [all …]
|
| H A D | libzfs_sendrecv.c | 632 static void send_iterate_prop(zfs_handle_t *zhp, nvlist_t *nv); 635 send_iterate_snap(zfs_handle_t *zhp, void *arg) in send_iterate_snap() argument 638 uint64_t guid = zhp->zfs_dmustats.dds_guid; in send_iterate_snap() 639 uint64_t txg = zhp->zfs_dmustats.dds_creation_txg; in send_iterate_snap() 643 snapname = strrchr(zhp->zfs_name, '@')+1; in send_iterate_snap() 650 zhp->zfs_name, sd->tosnap); in send_iterate_snap() 652 zfs_close(zhp); in send_iterate_snap() 668 send_iterate_prop(zhp, nv); in send_iterate_snap() 672 zfs_close(zhp); in send_iterate_snap() 677 send_iterate_prop(zfs_handle_t *zhp, nvlist_t *nv) in send_iterate_prop() argument [all …]
|
| H A D | libzfs_diff.c | 68 zfs_handle_t *zhp; member 102 error = ioctl(di->zhp->zfs_hdl->libzfs_fd, ZFS_IOC_OBJ_TO_STATS, &zc); in get_stats_for_obj() 388 libzfs_handle_t *lhdl = di->zhp->zfs_hdl; in write_free_diffs() 505 return (zfs_error(di->zhp->zfs_hdl, EZFS_DIFF, di->errbuf)); in find_shares_object() 518 libzfs_handle_t *hdl = di->zhp->zfs_hdl; in make_temp_snapshot() 564 libzfs_handle_t *hdl = di->zhp->zfs_hdl; in get_snapshot_names() 624 zfs_handle_t *zhp; in get_snapshot_names() local 626 di->ds = zfs_alloc(di->zhp->zfs_hdl, tdslen + 1); in get_snapshot_names() 630 zhp = zfs_open(hdl, di->ds, ZFS_TYPE_FILESYSTEM); in get_snapshot_names() 631 while (zhp != NULL) { in get_snapshot_names() [all …]
|
| H A D | libzfs_changelist.c | 402 change_one(zfs_handle_t *zhp, void *data) in change_one() argument 421 if (!(ZFS_IS_VOLUME(zhp) && clp->cl_realprop == ZFS_PROP_NAME) && in change_one() 422 zfs_prop_get(zhp, clp->cl_prop, property, in change_one() 425 zfs_close(zhp); in change_one() 435 zfs_prop_get(zhp, clp->cl_shareprop, property, in change_one() 438 zfs_close(zhp); in change_one() 448 if ((cn = zfs_alloc(zfs_get_handle(zhp), in change_one() 450 zfs_close(zhp); in change_one() 454 cn->cn_handle = zhp; in change_one() 456 zfs_is_mounted(zhp, NULL); in change_one() [all …]
|
| H A D | libzfs_import.c | 363 zpool_handle_t *zhp; in pool_active() local 366 if (zpool_open_silent(hdl, name, &zhp) != 0) in pool_active() 369 if (zhp == NULL) { in pool_active() 374 verify(nvlist_lookup_uint64(zhp->zpool_config, ZPOOL_CONFIG_POOL_GUID, in pool_active() 377 zpool_close(zhp); in pool_active() 1536 name_or_guid_exists(zpool_handle_t *zhp, void *data) in name_or_guid_exists() argument 1544 verify(nvlist_lookup_string(zhp->zpool_config, in name_or_guid_exists() 1551 verify(nvlist_lookup_uint64(zhp->zpool_config, in name_or_guid_exists() 1557 zpool_close(zhp); in name_or_guid_exists() 1604 find_aux(zpool_handle_t *zhp, void *data) in find_aux() argument [all …]
|
| H A D | libzfs_fru.c | 360 zpool_fru_set(zpool_handle_t *zhp, uint64_t vdev_guid, const char *fru) in zpool_fru_set() argument 364 (void) strncpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name)); in zpool_fru_set() 368 if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_VDEV_SETFRU, &zc) != 0) in zpool_fru_set() 369 return (zpool_standard_error_fmt(zhp->zpool_hdl, errno, in zpool_fru_set()
|
| H A D | libzfs.h | 441 extern int zfs_prop_get_userquota_int(zfs_handle_t *zhp, const char *propname, 443 extern int zfs_prop_get_userquota(zfs_handle_t *zhp, const char *propname, 445 extern int zfs_prop_get_written_int(zfs_handle_t *zhp, const char *propname, 447 extern int zfs_prop_get_written(zfs_handle_t *zhp, const char *propname, 449 extern int zfs_prop_get_feature(zfs_handle_t *zhp, const char *propname,
|
| H A D | libzfs_impl.h | 100 #define ZFS_IS_VOLUME(zhp) ((zhp)->zfs_head_type == ZFS_TYPE_VOLUME) argument
|
| H A D | libzfs_util.c | 716 zpool_get_handle(zpool_handle_t *zhp) in zpool_get_handle() argument 718 return (zhp->zpool_hdl); in zpool_get_handle() 722 zfs_get_handle(zfs_handle_t *zhp) in zfs_get_handle() argument 724 return (zhp->zfs_hdl); in zfs_get_handle() 728 zfs_get_pool_handle(const zfs_handle_t *zhp) in zfs_get_pool_handle() argument 730 return (zhp->zpool_hdl); in zfs_get_pool_handle()
|
| H A D | libzfs_status.c | 379 zpool_get_status(zpool_handle_t *zhp, char **msgid) in zpool_get_status() argument 381 zpool_status_t ret = check_status(zhp->zpool_config, B_FALSE); in zpool_get_status()
|
| /netbsd-src/external/cddl/osnet/dist/cmd/zpool/ |
| H A D | zpool_main.c | 366 print_vdev_tree(zpool_handle_t *zhp, const char *name, nvlist_t *nv, int indent, in print_vdev_tree() argument 388 vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE); in print_vdev_tree() 389 print_vdev_tree(zhp, vname, child[c], indent + 2, in print_vdev_tree() 502 zpool_handle_t *zhp; in zpool_do_add() local 539 if ((zhp = zpool_open(g_zfs, poolname)) == NULL) in zpool_do_add() 542 if ((config = zpool_get_config(zhp, NULL)) == NULL) { in zpool_do_add() 545 zpool_close(zhp); in zpool_do_add() 550 nvroot = make_root_vdev(zhp, force, !force, B_FALSE, dryrun, in zpool_do_add() 553 zpool_close(zhp); in zpool_do_add() 564 "configuration:\n"), zpool_get_name(zhp)); in zpool_do_add() [all …]
|
| H A D | zpool_iter.c | 77 add_pool(zpool_handle_t *zhp, void *data) in add_pool() argument 83 node->zn_handle = zhp; in add_pool() 87 zpool_expand_proplist(zhp, zlp->zl_proplist) != 0) { in add_pool() 88 zpool_close(zhp); in add_pool() 94 zpool_close(zhp); in add_pool() 134 zpool_handle_t *zhp; in pool_list_get() local 136 if ((zhp = zpool_open_canfail(g_zfs, argv[i])) != in pool_list_get() 138 if (add_pool(zhp, zlp) != 0) in pool_list_get() 186 pool_list_remove(zpool_list_t *zlp, zpool_handle_t *zhp) in pool_list_remove() argument 190 search.zn_handle = zhp; in pool_list_remove()
|
| H A D | zpool_vdev.c | 948 make_disks(zpool_handle_t *zhp, nvlist_t *nv) in make_disks() argument 981 if (zpool_label_disk(g_zfs, zhp, diskname) == -1) in make_disks() 1023 if ((ret = make_disks(zhp, child[c])) != 0) in make_disks() 1029 if ((ret = make_disks(zhp, child[c])) != 0) in make_disks() 1035 if ((ret = make_disks(zhp, child[c])) != 0) in make_disks() 1430 split_mirror_vdev(zpool_handle_t *zhp, char *newname, nvlist_t *props, in split_mirror_vdev() argument 1444 if (!flags.dryrun && make_disks(zhp, newroot) != 0) { in split_mirror_vdev() 1469 if (zpool_vdev_split(zhp, newname, &newroot, props, flags) != 0) { in split_mirror_vdev() 1488 make_root_vdev(zpool_handle_t *zhp, int force, int check_rep, in make_root_vdev() argument 1503 if (zhp && ((poolconfig = zpool_get_config(zhp, NULL)) == NULL)) in make_root_vdev() [all …]
|
| H A D | zpool_util.h | 46 nvlist_t *make_root_vdev(zpool_handle_t *zhp, int force, int check_rep, 48 nvlist_t *split_mirror_vdev(zpool_handle_t *zhp, char *newname,
|
| /netbsd-src/external/cddl/osnet/dist/cmd/zfs/ |
| H A D | zfs_main.c | 617 should_auto_mount(zfs_handle_t *zhp) in should_auto_mount() argument 619 if (!zfs_prop_valid_for_type(ZFS_PROP_CANMOUNT, zfs_get_type(zhp))) in should_auto_mount() 621 return (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_ON); in should_auto_mount() 637 zfs_handle_t *zhp = NULL; in zfs_do_clone() local 683 if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_SNAPSHOT)) == NULL) in zfs_do_clone() 701 ret = zfs_clone(zhp, argv[1], props); in zfs_do_clone() 729 zfs_close(zhp); in zfs_do_clone() 735 if (zhp) in zfs_do_clone() 736 zfs_close(zhp); in zfs_do_clone() 763 zfs_handle_t *zhp = NULL; in zfs_do_create() local [all …]
|
| H A D | zfs_iter.c | 76 zfs_include_snapshots(zfs_handle_t *zhp, callback_data_t *cb) in zfs_include_snapshots() argument 83 zph = zfs_get_pool_handle(zhp); in zfs_include_snapshots() 92 zfs_callback(zfs_handle_t *zhp, void *data) in zfs_callback() argument 96 boolean_t include_snaps = zfs_include_snapshots(zhp, cb); in zfs_callback() 99 if ((zfs_get_type(zhp) & cb->cb_types) || in zfs_callback() 100 ((zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) && include_snaps)) { in zfs_callback() 104 node->zn_handle = zhp; in zfs_callback() 111 zfs_prune_proplist(zhp, in zfs_callback() 114 if (zfs_expand_proplist(zhp, cb->cb_proplist, in zfs_callback() 136 if (zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) in zfs_callback() [all …]
|
| /netbsd-src/external/cddl/osnet/dist/cmd/zinject/ |
| H A D | translate.c | 434 zpool_handle_t *zhp; in translate_device() local 442 if ((zhp = zpool_open(g_zfs, pool)) == NULL) in translate_device() 447 tgt = zpool_find_vdev(zhp, device, &isspare, &iscache, NULL); in translate_device()
|
| H A D | zinject.c | 676 zfs_handle_t *zhp; in main() local 1076 if ((zhp = zfs_open(g_zfs, dataset, ZFS_TYPE_DATASET)) == NULL) in main() 1079 if (zfs_unmount(zhp, NULL, 0) != 0) in main() 1088 ret = (zfs_mount(zhp, NULL, 0) != 0); in main()
|