1 #ifndef __TRANSACTION__
2 #define __TRANSACTION__
3 #include "btrfs_inode.h"
5 struct btrfs_transaction {
7 unsigned long num_writers;
12 struct list_head list;
13 struct radix_tree_root dirty_pages;
14 unsigned long start_time;
15 wait_queue_head_t writer_wait;
16 wait_queue_head_t commit_wait;
19 struct btrfs_trans_handle {
22 unsigned long blocks_reserved;
23 unsigned long blocks_used;
24 struct btrfs_transaction *transaction;
25 struct btrfs_block_group_cache *block_group;
30 static inline void btrfs_set_trans_block_group(struct btrfs_trans_handle *trans,
33 trans->block_group = BTRFS_I(inode)->block_group;
36 static inline void btrfs_update_inode_block_group(struct
37 btrfs_trans_handle *trans,
40 BTRFS_I(inode)->block_group = trans->block_group;
43 int btrfs_end_transaction(struct btrfs_trans_handle *trans,
44 struct btrfs_root *root);
45 struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
47 int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans,
48 struct btrfs_root *root);
49 int btrfs_commit_tree_roots(struct btrfs_trans_handle *trans,
50 struct btrfs_root *root);
52 void btrfs_transaction_cleaner(struct work_struct *work);
53 void btrfs_transaction_flush_work(struct btrfs_root *root);
54 void btrfs_transaction_queue_work(struct btrfs_root *root, int delay);
55 void btrfs_init_transaction_sys(void);
56 void btrfs_exit_transaction_sys(void);