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.
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.
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]
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2012, 2020 by Delphix. All rights reserved.
25 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
32 #include <sys/inttypes.h>
33 #include <sys/dsl_bookmark.h>
34 #include <sys/dsl_dataset.h>
36 #include <sys/objlist.h>
37 #include <sys/dsl_bookmark.h>
39 extern const char *recv_clone_name;
41 typedef struct dmu_recv_cookie {
42 struct dsl_dataset *drc_ds;
43 struct dmu_replay_record *drc_drr_begin;
44 struct drr_begin *drc_drrb;
46 const char *drc_tosnap;
48 boolean_t drc_byteswap;
49 uint64_t drc_featureflags;
51 boolean_t drc_resumable;
52 boolean_t drc_should_save;
57 uint64_t drc_fromsnapobj;
58 uint64_t drc_ivset_guid;
62 nvlist_t *drc_begin_nvl;
65 zfs_file_t *drc_fp; /* The file to read the stream from */
66 uint64_t drc_voff; /* The current offset in the stream */
67 uint64_t drc_bytes_read;
69 * A record that has had its payload read in, but hasn't yet been handed
70 * off to the worker thread.
72 struct receive_record_arg *drc_rrd;
73 /* A record that has had its header read in, but not its payload. */
74 struct receive_record_arg *drc_next_rrd;
75 zio_cksum_t drc_cksum;
76 zio_cksum_t drc_prev_cksum;
77 /* Sorted list of objects not to issue prefetches for. */
78 objlist_t *drc_ignore_objlist;
81 int dmu_recv_begin(char *, char *, dmu_replay_record_t *,
82 boolean_t, boolean_t, nvlist_t *, nvlist_t *, char *,
83 dmu_recv_cookie_t *, zfs_file_t *, offset_t *);
84 int dmu_recv_stream(dmu_recv_cookie_t *, offset_t *);
85 int dmu_recv_end(dmu_recv_cookie_t *, void *);
86 boolean_t dmu_objset_is_receiving(objset_t *);
88 #endif /* _DMU_RECV_H */