summaryrefslogtreecommitdiffstats
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)
downloadlinux-3063d29f2a4d4a4e9fa1ec77c124514f287c6da7.tar.bz2
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 {
struct btrfs_ordered_inode_tree ordered_inode_tree;
wait_queue_head_t writer_wait;
wait_queue_head_t commit_wait;
+ struct list_head pending_snapshots;
};
struct btrfs_trans_handle {
@@ -46,6 +47,12 @@ struct btrfs_trans_handle {
u64 alloc_exclude_nr;
};
+struct btrfs_pending_snapshot {
+ struct btrfs_root *root;
+ char *name;
+ struct list_head list;
+};
+
static inline void btrfs_set_trans_block_group(struct btrfs_trans_handle *trans,
struct inode *inode)