aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-01-08 15:46:30 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:59 -0400
commit3063d29f2a4d4a4e9fa1ec77c124514f287c6da7 (patch)
tree61aa53d18c6684a327b6166764eecbea9d0e6b5b /fs/btrfs/transaction.h
parentdc17ff8f11d129db9e83ab7244769e4eae05e14d (diff)
Btrfs: Move snapshot creation to commit time
It is very difficult to create a consistent snapshot of the btree when other writers may update the btree before the commit is done. This changes the snapshot creation to happen during the commit, while no other updates are possible. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r--fs/btrfs/transaction.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index c157ddbe9d1e..fd52e9b23922 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -34,6 +34,7 @@ struct btrfs_transaction {
34 struct btrfs_ordered_inode_tree ordered_inode_tree; 34 struct btrfs_ordered_inode_tree ordered_inode_tree;
35 wait_queue_head_t writer_wait; 35 wait_queue_head_t writer_wait;
36 wait_queue_head_t commit_wait; 36 wait_queue_head_t commit_wait;
37 struct list_head pending_snapshots;
37}; 38};
38 39
39struct btrfs_trans_handle { 40struct btrfs_trans_handle {
@@ -46,6 +47,12 @@ struct btrfs_trans_handle {
46 u64 alloc_exclude_nr; 47 u64 alloc_exclude_nr;
47}; 48};
48 49
50struct btrfs_pending_snapshot {
51 struct btrfs_root *root;
52 char *name;
53 struct list_head list;
54};
55
49 56
50static inline void btrfs_set_trans_block_group(struct btrfs_trans_handle *trans, 57static inline void btrfs_set_trans_block_group(struct btrfs_trans_handle *trans,
51 struct inode *inode) 58 struct inode *inode)