Lines Matching refs:hdl

209 add_config(libzfs_handle_t *hdl, pool_list_t *pl, const char *path,
227 if ((ne = zfs_alloc(hdl, sizeof (name_entry_t))) == NULL)
230 if ((ne->ne_name = zfs_strdup(hdl, path)) == NULL) {
270 if ((pe = zfs_alloc(hdl, sizeof (pool_entry_t))) == NULL) {
289 if ((ve = zfs_alloc(hdl, sizeof (vdev_entry_t))) == NULL) {
309 if ((ce = zfs_alloc(hdl, sizeof (config_entry_t))) == NULL) {
327 if ((ne = zfs_alloc(hdl, sizeof (name_entry_t))) == NULL)
330 if ((ne->ne_name = zfs_strdup(hdl, path)) == NULL) {
346 pool_active(libzfs_handle_t *hdl, const char *name, uint64_t guid,
352 if (zpool_open_silent(hdl, name, &zhp) != 0)
370 refresh_config(libzfs_handle_t *hdl, nvlist_t *config)
376 if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0)
379 if (zcmd_alloc_dst_nvlist(hdl, &zc,
385 while ((err = ioctl(hdl->libzfs_fd, ZFS_IOC_POOL_TRYIMPORT,
387 if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) {
398 if (zcmd_read_dst_nvlist(hdl, &zc, &nvl) != 0) {
430 get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok)
585 newchild = zfs_alloc(hdl, (id + 1) *
617 newchild = zfs_alloc(hdl, (max_id) *
753 if (pool_active(hdl, name, guid, &isactive) != 0)
762 if ((nvl = refresh_config(hdl, config)) == NULL) {
832 (void) no_memory(hdl);
1133 zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg)
1169 (void) zfs_error_fmt(hdl, EZFS_BADPATH,
1190 zfs_error_aux(hdl, strerror(errno));
1191 (void) zfs_error_fmt(hdl, EZFS_BADPATH,
1208 zfs_error_aux(hdl, strerror(errno));
1209 (void) zfs_error_fmt(hdl, EZFS_BADPATH,
1217 slice = zfs_alloc(hdl, sizeof (rdsk_node_t));
1218 slice->rn_name = zfs_strdup(hdl, pp->lg_name);
1221 slice->rn_hdl = hdl;
1241 slice = zfs_alloc(hdl, sizeof (rdsk_node_t));
1242 slice->rn_name = zfs_strdup(hdl, name);
1245 slice->rn_hdl = hdl;
1297 if (add_config(hdl, &pools, path, config) != 0)
1309 ret = get_configs(hdl, &pools, iarg->can_be_active);
1341 zpool_find_import(libzfs_handle_t *hdl, int argc, char **argv)
1348 return (zpool_find_import_impl(hdl, &iarg));
1357 zpool_find_import_cached(libzfs_handle_t *hdl, const char *cachefile,
1373 zfs_error_aux(hdl, "%s", strerror(errno));
1374 (void) zfs_error(hdl, EZFS_BADCACHE,
1380 zfs_error_aux(hdl, "%s", strerror(errno));
1382 (void) zfs_error(hdl, EZFS_BADCACHE,
1387 if ((buf = zfs_alloc(hdl, statbuf.st_size)) == NULL) {
1395 (void) zfs_error(hdl, EZFS_BADCACHE,
1405 (void) zfs_error(hdl, EZFS_BADCACHE,
1418 (void) no_memory(hdl);
1441 if (pool_active(hdl, name, this_guid, &active) != 0) {
1450 if ((dst = refresh_config(hdl, src)) == NULL) {
1457 (void) no_memory(hdl);
1497 zpool_search_import(libzfs_handle_t *hdl, importargs_t *import)
1502 import->exists = zpool_iter(hdl, name_or_guid_exists, import);
1505 return (zpool_find_import_cached(hdl, import->cachefile,
1508 return (zpool_find_import_impl(hdl, import));
1572 zpool_in_use(libzfs_handle_t *hdl, int fd, pool_state_t *state, char **namestr,
1588 (void) no_memory(hdl);
1615 if (pool_active(hdl, name, guid, &isactive) == 0 && isactive &&
1616 (zhp = zpool_open_canfail(hdl, name)) != NULL) {
1638 if (pool_active(hdl, name, guid, &isactive) != 0) {
1650 if ((zhp = zpool_open_canfail(hdl, name)) != NULL &&
1698 if (zpool_iter(hdl, find_aux, &cb) == 1) {
1714 if (zpool_iter(hdl, find_aux, &cb) == 1) {
1728 if ((*namestr = zfs_strdup(hdl, name)) == NULL) {