Lines Matching refs:ldc
704 be_get_path(struct libbe_deep_clone *ldc, const char *dspath, char *result, int result_size) in be_get_path() argument
710 pos = strstr(dspath, ldc->lbh->root); in be_get_path()
717 snprintf(result, result_size, "%s/%s", ldc->lbh->root, ldc->bename); in be_get_path()
720 pos += strlen(ldc->lbh->root) + 1; in be_get_path()
738 struct libbe_deep_clone *ldc; in be_clone_cb() local
741 ldc = (struct libbe_deep_clone *)data; in be_clone_cb()
744 snprintf(snap_path, sizeof(snap_path), "%s@%s", dspath, ldc->snapname); in be_clone_cb()
747 if (be_get_path(ldc, dspath, be_path, sizeof(be_path)) != BE_ERR_SUCCESS) in be_clone_cb()
748 return (set_error(ldc->lbh, BE_ERR_UNKNOWN)); in be_clone_cb()
751 if (zfs_dataset_exists(ldc->lbh->lzh, be_path, ZFS_TYPE_DATASET)) in be_clone_cb()
752 return (set_error(ldc->lbh, BE_ERR_EXISTS)); in be_clone_cb()
755 if (!zfs_dataset_exists(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) in be_clone_cb()
759 zfs_open(ldc->lbh->lzh, snap_path, ZFS_TYPE_SNAPSHOT)) == NULL) in be_clone_cb()
760 return (set_error(ldc->lbh, BE_ERR_ZFSOPEN)); in be_clone_cb()
765 dccb.lbh = ldc->lbh; in be_clone_cb()
773 return (set_error(ldc->lbh, BE_ERR_ZFSCLONE)); in be_clone_cb()
778 if (ldc->depth_limit == -1 || ldc->depth < ldc->depth_limit) { in be_clone_cb()
779 ldc->depth++; in be_clone_cb()
780 err = zfs_iter_filesystems(ds, be_clone_cb, ldc); in be_clone_cb()
781 ldc->depth--; in be_clone_cb()
784 return (set_error(ldc->lbh, err)); in be_clone_cb()
800 struct libbe_deep_clone ldc; in be_clone() local
831 ldc.lbh = lbh; in be_clone()
832 ldc.bename = bename; in be_clone()
833 ldc.snapname = snapname; in be_clone()
834 ldc.depth = 0; in be_clone()
835 ldc.depth_limit = depth; in be_clone()
841 err = be_clone_cb(parent_hdl, &ldc); in be_clone()