1eda14cbcSMatt Macy /* 2eda14cbcSMatt Macy * CDDL HEADER START 3eda14cbcSMatt Macy * 4eda14cbcSMatt Macy * The contents of this file are subject to the terms of the 5eda14cbcSMatt Macy * Common Development and Distribution License (the "License"). 6eda14cbcSMatt Macy * You may not use this file except in compliance with the License. 7eda14cbcSMatt Macy * 8eda14cbcSMatt Macy * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9271171e0SMartin Matuska * or https://opensource.org/licenses/CDDL-1.0. 10eda14cbcSMatt Macy * See the License for the specific language governing permissions 11eda14cbcSMatt Macy * and limitations under the License. 12eda14cbcSMatt Macy * 13eda14cbcSMatt Macy * When distributing Covered Code, include this CDDL HEADER in each 14eda14cbcSMatt Macy * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15eda14cbcSMatt Macy * If applicable, add the following below this CDDL HEADER, with the 16eda14cbcSMatt Macy * fields enclosed by brackets "[]" replaced with your own identifying 17eda14cbcSMatt Macy * information: Portions Copyright [yyyy] [name of copyright owner] 18eda14cbcSMatt Macy * 19eda14cbcSMatt Macy * CDDL HEADER END 20eda14cbcSMatt Macy */ 21eda14cbcSMatt Macy 22eda14cbcSMatt Macy /* 23eda14cbcSMatt Macy * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 24eda14cbcSMatt Macy * Copyright (c) 2012, 2020 by Delphix. All rights reserved. 25eda14cbcSMatt Macy * Copyright 2011 Nexenta Systems, Inc. All rights reserved. 26eda14cbcSMatt Macy * Copyright (c) 2013, Joyent, Inc. All rights reserved. 27271171e0SMartin Matuska * Copyright (c) 2019 Datto Inc. 28eda14cbcSMatt Macy */ 29eda14cbcSMatt Macy 30eda14cbcSMatt Macy #ifndef _DMU_RECV_H 31eda14cbcSMatt Macy #define _DMU_RECV_H 32eda14cbcSMatt Macy 33eda14cbcSMatt Macy #include <sys/inttypes.h> 34eda14cbcSMatt Macy #include <sys/dsl_bookmark.h> 35eda14cbcSMatt Macy #include <sys/dsl_dataset.h> 36eda14cbcSMatt Macy #include <sys/spa.h> 37eda14cbcSMatt Macy #include <sys/objlist.h> 38eda14cbcSMatt Macy 39e92ffd9bSMartin Matuska extern const char *const recv_clone_name; 40eda14cbcSMatt Macy 41eda14cbcSMatt Macy typedef struct dmu_recv_cookie { 42eda14cbcSMatt Macy struct dsl_dataset *drc_ds; 43eda14cbcSMatt Macy struct dmu_replay_record *drc_drr_begin; 44eda14cbcSMatt Macy struct drr_begin *drc_drrb; 45eda14cbcSMatt Macy const char *drc_tofs; 46eda14cbcSMatt Macy const char *drc_tosnap; 47eda14cbcSMatt Macy boolean_t drc_newfs; 48eda14cbcSMatt Macy boolean_t drc_byteswap; 49eda14cbcSMatt Macy uint64_t drc_featureflags; 50eda14cbcSMatt Macy boolean_t drc_force; 51271171e0SMartin Matuska boolean_t drc_heal; 52eda14cbcSMatt Macy boolean_t drc_resumable; 53eda14cbcSMatt Macy boolean_t drc_should_save; 54eda14cbcSMatt Macy boolean_t drc_raw; 55eda14cbcSMatt Macy boolean_t drc_clone; 56eda14cbcSMatt Macy boolean_t drc_spill; 57eda14cbcSMatt Macy nvlist_t *drc_keynvl; 58eda14cbcSMatt Macy uint64_t drc_fromsnapobj; 59eda14cbcSMatt Macy uint64_t drc_ivset_guid; 60eda14cbcSMatt Macy void *drc_owner; 61eda14cbcSMatt Macy cred_t *drc_cred; 62eda14cbcSMatt Macy proc_t *drc_proc; 63eda14cbcSMatt Macy nvlist_t *drc_begin_nvl; 64eda14cbcSMatt Macy 65eda14cbcSMatt Macy objset_t *drc_os; 66eda14cbcSMatt Macy zfs_file_t *drc_fp; /* The file to read the stream from */ 67eda14cbcSMatt Macy uint64_t drc_voff; /* The current offset in the stream */ 68eda14cbcSMatt Macy uint64_t drc_bytes_read; 69eda14cbcSMatt Macy /* 70eda14cbcSMatt Macy * A record that has had its payload read in, but hasn't yet been handed 71eda14cbcSMatt Macy * off to the worker thread. 72eda14cbcSMatt Macy */ 73eda14cbcSMatt Macy struct receive_record_arg *drc_rrd; 74eda14cbcSMatt Macy /* A record that has had its header read in, but not its payload. */ 75eda14cbcSMatt Macy struct receive_record_arg *drc_next_rrd; 76eda14cbcSMatt Macy zio_cksum_t drc_cksum; 77eda14cbcSMatt Macy zio_cksum_t drc_prev_cksum; 78eda14cbcSMatt Macy /* Sorted list of objects not to issue prefetches for. */ 79eda14cbcSMatt Macy objlist_t *drc_ignore_objlist; 80eda14cbcSMatt Macy } dmu_recv_cookie_t; 81eda14cbcSMatt Macy 82*2a58b312SMartin Matuska int dmu_recv_begin(const char *, const char *, dmu_replay_record_t *, 83*2a58b312SMartin Matuska boolean_t, boolean_t, boolean_t, nvlist_t *, nvlist_t *, const char *, 84eda14cbcSMatt Macy dmu_recv_cookie_t *, zfs_file_t *, offset_t *); 85eda14cbcSMatt Macy int dmu_recv_stream(dmu_recv_cookie_t *, offset_t *); 86eda14cbcSMatt Macy int dmu_recv_end(dmu_recv_cookie_t *, void *); 87eda14cbcSMatt Macy boolean_t dmu_objset_is_receiving(objset_t *); 88eda14cbcSMatt Macy 89eda14cbcSMatt Macy #endif /* _DMU_RECV_H */ 90