diff options
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 2b0f98c92123..20d84bd03223 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -52,6 +52,8 @@ struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root, | |||
52 | kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS); | 52 | kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS); |
53 | int ret; | 53 | int ret; |
54 | 54 | ||
55 | /* FIXME, use the right root */ | ||
56 | root = root->fs_info->fs_root; | ||
55 | mutex_lock(&root->fs_info->trans_mutex); | 57 | mutex_lock(&root->fs_info->trans_mutex); |
56 | ret = join_transaction(root); | 58 | ret = join_transaction(root); |
57 | BUG_ON(ret); | 59 | BUG_ON(ret); |
@@ -69,6 +71,10 @@ int btrfs_end_transaction(struct btrfs_trans_handle *trans, | |||
69 | struct btrfs_root *root) | 71 | struct btrfs_root *root) |
70 | { | 72 | { |
71 | struct btrfs_transaction *cur_trans; | 73 | struct btrfs_transaction *cur_trans; |
74 | |||
75 | /* FIXME, use the right root */ | ||
76 | root = root->fs_info->fs_root; | ||
77 | |||
72 | WARN_ON(trans->magic != TRANS_MAGIC); | 78 | WARN_ON(trans->magic != TRANS_MAGIC); |
73 | WARN_ON(trans->magic2 != TRANS_MAGIC); | 79 | WARN_ON(trans->magic2 != TRANS_MAGIC); |
74 | mutex_lock(&root->fs_info->trans_mutex); | 80 | mutex_lock(&root->fs_info->trans_mutex); |
@@ -148,6 +154,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | |||
148 | struct btrfs_transaction *cur_trans; | 154 | struct btrfs_transaction *cur_trans; |
149 | DEFINE_WAIT(wait); | 155 | DEFINE_WAIT(wait); |
150 | 156 | ||
157 | /* FIXME, use the right root */ | ||
158 | root = root->fs_info->fs_root; | ||
159 | |||
151 | mutex_lock(&root->fs_info->trans_mutex); | 160 | mutex_lock(&root->fs_info->trans_mutex); |
152 | if (trans->transaction->in_commit) { | 161 | if (trans->transaction->in_commit) { |
153 | printk("already in commit!, waiting\n"); | 162 | printk("already in commit!, waiting\n"); |