#include "ext4_config.h"
#include "ext4_blockdev.h"
-#include "tree.h"
+#include "misc/tree.h"
#include <stddef.h>
#include <stdint.h>
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 */
struct jbd_buf {
struct ext4_block block;
struct jbd_trans *trans;
+ struct jbd_block_rec *block_rec;
LIST_ENTRY(jbd_buf) buf_node;
};
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;
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;
};