Lines Matching refs:zhp
142 zfs_handle_t *zhp = NULL; in _be_activate() local
247 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) != NULL) { in _be_activate()
253 if (be_promote_ds_callback(zhp, NULL) != 0) { in _be_activate()
287 if ((zhp = zfs_open(g_zfs, root_ds, in _be_activate()
296 if ((ret = be_find_active_zone_root(zhp, cb.obe_zpool, in _be_activate()
300 ZFS_CLOSE(zhp); in _be_activate()
306 ZFS_CLOSE(zhp); in _be_activate()
311 if (zfs_prop_set(zhp, BE_ZONE_ACTIVE_PROPERTY, "on") != 0) { in _be_activate()
316 ZFS_CLOSE(zhp); in _be_activate()
319 ZFS_CLOSE(zhp); in _be_activate()
322 if ((zhp = zfs_open(g_zfs, active_ds, in _be_activate()
330 if (zfs_prop_set(zhp, BE_ZONE_ACTIVE_PROPERTY, "off") != 0) { in _be_activate()
335 ZFS_CLOSE(zhp); in _be_activate()
338 ZFS_CLOSE(zhp); in _be_activate()
435 zpool_handle_t *zhp; in set_bootfs() local
438 if ((zhp = zpool_open(g_zfs, boot_rpool)) == NULL) { in set_bootfs()
445 err = zpool_set_prop(zhp, "bootfs", be_root_ds); in set_bootfs()
451 zpool_close(zhp); in set_bootfs()
455 zpool_close(zhp); in set_bootfs()
476 zfs_handle_t *zhp = NULL; in set_canmount() local
486 if ((zhp = zfs_open(g_zfs, ds_path, ZFS_TYPE_DATASET)) == in set_canmount()
494 if (zfs_prop_get_int(zhp, ZFS_PROP_MOUNTED)) { in set_canmount()
501 err = zfs_prop_set(zhp, in set_canmount()
504 ZFS_CLOSE(zhp); in set_canmount()
512 ZFS_CLOSE(zhp); in set_canmount()
519 if ((zhp = zfs_open(g_zfs, ds_path, ZFS_TYPE_DATASET)) in set_canmount()
527 if (zfs_prop_get_int(zhp, ZFS_PROP_MOUNTED)) { in set_canmount()
533 ZFS_CLOSE(zhp); in set_canmount()
536 err = zfs_prop_set(zhp, in set_canmount()
539 ZFS_CLOSE(zhp); in set_canmount()
547 ZFS_CLOSE(zhp); in set_canmount()
575 zfs_handle_t *zhp = NULL; in be_get_grub_vers() local
639 if ((zhp = zfs_open(g_zfs, bt->obe_root_ds, ZFS_TYPE_FILESYSTEM)) == in be_get_grub_vers()
648 if (!zfs_is_mounted(zhp, &temp_mntpnt)) { in be_get_grub_vers()
655 ZFS_CLOSE(zhp); in be_get_grub_vers()
660 ZFS_CLOSE(zhp); in be_get_grub_vers()
907 zfs_handle_t *zhp = NULL; in be_do_installgrub() local
933 if ((zhp = zfs_open(g_zfs, bt->obe_root_ds, ZFS_TYPE_FILESYSTEM)) == in be_do_installgrub()
941 if (!zfs_is_mounted(zhp, &tmp_mntpt)) { in be_do_installgrub()
946 ZFS_CLOSE(zhp); in be_do_installgrub()
951 ZFS_CLOSE(zhp); in be_do_installgrub()
1039 if ((zhp = zfs_open(g_zfs, bt->obe_zpool, ZFS_TYPE_FILESYSTEM)) == in be_do_installgrub()
1051 if ((ret = be_mount_pool(zhp, &ptmp_mntpnt, in be_do_installgrub()
1055 ZFS_CLOSE(zhp); in be_do_installgrub()
1063 if (!zfs_is_mounted(zhp, &pool_mntpnt)) { in be_do_installgrub()
1103 iret = be_unmount_pool(zhp, ptmp_mntpnt, orig_mntpnt); in be_do_installgrub()
1109 ZFS_CLOSE(zhp); in be_do_installgrub()
1141 zfs_handle_t *zhp = NULL; in be_promote_zone_ds() local
1161 if ((zhp = zfs_open(g_zfs, be_root_ds, in be_promote_zone_ds()
1171 if (!zfs_is_mounted(zhp, &temp_mntpt)) { in be_promote_zone_ds()
1176 ZFS_CLOSE(zhp); in be_promote_zone_ds()
1195 ZFS_CLOSE(zhp); in be_promote_zone_ds()
1215 if (be_find_active_zone_root(zhp, zone_ds, in be_promote_zone_ds()
1257 ZFS_CLOSE(zhp); in be_promote_zone_ds()
1282 be_promote_ds_callback(zfs_handle_t *zhp, void *data) in be_promote_ds_callback() argument
1288 if (zhp != NULL) { in be_promote_ds_callback()
1289 sub_dataset = strdup(zfs_get_name(zhp)); in be_promote_ds_callback()
1307 while (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, in be_promote_ds_callback()
1309 if (zfs_promote(zhp) != 0) { in be_promote_ds_callback()
1313 zfs_get_name(zhp), in be_promote_ds_callback()
1333 "name collision: %s\n"), zfs_get_name(zhp), in be_promote_ds_callback()
1339 ZFS_CLOSE(zhp); in be_promote_ds_callback()
1340 if ((zhp = zfs_open(g_zfs, sub_dataset, in be_promote_ds_callback()
1351 ret = zfs_iter_filesystems(zhp, be_promote_ds_callback, NULL); in be_promote_ds_callback()
1355 ZFS_CLOSE(zhp); in be_promote_ds_callback()