Fix spl version check
[zfs.git] / module / zfs / include / sys / zil_impl.h
index 6560a79..1d4c0cc 100644 (file)
@@ -50,6 +50,28 @@ typedef struct lwb {
 } lwb_t;
 
 /*
+ * Intent log transaction lists
+ */
+typedef struct itxs {
+       list_t          i_sync_list;    /* list of synchronous itxs */
+       avl_tree_t      i_async_tree;   /* tree of foids for async itxs */
+} itxs_t;
+
+typedef struct itxg {
+       kmutex_t        itxg_lock;      /* lock for this structure */
+       uint64_t        itxg_txg;       /* txg for this chain */
+       uint64_t        itxg_sod;       /* total size on disk for this txg */
+       itxs_t          *itxg_itxs;     /* sync and async itxs */
+} itxg_t;
+
+/* for async nodes we build up an AVL tree of lists of async itxs per file */
+typedef struct itx_async_node {
+       uint64_t        ia_foid;        /* file object id */
+       list_t          ia_list;        /* list of async itxs for this foid */
+       avl_node_t      ia_node;        /* AVL tree linkage */
+} itx_async_node_t;
+
+/*
  * Vdev flushing: during a zil_commit(), we build up an AVL tree of the vdevs
  * we've touched so we know which ones need a write cache flush at the end.
  */
@@ -71,9 +93,7 @@ struct zilog {
        objset_t        *zl_os;         /* object set we're logging */
        zil_get_data_t  *zl_get_data;   /* callback to get object content */
        zio_t           *zl_root_zio;   /* log writer root zio */
-       uint64_t        zl_itx_seq;     /* next in-core itx sequence number */
        uint64_t        zl_lr_seq;      /* on-disk log record sequence number */
-       uint64_t        zl_commit_seq;  /* committed upto this number */
        uint64_t        zl_commit_lr_seq; /* last committed on-disk lr seq */
        uint64_t        zl_destroy_txg; /* txg of last zil_destroy() */
        uint64_t        zl_replayed_seq[TXG_SIZE]; /* last replayed rec seq */
@@ -93,10 +113,13 @@ struct zilog {
        uint64_t        zl_parse_lr_seq; /* highest lr seq on last parse */
        uint64_t        zl_parse_blk_count; /* number of blocks parsed */
        uint64_t        zl_parse_lr_count; /* number of log records parsed */
-       list_t          zl_itx_list;    /* in-memory itx list */
+       uint64_t        zl_next_batch;  /* next batch number */
+       uint64_t        zl_com_batch;   /* committed batch number */
+       kcondvar_t      zl_cv_batch[2]; /* batch condition variables */
+       itxg_t          zl_itxg[TXG_SIZE]; /* intent log txg chains */
+       list_t          zl_itx_commit_list; /* itx list to be committed */
        uint64_t        zl_itx_list_sz; /* total size of records on list */
        uint64_t        zl_cur_used;    /* current commit log size used */
-       uint64_t        zl_prev_used;   /* previous commit log size used */
        list_t          zl_lwb_list;    /* in-flight log write list */
        kmutex_t        zl_vdev_lock;   /* protects zl_vdev_tree */
        avl_tree_t      zl_vdev_tree;   /* vdevs to flush in zil_commit() */