]> CyberLeo.Net >> Repos - FreeBSD/releng/10.3.git/blob - sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h
- Copy stable/10@296371 to releng/10.3 in preparation for 10.3-RC1
[FreeBSD/releng/10.3.git] / sys / cddl / contrib / opensolaris / uts / common / fs / zfs / sys / dmu_send.h
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21
22 /*
23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24  * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
25  * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
27  */
28
29 #ifndef _DMU_SEND_H
30 #define _DMU_SEND_H
31
32 #include <sys/spa.h>
33
34 struct vnode;
35 struct dsl_dataset;
36 struct drr_begin;
37 struct avl_tree;
38 struct dmu_replay_record;
39
40 extern const char *recv_clone_name;
41
42 int dmu_send(const char *tosnap, const char *fromsnap, boolean_t embedok,
43     boolean_t large_block_ok, int outfd, uint64_t resumeobj, uint64_t resumeoff,
44 #ifdef illumos
45     struct vnode *vp, offset_t *off);
46 #else
47     struct file *fp, offset_t *off);
48 #endif
49 int dmu_send_estimate(struct dsl_dataset *ds, struct dsl_dataset *fromds,
50     uint64_t *sizep);
51 int dmu_send_estimate_from_txg(struct dsl_dataset *ds, uint64_t fromtxg,
52     uint64_t *sizep);
53 int dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap,
54     boolean_t embedok, boolean_t large_block_ok,
55 #ifdef illumos
56     int outfd, struct vnode *vp, offset_t *off);
57 #else
58     int outfd, struct file *fp, offset_t *off);
59 #endif
60
61 typedef struct dmu_recv_cookie {
62         struct dsl_dataset *drc_ds;
63         struct dmu_replay_record *drc_drr_begin;
64         struct drr_begin *drc_drrb;
65         const char *drc_tofs;
66         const char *drc_tosnap;
67         boolean_t drc_newfs;
68         boolean_t drc_byteswap;
69         boolean_t drc_force;
70         boolean_t drc_resumable;
71         struct avl_tree *drc_guid_to_ds_map;
72         zio_cksum_t drc_cksum;
73         uint64_t drc_newsnapobj;
74         void *drc_owner;
75         cred_t *drc_cred;
76 } dmu_recv_cookie_t;
77
78 int dmu_recv_begin(char *tofs, char *tosnap,
79     struct dmu_replay_record *drr_begin,
80     boolean_t force, boolean_t resumable, char *origin, dmu_recv_cookie_t *drc);
81 #ifdef illumos
82 int dmu_recv_stream(dmu_recv_cookie_t *drc, struct vnode *vp, offset_t *voffp,
83 #else
84 int dmu_recv_stream(dmu_recv_cookie_t *drc, struct file *fp, offset_t *voffp,
85 #endif
86     int cleanup_fd, uint64_t *action_handlep);
87 int dmu_recv_end(dmu_recv_cookie_t *drc, void *owner);
88 boolean_t dmu_objset_is_receiving(objset_t *os);
89
90 #endif /* _DMU_SEND_H */