]> git.proxmox.com Git - mirror_zfs.git/blobdiff - include/sys/txg.h
ztest: scrub ddt repair
[mirror_zfs.git] / include / sys / txg.h
index 1bb6bac917e43e34fcaf0b8160b0b1b04aa29047..ed0e7297c2415f18c73a2852dee56f5487c2e65a 100644 (file)
@@ -23,7 +23,7 @@
  * Use is subject to license terms.
  */
 /*
- * Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
  */
 
 #ifndef _SYS_TXG_H
@@ -60,6 +60,7 @@ typedef struct txg_node {
 typedef struct txg_list {
        kmutex_t        tl_lock;
        size_t          tl_offset;
+       spa_t           *tl_spa;
        txg_node_t      *tl_head[TXG_SIZE];
 } txg_list_t;
 
@@ -103,6 +104,8 @@ extern boolean_t txg_stalled(struct dsl_pool *dp);
 /* returns TRUE if someone is waiting for the next txg to sync */
 extern boolean_t txg_sync_waiting(struct dsl_pool *dp);
 
+extern void txg_verify(spa_t *spa, uint64_t txg);
+
 /*
  * Wait for pending commit callbacks of already-synced transactions to finish
  * processing.
@@ -115,9 +118,10 @@ extern void txg_wait_callbacks(struct dsl_pool *dp);
 
 #define        TXG_CLEAN(txg)  ((txg) - 1)
 
-extern void txg_list_create(txg_list_t *tl, size_t offset);
+extern void txg_list_create(txg_list_t *tl, spa_t *spa, size_t offset);
 extern void txg_list_destroy(txg_list_t *tl);
 extern boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg);
+extern boolean_t txg_all_lists_empty(txg_list_t *tl);
 extern boolean_t txg_list_add(txg_list_t *tl, void *p, uint64_t txg);
 extern boolean_t txg_list_add_tail(txg_list_t *tl, void *p, uint64_t txg);
 extern void *txg_list_remove(txg_list_t *tl, uint64_t txg);
@@ -129,6 +133,13 @@ extern void *txg_list_next(txg_list_t *tl, void *p, uint64_t txg);
 /* Global tuning */
 extern int zfs_txg_timeout;
 
+
+#ifdef ZFS_DEBUG
+#define        TXG_VERIFY(spa, txg)            txg_verify(spa, txg)
+#else
+#define        TXG_VERIFY(spa, txg)
+#endif
+
 #ifdef __cplusplus
 }
 #endif