]> Pileus Git - ~andy/linux/blob - fs/btrfs/transaction.h
Btrfs: smarter transaction writeback
[~andy/linux] / 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         int magic;
11         struct list_head list;
12         struct radix_tree_root dirty_pages;
13         wait_queue_head_t writer_wait;
14         wait_queue_head_t commit_wait;
15 };
16
17 struct btrfs_trans_handle {
18         int magic;
19         u64 transid;
20         unsigned long blocks_reserved;
21         unsigned long blocks_used;
22         struct btrfs_transaction *transaction;
23         int magic2;
24 };
25
26
27 int btrfs_end_transaction(struct btrfs_trans_handle *trans,
28                           struct btrfs_root *root);
29 struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
30                                                    int num_blocks);
31 int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans,
32                                      struct btrfs_root *root);
33 int btrfs_commit_tree_roots(struct btrfs_trans_handle *trans,
34                             struct btrfs_root *root);
35 #endif