]>
Commit | Line | Data |
---|---|---|
03916905 PD |
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. | |
196bee4c | 24 | * Copyright (c) 2012, 2020 by Delphix. All rights reserved. |
03916905 PD |
25 | * Copyright 2011 Nexenta Systems, Inc. All rights reserved. |
26 | * Copyright (c) 2013, Joyent, Inc. All rights reserved. | |
27 | */ | |
28 | ||
29 | #ifndef _DMU_RECV_H | |
30 | #define _DMU_RECV_H | |
31 | ||
32 | #include <sys/inttypes.h> | |
33 | #include <sys/dsl_bookmark.h> | |
34 | #include <sys/dsl_dataset.h> | |
35 | #include <sys/spa.h> | |
30af21b0 | 36 | #include <sys/objlist.h> |
03916905 | 37 | |
18168da7 | 38 | extern const char *const recv_clone_name; |
03916905 PD |
39 | |
40 | typedef struct dmu_recv_cookie { | |
41 | struct dsl_dataset *drc_ds; | |
42 | struct dmu_replay_record *drc_drr_begin; | |
43 | struct drr_begin *drc_drrb; | |
44 | const char *drc_tofs; | |
45 | const char *drc_tosnap; | |
46 | boolean_t drc_newfs; | |
47 | boolean_t drc_byteswap; | |
30af21b0 | 48 | uint64_t drc_featureflags; |
03916905 PD |
49 | boolean_t drc_force; |
50 | boolean_t drc_resumable; | |
61152d10 | 51 | boolean_t drc_should_save; |
03916905 PD |
52 | boolean_t drc_raw; |
53 | boolean_t drc_clone; | |
caf9dd20 | 54 | boolean_t drc_spill; |
03916905 | 55 | nvlist_t *drc_keynvl; |
f00ab3f2 | 56 | uint64_t drc_fromsnapobj; |
f00ab3f2 | 57 | uint64_t drc_ivset_guid; |
03916905 PD |
58 | void *drc_owner; |
59 | cred_t *drc_cred; | |
e59a377a | 60 | proc_t *drc_proc; |
30af21b0 PD |
61 | nvlist_t *drc_begin_nvl; |
62 | ||
63 | objset_t *drc_os; | |
da92d5cb | 64 | zfs_file_t *drc_fp; /* The file to read the stream from */ |
30af21b0 PD |
65 | uint64_t drc_voff; /* The current offset in the stream */ |
66 | uint64_t drc_bytes_read; | |
67 | /* | |
68 | * A record that has had its payload read in, but hasn't yet been handed | |
69 | * off to the worker thread. | |
70 | */ | |
71 | struct receive_record_arg *drc_rrd; | |
72 | /* A record that has had its header read in, but not its payload. */ | |
73 | struct receive_record_arg *drc_next_rrd; | |
74 | zio_cksum_t drc_cksum; | |
75 | zio_cksum_t drc_prev_cksum; | |
30af21b0 PD |
76 | /* Sorted list of objects not to issue prefetches for. */ |
77 | objlist_t *drc_ignore_objlist; | |
03916905 PD |
78 | } dmu_recv_cookie_t; |
79 | ||
196bee4c MA |
80 | int dmu_recv_begin(char *, char *, dmu_replay_record_t *, |
81 | boolean_t, boolean_t, nvlist_t *, nvlist_t *, char *, | |
82 | dmu_recv_cookie_t *, zfs_file_t *, offset_t *); | |
83 | int dmu_recv_stream(dmu_recv_cookie_t *, offset_t *); | |
84 | int dmu_recv_end(dmu_recv_cookie_t *, void *); | |
85 | boolean_t dmu_objset_is_receiving(objset_t *); | |
03916905 PD |
86 | |
87 | #endif /* _DMU_RECV_H */ |