Lines Matching refs:g_zfs

56 libzfs_handle_t *g_zfs = NULL;  variable
180 if ((zlp = zpool_open(g_zfs, bt.nbe_zpool)) == NULL) { in be_init()
183 libzfs_error_description(g_zfs)); in be_init()
184 return (zfs_err_to_be_err(g_zfs)); in be_init()
198 if ((zret = zpool_iter(g_zfs, be_exists_callback, bt.nbe_name)) > 0) { in be_init()
204 libzfs_error_description(g_zfs)); in be_init()
205 return (zfs_err_to_be_err(g_zfs)); in be_init()
271 if (zfs_create(g_zfs, nbe_root_ds, ZFS_TYPE_FILESYSTEM, in be_init()
275 libzfs_error_description(g_zfs)); in be_init()
276 ret = zfs_err_to_be_err(g_zfs); in be_init()
307 if (zfs_create(g_zfs, child_fs, ZFS_TYPE_FILESYSTEM, in be_init()
311 libzfs_error_description(g_zfs)); in be_init()
312 ret = zfs_err_to_be_err(g_zfs); in be_init()
343 if (zfs_dataset_exists(g_zfs, child_fs, in be_init()
347 if (zfs_create(g_zfs, child_fs, ZFS_TYPE_FILESYSTEM, in be_init()
351 child_fs, libzfs_error_description(g_zfs)); in be_init()
352 ret = zfs_err_to_be_err(g_zfs); in be_init()
442 if ((zret = zpool_iter(g_zfs, be_find_zpool_callback, &bt)) == 0) { in be_destroy()
448 libzfs_error_description(g_zfs)); in be_destroy()
449 return (zfs_err_to_be_err(g_zfs)); in be_destroy()
507 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_FILESYSTEM)) == in be_destroy()
511 libzfs_error_description(g_zfs)); in be_destroy()
512 return (zfs_err_to_be_err(g_zfs)); in be_destroy()
688 if ((zphp = zpool_open(g_zfs, bt.obe_zpool)) == NULL) { in be_copy()
691 libzfs_error_description(g_zfs)); in be_copy()
692 return (zfs_err_to_be_err(g_zfs)); in be_copy()
699 if ((zret = zpool_iter(g_zfs, be_find_zpool_callback, &bt)) == in be_copy()
707 libzfs_error_description(g_zfs)); in be_copy()
708 return (zfs_err_to_be_err(g_zfs)); in be_copy()
823 if ((zret = zpool_iter(g_zfs, be_exists_callback, in be_copy()
832 libzfs_error_description(g_zfs)); in be_copy()
833 ret = zfs_err_to_be_err(g_zfs); in be_copy()
844 if (zfs_dataset_exists(g_zfs, nbe_root_ds, in be_copy()
895 if (!zfs_dataset_exists(g_zfs, ss, ZFS_TYPE_SNAPSHOT)) { in be_copy()
898 libzfs_error_description(g_zfs)); in be_copy()
924 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, ZFS_TYPE_FILESYSTEM)) in be_copy()
928 libzfs_error_description(g_zfs)); in be_copy()
929 ret = zfs_err_to_be_err(g_zfs); in be_copy()
937 bt.obe_name, libzfs_error_description(g_zfs)); in be_copy()
938 ret = zfs_err_to_be_err(g_zfs); in be_copy()
1003 if ((zhp = zfs_open(g_zfs, bt.obe_root_ds, in be_copy()
1008 libzfs_error_description(g_zfs)); in be_copy()
1009 ret = zfs_err_to_be_err(g_zfs); in be_copy()
1197 if ((zhp = zfs_open(g_zfs, bt.nbe_root_ds, in be_copy()
1201 libzfs_error_description(g_zfs)); in be_copy()
1202 ret = zfs_err_to_be_err(g_zfs); in be_copy()
1217 libzfs_error_description(g_zfs)); in be_copy()
1218 ret = zfs_err_to_be_err(g_zfs); in be_copy()
1309 if (zfs_dataset_exists(g_zfs, be_root_ds, ZFS_TYPE_FILESYSTEM)) { in be_find_zpool_callback()
1352 if (zfs_dataset_exists(g_zfs, be_root_ds, ZFS_TYPE_FILESYSTEM)) { in be_exists_callback()
1422 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == NULL) { in be_set_uuid()
1425 libzfs_error_description(g_zfs)); in be_set_uuid()
1426 return (zfs_err_to_be_err(g_zfs)); in be_set_uuid()
1433 libzfs_error_description(g_zfs)); in be_set_uuid()
1434 ret = zfs_err_to_be_err(g_zfs); in be_set_uuid()
1467 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == NULL) { in be_get_uuid()
1470 libzfs_error_description(g_zfs)); in be_get_uuid()
1471 return (zfs_err_to_be_err(g_zfs)); in be_get_uuid()
1478 root_ds, libzfs_error_description(g_zfs)); in be_get_uuid()
1479 ret = zfs_err_to_be_err(g_zfs); in be_get_uuid()
1542 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1546 libzfs_error_description(g_zfs)); in _be_destroy()
1547 return (zfs_err_to_be_err(g_zfs)); in _be_destroy()
1562 if ((zhp = zfs_open(g_zfs, root_ds, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1566 libzfs_error_description(g_zfs)); in _be_destroy()
1567 return (zfs_err_to_be_err(g_zfs)); in _be_destroy()
1594 ret = zfs_err_to_be_err(g_zfs); in _be_destroy()
1605 if ((zhp = zfs_open(g_zfs, origin, ZFS_TYPE_SNAPSHOT)) == in _be_destroy()
1609 libzfs_error_description(g_zfs)); in _be_destroy()
1610 ret = zfs_err_to_be_err(g_zfs); in _be_destroy()
1622 if ((zhp = zfs_open(g_zfs, parent, ZFS_TYPE_FILESYSTEM)) == in _be_destroy()
1626 libzfs_error_description(g_zfs)); in _be_destroy()
1627 ret = zfs_err_to_be_err(g_zfs); in _be_destroy()
1643 "BE: %s\n"), libzfs_error_description(g_zfs)); in _be_destroy()
1654 if (libzfs_errno(g_zfs) != EZFS_EXISTS) { in _be_destroy()
1655 ret = zfs_err_to_be_err(g_zfs); in _be_destroy()
1712 if ((zhp = zfs_open(g_zfs, be_root_ds, ZFS_TYPE_FILESYSTEM)) == in be_destroy_zones()
1716 libzfs_error_description(g_zfs)); in be_destroy_zones()
1718 return (zfs_err_to_be_err(g_zfs)); in be_destroy_zones()
1833 if ((zhp = zfs_open(g_zfs, zone_container_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1837 zone_container_ds, libzfs_error_description(g_zfs)); in be_destroy_zone_roots()
1838 return (zfs_err_to_be_err(g_zfs)); in be_destroy_zone_roots()
1849 zonepath_ds, libzfs_error_description(g_zfs)); in be_destroy_zone_roots()
1856 if ((zhp = zfs_open(g_zfs, zone_container_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1860 zone_container_ds, libzfs_error_description(g_zfs)); in be_destroy_zone_roots()
1861 return (zfs_err_to_be_err(g_zfs)); in be_destroy_zone_roots()
1875 zone_container_ds, libzfs_error_description(g_zfs)); in be_destroy_zone_roots()
1881 if ((zhp = zfs_open(g_zfs, zonepath_ds, ZFS_TYPE_FILESYSTEM)) in be_destroy_zone_roots()
1885 zonepath_ds, libzfs_error_description(g_zfs)); in be_destroy_zone_roots()
1894 zonepath_ds, libzfs_error_description(g_zfs)); in be_destroy_zone_roots()
2007 if ((obe_zhp = zfs_open(g_zfs, obe_root_ds, ZFS_TYPE_FILESYSTEM)) in be_copy_zones()
2011 "%s\n"), obe_root_ds, libzfs_error_description(g_zfs)); in be_copy_zones()
2012 return (zfs_err_to_be_err(g_zfs)); in be_copy_zones()
2016 if ((nbe_zhp = zfs_open(g_zfs, nbe_root_ds, ZFS_TYPE_FILESYSTEM)) in be_copy_zones()
2020 libzfs_error_description(g_zfs)); in be_copy_zones()
2022 return (zfs_err_to_be_err(g_zfs)); in be_copy_zones()
2106 if ((z_zhp = zfs_open(g_zfs, zoneroot_ds, in be_copy_zones()
2110 zoneroot_ds, libzfs_error_description(g_zfs)); in be_copy_zones()
2111 ret = zfs_err_to_be_err(g_zfs); in be_copy_zones()
2136 if (zfs_snapshot(g_zfs, ss, B_TRUE, NULL) != 0) { in be_copy_zones()
2139 ss, libzfs_error_description(g_zfs)); in be_copy_zones()
2140 if (libzfs_errno(g_zfs) == EZFS_EXISTS) in be_copy_zones()
2143 ret = zfs_err_to_be_err(g_zfs); in be_copy_zones()
2216 if ((z_zhp = zfs_open(g_zfs, zoneroot_ds, in be_copy_zones()
2222 libzfs_error_description(g_zfs)); in be_copy_zones()
2223 ret = zfs_err_to_be_err(g_zfs); in be_copy_zones()
2268 if ((z_zhp = zfs_open(g_zfs, new_zoneroot_ds, in be_copy_zones()
2273 libzfs_error_description(g_zfs)); in be_copy_zones()
2274 ret = zfs_err_to_be_err(g_zfs); in be_copy_zones()
2283 ret = zfs_err_to_be_err(g_zfs); in be_copy_zones()
2291 ret = zfs_err_to_be_err(g_zfs); in be_copy_zones()
2370 zfs_get_name(zhp), libzfs_error_description(g_zfs)); in be_clone_fs_callback()
2371 ret = zfs_err_to_be_err(g_zfs); in be_clone_fs_callback()
2409 if ((zhp_ss = zfs_open(g_zfs, ss, ZFS_TYPE_SNAPSHOT)) == NULL) { in be_clone_fs_callback()
2412 libzfs_error_description(g_zfs)); in be_clone_fs_callback()
2413 ret = zfs_err_to_be_err(g_zfs); in be_clone_fs_callback()
2424 clone_ds, libzfs_error_description(g_zfs)); in be_clone_fs_callback()
2429 return (zfs_err_to_be_err(g_zfs)); in be_clone_fs_callback()
2448 if ((d_zhp = zfs_open(g_zfs, clone_ds, ZFS_TYPE_FILESYSTEM)) in be_clone_fs_callback()
2505 if (zfs_create(g_zfs, clone_ds, ZFS_TYPE_FILESYSTEM, bt->nbe_zfs_props) in be_send_fs_callback()
2509 clone_ds, libzfs_error_description(g_zfs)); in be_send_fs_callback()
2510 ret = zfs_err_to_be_err(g_zfs); in be_send_fs_callback()
2558 if (zfs_receive(g_zfs, clone_ds, NULL, &flags, srpipe[0], NULL) != 0) { in be_send_fs_callback()
2593 if ((d_zhp = zfs_open(g_zfs, clone_ds, ZFS_TYPE_FILESYSTEM)) in be_send_fs_callback()
2653 libzfs_error_description(g_zfs)); in be_destroy_callback()
2654 ret = zfs_err_to_be_err(g_zfs); in be_destroy_callback()
2663 libzfs_error_description(g_zfs)); in be_destroy_callback()
2664 ret = zfs_err_to_be_err(g_zfs); in be_destroy_callback()
2720 zfs_get_name(zhp), libzfs_error_description(g_zfs)); in be_demote_callback()
2721 ret = zfs_err_to_be_err(g_zfs); in be_demote_callback()
2731 libzfs_error_description(g_zfs)); in be_demote_callback()
2732 ret = zfs_err_to_be_err(g_zfs); in be_demote_callback()
2865 libzfs_error_description(g_zfs)); in be_demote_get_one_clone()
2875 if ((zpool_iter(g_zfs, be_check_be_roots_callback, ds_path)) in be_demote_get_one_clone()
2962 if (!zfs_dataset_exists(g_zfs, be_container_ds, ZFS_TYPE_FILESYSTEM)) { in be_create_container_ds()
2987 if (zfs_create(g_zfs, be_container_ds, ZFS_TYPE_FILESYSTEM, in be_create_container_ds()
2991 be_container_ds, libzfs_error_description(g_zfs)); in be_create_container_ds()
3068 zhp_name, libzfs_error_description(g_zfs)); in be_prep_clone_send_fs()
3069 return (zfs_err_to_be_err(g_zfs)); in be_prep_clone_send_fs()