ext4_filedev: fix travis build
[lwext4.git] / lwext4 / ext4_types.h
index 5b8441d1c74bfc1ff254d43ae6785d306f95a52c..3f5ad79822c94ef55b8cf2be9c7e15376f6f52c7 100644 (file)
@@ -48,7 +48,7 @@ extern "C" {
 
 #include "ext4_config.h"
 #include "ext4_blockdev.h"
-#include "tree.h"
+#include "misc/tree.h"
 
 #include <stddef.h>
 #include <stdint.h>
@@ -306,6 +306,10 @@ struct ext4_fs {
        uint64_t inode_blocks_per_level[4];
 
        uint32_t last_inode_bg_id;
+
+       struct jbd_fs *jbd_fs;
+       struct jbd_journal *jbd_journal;
+       struct jbd_trans *curr_trans;
 };
 
 /* Inode table/bitmap not in use */
@@ -1093,6 +1097,57 @@ struct jbd_fs {
        bool dirty;
 };
 
+struct jbd_buf {
+       struct ext4_block block;
+       struct jbd_trans *trans;
+       struct jbd_block_rec *block_rec;
+       LIST_ENTRY(jbd_buf) buf_node;
+};
+
+struct jbd_revoke_rec {
+       ext4_fsblk_t lba;
+       LIST_ENTRY(jbd_revoke_rec) revoke_node;
+};
+
+struct jbd_block_rec {
+       ext4_fsblk_t lba;
+       struct ext4_buf *buf;
+       struct jbd_trans *trans;
+       RB_ENTRY(jbd_block_rec) block_rec_node;
+};
+
+struct jbd_trans {
+       uint32_t trans_id;
+
+       uint32_t start_iblock;
+       int alloc_blocks;
+       int data_cnt;
+       int written_cnt;
+       int error;
+
+       struct jbd_journal *journal;
+
+       LIST_HEAD(jbd_trans_buf, jbd_buf) buf_list;
+       LIST_HEAD(jbd_revoke_list, jbd_revoke_rec) revoke_list;
+       TAILQ_ENTRY(jbd_trans) trans_node;
+};
+
+struct jbd_journal {
+       uint32_t first;
+       uint32_t start;
+       uint32_t last;
+       uint32_t trans_id;
+       uint32_t alloc_trans_id;
+
+       uint32_t block_size;
+
+       TAILQ_HEAD(jbd_trans_queue, jbd_trans) trans_queue;
+       TAILQ_HEAD(jbd_cp_queue, jbd_trans) cp_queue;
+       RB_HEAD(jbd_block, jbd_block_rec) block_rec_root;
+
+       struct jbd_fs *jbd_fs;
+};
+
 /*****************************************************************************/
 
 #define EXT4_CRC32_INIT (0xFFFFFFFFUL)