Btrfs: start of support for many FS volumes

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2007-04-06 15:37:36 -04:00
committed by David Woodhouse
parent 3eb0314dc1
commit d6e4a428eb
9 changed files with 242 additions and 79 deletions

View File

@ -52,6 +52,8 @@ struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root,
kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS);
int ret;
/* FIXME, use the right root */
root = root->fs_info->fs_root;
mutex_lock(&root->fs_info->trans_mutex);
ret = join_transaction(root);
BUG_ON(ret);
@ -69,6 +71,10 @@ int btrfs_end_transaction(struct btrfs_trans_handle *trans,
struct btrfs_root *root)
{
struct btrfs_transaction *cur_trans;
/* FIXME, use the right root */
root = root->fs_info->fs_root;
WARN_ON(trans->magic != TRANS_MAGIC);
WARN_ON(trans->magic2 != TRANS_MAGIC);
mutex_lock(&root->fs_info->trans_mutex);
@ -148,6 +154,9 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
struct btrfs_transaction *cur_trans;
DEFINE_WAIT(wait);
/* FIXME, use the right root */
root = root->fs_info->fs_root;
mutex_lock(&root->fs_info->trans_mutex);
if (trans->transaction->in_commit) {
printk("already in commit!, waiting\n");