Btrfs: transaction rework
[cascardo/linux.git] / fs / btrfs / transaction.h
1 #ifndef __TRANSACTION__
2 #define __TRANSACTION__
3
4 struct btrfs_transaction {
5         u64 transid;
6         unsigned long num_writers;
7         int in_commit;
8         int use_count;
9         int commit_done;
10         wait_queue_head_t writer_wait;
11         wait_queue_head_t commit_wait;
12 };
13
14 struct btrfs_trans_handle {
15         u64 transid;
16         unsigned long blocks_reserved;
17         unsigned long blocks_used;
18         struct btrfs_transaction *transaction;
19 };
20
21
22 int btrfs_end_transaction(struct btrfs_trans_handle *trans,
23                           struct btrfs_root *root);
24 struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
25                                                    int num_blocks);
26 int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans,
27                                      struct btrfs_root *root);
28 int btrfs_commit_tree_roots(struct btrfs_trans_handle *trans,
29                             struct btrfs_root *root);
30 #endif