aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r--fs/btrfs/transaction.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index 0fc45e2a5139..66d2a6ccbf05 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -22,6 +22,16 @@
22#include "delayed-ref.h" 22#include "delayed-ref.h"
23#include "ctree.h" 23#include "ctree.h"
24 24
25enum btrfs_trans_state {
26 TRANS_STATE_RUNNING = 0,
27 TRANS_STATE_BLOCKED = 1,
28 TRANS_STATE_COMMIT_START = 2,
29 TRANS_STATE_COMMIT_DOING = 3,
30 TRANS_STATE_UNBLOCKED = 4,
31 TRANS_STATE_COMPLETED = 5,
32 TRANS_STATE_MAX = 6,
33};
34
25struct btrfs_transaction { 35struct btrfs_transaction {
26 u64 transid; 36 u64 transid;
27 /* 37 /*
@@ -37,10 +47,8 @@ struct btrfs_transaction {
37 atomic_t num_writers; 47 atomic_t num_writers;
38 atomic_t use_count; 48 atomic_t use_count;
39 49
40 spinlock_t commit_lock; 50 /* Be protected by fs_info->trans_lock when we want to change it. */
41 int in_commit; 51 enum btrfs_trans_state state;
42 int commit_done;
43 int blocked;
44 struct list_head list; 52 struct list_head list;
45 struct extent_io_tree dirty_pages; 53 struct extent_io_tree dirty_pages;
46 unsigned long start_time; 54 unsigned long start_time;