]> git.proxmox.com Git - mirror_zfs.git/blobdiff - include/sys/dmu_tx.h
OpenZFS 8997 - ztest assertion failure in zil_lwb_write_issue
[mirror_zfs.git] / include / sys / dmu_tx.h
index 59a1474020e23354f60a3e982e2ef2e7a358775c..74b7e1116382696c6582a83302667eba6718bd09 100644 (file)
@@ -23,7 +23,7 @@
  * Use is subject to license terms.
  */
 /*
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
  */
 
 #ifndef        _SYS_DMU_TX_H
@@ -67,8 +67,8 @@ struct dmu_tx {
        /* placeholder for syncing context, doesn't need specific holds */
        boolean_t tx_anyobj;
 
-       /* has this transaction already been delayed? */
-       boolean_t tx_waited;
+       /* transaction is marked as being a "net free" of space */
+       boolean_t tx_netfree;
 
        /* time this transaction was created */
        hrtime_t tx_start;
@@ -76,15 +76,10 @@ struct dmu_tx {
        /* need to wait for sufficient dirty space */
        boolean_t tx_wait_dirty;
 
+       /* has this transaction already been delayed? */
+       boolean_t tx_dirty_delayed;
+
        int tx_err;
-#ifdef DEBUG_DMU_TX
-       uint64_t tx_space_towrite;
-       uint64_t tx_space_tofree;
-       uint64_t tx_space_tooverwrite;
-       uint64_t tx_space_tounref;
-       refcount_t tx_space_written;
-       refcount_t tx_space_freed;
-#endif
 };
 
 enum dmu_tx_hold_type {
@@ -102,17 +97,11 @@ typedef struct dmu_tx_hold {
        dmu_tx_t *txh_tx;
        list_node_t txh_node;
        struct dnode *txh_dnode;
-       uint64_t txh_space_towrite;
-       uint64_t txh_space_tofree;
-       uint64_t txh_space_tooverwrite;
-       uint64_t txh_space_tounref;
-       uint64_t txh_memory_tohold;
-       uint64_t txh_fudge;
-#ifdef DEBUG_DMU_TX
+       refcount_t txh_space_towrite;
+       refcount_t txh_memory_tohold;
        enum dmu_tx_hold_type txh_type;
        uint64_t txh_arg1;
        uint64_t txh_arg2;
-#endif
 } dmu_tx_hold_t;
 
 typedef struct dmu_tx_callback {
@@ -130,10 +119,8 @@ typedef struct dmu_tx_stats {
        kstat_named_t dmu_tx_error;
        kstat_named_t dmu_tx_suspended;
        kstat_named_t dmu_tx_group;
-       kstat_named_t dmu_tx_how;
        kstat_named_t dmu_tx_memory_reserve;
        kstat_named_t dmu_tx_memory_reclaim;
-       kstat_named_t dmu_tx_memory_inflight;
        kstat_named_t dmu_tx_dirty_throttle;
        kstat_named_t dmu_tx_dirty_delay;
        kstat_named_t dmu_tx_dirty_over_max;
@@ -151,17 +138,13 @@ extern dmu_tx_stats_t dmu_tx_stats;
  * These routines are defined in dmu.h, and are called by the user.
  */
 dmu_tx_t *dmu_tx_create(objset_t *dd);
-int dmu_tx_assign(dmu_tx_t *tx, txg_how_t txg_how);
+int dmu_tx_assign(dmu_tx_t *tx, uint64_t txg_how);
 void dmu_tx_commit(dmu_tx_t *tx);
 void dmu_tx_abort(dmu_tx_t *tx);
 uint64_t dmu_tx_get_txg(dmu_tx_t *tx);
 struct dsl_pool *dmu_tx_pool(dmu_tx_t *tx);
 void dmu_tx_wait(dmu_tx_t *tx);
 
-void dmu_tx_callback_register(dmu_tx_t *tx, dmu_tx_callback_func_t *dcb_func,
-    void *dcb_data);
-void dmu_tx_do_callbacks(list_t *cb_list, int error);
-
 /*
  * These routines are defined in dmu_spa.h, and are called by the SPA.
  */
@@ -173,13 +156,11 @@ extern dmu_tx_t *dmu_tx_create_assigned(struct dsl_pool *dp, uint64_t txg);
 dmu_tx_t *dmu_tx_create_dd(dsl_dir_t *dd);
 int dmu_tx_is_syncing(dmu_tx_t *tx);
 int dmu_tx_private_ok(dmu_tx_t *tx);
-void dmu_tx_add_new_object(dmu_tx_t *tx, objset_t *os, uint64_t object);
-void dmu_tx_willuse_space(dmu_tx_t *tx, int64_t delta);
+void dmu_tx_add_new_object(dmu_tx_t *tx, dnode_t *dn);
 void dmu_tx_dirty_buf(dmu_tx_t *tx, struct dmu_buf_impl *db);
-int dmu_tx_holds(dmu_tx_t *tx, uint64_t object);
 void dmu_tx_hold_space(dmu_tx_t *tx, uint64_t space);
 
-#ifdef DEBUG_DMU_TX
+#ifdef ZFS_DEBUG
 #define        DMU_TX_DIRTY_BUF(tx, db)        dmu_tx_dirty_buf(tx, db)
 #else
 #define        DMU_TX_DIRTY_BUF(tx, db)