10fa1b3ccSPaul Dagnelie /* 20fa1b3ccSPaul Dagnelie * CDDL HEADER START 30fa1b3ccSPaul Dagnelie * 40fa1b3ccSPaul Dagnelie * The contents of this file are subject to the terms of the 50fa1b3ccSPaul Dagnelie * Common Development and Distribution License (the "License"). 60fa1b3ccSPaul Dagnelie * You may not use this file except in compliance with the License. 70fa1b3ccSPaul Dagnelie * 80fa1b3ccSPaul Dagnelie * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90fa1b3ccSPaul Dagnelie * or http://www.opensolaris.org/os/licensing. 100fa1b3ccSPaul Dagnelie * See the License for the specific language governing permissions 110fa1b3ccSPaul Dagnelie * and limitations under the License. 120fa1b3ccSPaul Dagnelie * 130fa1b3ccSPaul Dagnelie * When distributing Covered Code, include this CDDL HEADER in each 140fa1b3ccSPaul Dagnelie * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150fa1b3ccSPaul Dagnelie * If applicable, add the following below this CDDL HEADER, with the 160fa1b3ccSPaul Dagnelie * fields enclosed by brackets "[]" replaced with your own identifying 170fa1b3ccSPaul Dagnelie * information: Portions Copyright [yyyy] [name of copyright owner] 180fa1b3ccSPaul Dagnelie * 190fa1b3ccSPaul Dagnelie * CDDL HEADER END 200fa1b3ccSPaul Dagnelie */ 210fa1b3ccSPaul Dagnelie 220fa1b3ccSPaul Dagnelie /* 230fa1b3ccSPaul Dagnelie * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 240fa1b3ccSPaul Dagnelie * Copyright (c) 2012, 2014 by Delphix. All rights reserved. 250fa1b3ccSPaul Dagnelie * Copyright 2011 Nexenta Systems, Inc. All rights reserved. 260fa1b3ccSPaul Dagnelie * Copyright (c) 2013, Joyent, Inc. All rights reserved. 270fa1b3ccSPaul Dagnelie * Copyright (c) 2014 Integros [integros.com] 280fa1b3ccSPaul Dagnelie */ 290fa1b3ccSPaul Dagnelie 300fa1b3ccSPaul Dagnelie #ifndef _DMU_RECV_H 310fa1b3ccSPaul Dagnelie #define _DMU_RECV_H 320fa1b3ccSPaul Dagnelie 330fa1b3ccSPaul Dagnelie #include <sys/inttypes.h> 34*6ccda740Sloli #include <sys/dsl_crypt.h> 350fa1b3ccSPaul Dagnelie #include <sys/spa.h> 360fa1b3ccSPaul Dagnelie 370fa1b3ccSPaul Dagnelie extern const char *recv_clone_name; 380fa1b3ccSPaul Dagnelie 390fa1b3ccSPaul Dagnelie typedef struct dmu_recv_cookie { 400fa1b3ccSPaul Dagnelie struct dsl_dataset *drc_ds; 410fa1b3ccSPaul Dagnelie struct dmu_replay_record *drc_drr_begin; 420fa1b3ccSPaul Dagnelie struct drr_begin *drc_drrb; 430fa1b3ccSPaul Dagnelie const char *drc_tofs; 440fa1b3ccSPaul Dagnelie const char *drc_tosnap; 450fa1b3ccSPaul Dagnelie boolean_t drc_newfs; 460fa1b3ccSPaul Dagnelie boolean_t drc_byteswap; 470fa1b3ccSPaul Dagnelie boolean_t drc_force; 480fa1b3ccSPaul Dagnelie boolean_t drc_resumable; 49eb633035STom Caputi boolean_t drc_raw; 500fa1b3ccSPaul Dagnelie boolean_t drc_clone; 51eb633035STom Caputi boolean_t drc_spill; 520fa1b3ccSPaul Dagnelie struct avl_tree *drc_guid_to_ds_map; 53eb633035STom Caputi nvlist_t *drc_keynvl; 540fa1b3ccSPaul Dagnelie zio_cksum_t drc_cksum; 55eb633035STom Caputi uint64_t drc_fromsnapobj; 560fa1b3ccSPaul Dagnelie uint64_t drc_newsnapobj; 57eb633035STom Caputi uint64_t drc_ivset_guid; 580fa1b3ccSPaul Dagnelie void *drc_owner; 590fa1b3ccSPaul Dagnelie cred_t *drc_cred; 600fa1b3ccSPaul Dagnelie } dmu_recv_cookie_t; 610fa1b3ccSPaul Dagnelie 620fa1b3ccSPaul Dagnelie int dmu_recv_begin(char *tofs, char *tosnap, 63*6ccda740Sloli struct dmu_replay_record *drr_begin, boolean_t force, boolean_t resumable, 64*6ccda740Sloli nvlist_t *localprops, nvlist_t *hidden_args, char *origin, 65*6ccda740Sloli dmu_recv_cookie_t *drc); 660fa1b3ccSPaul Dagnelie int dmu_recv_stream(dmu_recv_cookie_t *drc, struct vnode *vp, offset_t *voffp, 670fa1b3ccSPaul Dagnelie int cleanup_fd, uint64_t *action_handlep); 680fa1b3ccSPaul Dagnelie int dmu_recv_end(dmu_recv_cookie_t *drc, void *owner); 690fa1b3ccSPaul Dagnelie boolean_t dmu_objset_is_receiving(objset_t *os); 700fa1b3ccSPaul Dagnelie 710fa1b3ccSPaul Dagnelie #endif /* _DMU_RECV_H */ 72