]> git.proxmox.com Git - mirror_zfs.git/blobdiff - include/sys/dmu_impl.h
Fix send/recv lost spill block
[mirror_zfs.git] / include / sys / dmu_impl.h
index 0b8748df10e30569ae72d044301172fceee44f0b..5e1901da4ac2f53302ec5b86d965813a735b710f 100644 (file)
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2013, 2015 by Delphix. All rights reserved.
+ */
 
 #ifndef _SYS_DMU_IMPL_H
 #define        _SYS_DMU_IMPL_H
@@ -30,6 +34,7 @@
 #include <sys/zio.h>
 #include <sys/dnode.h>
 #include <sys/zfs_context.h>
+#include <sys/zfs_ioctl.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -81,7 +86,6 @@ extern "C" {
  *   held from:
  *     callers of dbuf_read_impl, dbuf_hold[_impl], dbuf_prefetch
  *     dmu_object_info_from_dnode: dn_dirty_mtx (dn_datablksz)
- *     dmu_tx_count_free:
  *     dbuf_read_impl: db_mtx, dmu_zfetch()
  *     dmu_zfetch: zf_rwlock/r, zst_lock, dbuf_prefetch()
  *     dbuf_new_size: db_mtx
@@ -157,6 +161,7 @@ extern "C" {
  *     dn_allocated_txg
  *     dn_free_txg
  *     dn_assigned_txg
+ *     dn_dirty_txg
  *     dd_assigned_tx
  *     dn_notxholds
  *     dn_dirtyctx
@@ -192,7 +197,6 @@ extern "C" {
  *     dsl_prop_changed_notify: none (dd_prop_cbs)
  *     dsl_prop_register: none (dd_prop_cbs)
  *     dsl_prop_unregister: none (dd_prop_cbs)
- *     dsl_dataset_block_freeable: none (dd_sync_*)
  *
  * os_lock (leaf)
  *   protects:
@@ -239,6 +243,45 @@ typedef struct dmu_xuio {
        iovec_t *iovp;
 } dmu_xuio_t;
 
+/*
+ * The list of data whose inclusion in a send stream can be pending from
+ * one call to backup_cb to another.  Multiple calls to dump_free() and
+ * dump_freeobjects() can be aggregated into a single DRR_FREE or
+ * DRR_FREEOBJECTS replay record.
+ */
+typedef enum {
+       PENDING_NONE,
+       PENDING_FREE,
+       PENDING_FREEOBJECTS
+} dmu_pendop_t;
+
+typedef struct dmu_sendarg {
+       list_node_t dsa_link;
+       dmu_replay_record_t *dsa_drr;
+       vnode_t *dsa_vp;
+       int dsa_outfd;
+       proc_t *dsa_proc;
+       offset_t *dsa_off;
+       objset_t *dsa_os;
+       zio_cksum_t dsa_zc;
+       uint64_t dsa_toguid;
+       uint64_t dsa_fromtxg;
+       int dsa_err;
+       dmu_pendop_t dsa_pending_op;
+       uint64_t dsa_featureflags;
+       uint64_t dsa_last_data_object;
+       uint64_t dsa_last_data_offset;
+       uint64_t dsa_resume_object;
+       uint64_t dsa_resume_offset;
+       boolean_t dsa_sent_begin;
+       boolean_t dsa_sent_end;
+} dmu_sendarg_t;
+
+void dmu_object_zapify(objset_t *, uint64_t, dmu_object_type_t, dmu_tx_t *);
+void dmu_object_free_zapified(objset_t *, uint64_t, dmu_tx_t *);
+int dmu_buf_hold_noread(objset_t *, uint64_t, uint64_t,
+    void *, dmu_buf_t **);
+
 #ifdef __cplusplus
 }
 #endif