]> git.proxmox.com Git - mirror_zfs.git/blame - include/sys/dmu_send.h
Raw receive should change key atomically
[mirror_zfs.git] / include / sys / dmu_send.h
CommitLineData
13fe0198
MA
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.
5dc8b736 24 * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
13fe0198 25 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
788eb90c 26 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
13fe0198
MA
27 */
28
29#ifndef _DMU_SEND_H
30#define _DMU_SEND_H
31
32#include <sys/inttypes.h>
33#include <sys/spa.h>
34
35struct vnode;
36struct dsl_dataset;
37struct drr_begin;
38struct avl_tree;
47dfff3b 39struct dmu_replay_record;
13fe0198 40
47dfff3b
MA
41extern const char *recv_clone_name;
42
43int dmu_send(const char *tosnap, const char *fromsnap, boolean_t embedok,
b5256303 44 boolean_t large_block_ok, boolean_t compressok, boolean_t rawok, int outfd,
2aa34383 45 uint64_t resumeobj, uint64_t resumeoff, struct vnode *vp, offset_t *off);
13fe0198 46int dmu_send_estimate(struct dsl_dataset *ds, struct dsl_dataset *fromds,
2aa34383 47 boolean_t stream_compressed, uint64_t *sizep);
5dc8b736 48int dmu_send_estimate_from_txg(struct dsl_dataset *ds, uint64_t fromtxg,
2aa34383 49 boolean_t stream_compressed, uint64_t *sizep);
13fe0198 50int dmu_send_obj(const char *pool, uint64_t tosnap, uint64_t fromsnap,
2aa34383 51 boolean_t embedok, boolean_t large_block_ok, boolean_t compressok,
b5256303 52 boolean_t rawok, int outfd, struct vnode *vp, offset_t *off);
13fe0198
MA
53
54typedef struct dmu_recv_cookie {
55 struct dsl_dataset *drc_ds;
47dfff3b 56 struct dmu_replay_record *drc_drr_begin;
13fe0198
MA
57 struct drr_begin *drc_drrb;
58 const char *drc_tofs;
59 const char *drc_tosnap;
60 boolean_t drc_newfs;
61 boolean_t drc_byteswap;
62 boolean_t drc_force;
47dfff3b 63 boolean_t drc_resumable;
b5256303 64 boolean_t drc_raw;
48fbb9dd 65 boolean_t drc_clone;
13fe0198 66 struct avl_tree *drc_guid_to_ds_map;
b0918402 67 nvlist_t *drc_keynvl;
13fe0198
MA
68 zio_cksum_t drc_cksum;
69 uint64_t drc_newsnapobj;
831baf06 70 void *drc_owner;
788eb90c 71 cred_t *drc_cred;
13fe0198
MA
72} dmu_recv_cookie_t;
73
47dfff3b
MA
74int dmu_recv_begin(char *tofs, char *tosnap,
75 struct dmu_replay_record *drr_begin,
76 boolean_t force, boolean_t resumable, char *origin, dmu_recv_cookie_t *drc);
13fe0198
MA
77int dmu_recv_stream(dmu_recv_cookie_t *drc, struct vnode *vp, offset_t *voffp,
78 int cleanup_fd, uint64_t *action_handlep);
831baf06 79int dmu_recv_end(dmu_recv_cookie_t *drc, void *owner);
ea97f8ce 80boolean_t dmu_objset_is_receiving(objset_t *os);
13fe0198
MA
81
82#endif /* _DMU_SEND_H */