aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2011-05-28 07:00:39 -0400
committerChris Mason <chris.mason@oracle.com>2011-05-28 07:00:39 -0400
commitff5714cca971848963b87d6b477c16ca8abbaa54 (patch)
tree17ee34b9b5e00804df4059503f82f6f1d94383a9 /fs/btrfs/ioctl.c
parent174ba50915b08dcfd07c8b5fb795b46a165fa09a (diff)
parentd90c732122a1f6d0efe388a8a204f67f144b2eb3 (diff)
Merge branch 'for-chris' of
git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-work into for-linus Conflicts: fs/btrfs/disk-io.c fs/btrfs/extent-tree.c fs/btrfs/free-space-cache.c fs/btrfs/inode.c fs/btrfs/transaction.c Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 85e818ce00c5..74c80595d707 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -243,7 +243,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg)
243 ip->flags &= ~(BTRFS_INODE_COMPRESS | BTRFS_INODE_NOCOMPRESS); 243 ip->flags &= ~(BTRFS_INODE_COMPRESS | BTRFS_INODE_NOCOMPRESS);
244 } 244 }
245 245
246 trans = btrfs_join_transaction(root, 1); 246 trans = btrfs_join_transaction(root);
247 BUG_ON(IS_ERR(trans)); 247 BUG_ON(IS_ERR(trans));
248 248
249 ret = btrfs_update_inode(trans, root, inode); 249 ret = btrfs_update_inode(trans, root, inode);
@@ -414,8 +414,7 @@ static noinline int create_subvol(struct btrfs_root *root,
414 414
415 btrfs_record_root_in_trans(trans, new_root); 415 btrfs_record_root_in_trans(trans, new_root);
416 416
417 ret = btrfs_create_subvol_root(trans, new_root, new_dirid, 417 ret = btrfs_create_subvol_root(trans, new_root, new_dirid);
418 BTRFS_I(dir)->block_group);
419 /* 418 /*
420 * insert the directory item 419 * insert the directory item
421 */ 420 */
@@ -2489,12 +2488,10 @@ static long btrfs_ioctl_trans_start(struct file *file)
2489 if (ret) 2488 if (ret)
2490 goto out; 2489 goto out;
2491 2490
2492 mutex_lock(&root->fs_info->trans_mutex); 2491 atomic_inc(&root->fs_info->open_ioctl_trans);
2493 root->fs_info->open_ioctl_trans++;
2494 mutex_unlock(&root->fs_info->trans_mutex);
2495 2492
2496 ret = -ENOMEM; 2493 ret = -ENOMEM;
2497 trans = btrfs_start_ioctl_transaction(root, 0); 2494 trans = btrfs_start_ioctl_transaction(root);
2498 if (IS_ERR(trans)) 2495 if (IS_ERR(trans))
2499 goto out_drop; 2496 goto out_drop;
2500 2497
@@ -2502,9 +2499,7 @@ static long btrfs_ioctl_trans_start(struct file *file)
2502 return 0; 2499 return 0;
2503 2500
2504out_drop: 2501out_drop:
2505 mutex_lock(&root->fs_info->trans_mutex); 2502 atomic_dec(&root->fs_info->open_ioctl_trans);
2506 root->fs_info->open_ioctl_trans--;
2507 mutex_unlock(&root->fs_info->trans_mutex);
2508 mnt_drop_write(file->f_path.mnt); 2503 mnt_drop_write(file->f_path.mnt);
2509out: 2504out:
2510 return ret; 2505 return ret;
@@ -2738,9 +2733,7 @@ long btrfs_ioctl_trans_end(struct file *file)
2738 2733
2739 btrfs_end_transaction(trans, root); 2734 btrfs_end_transaction(trans, root);
2740 2735
2741 mutex_lock(&root->fs_info->trans_mutex); 2736 atomic_dec(&root->fs_info->open_ioctl_trans);
2742 root->fs_info->open_ioctl_trans--;
2743 mutex_unlock(&root->fs_info->trans_mutex);
2744 2737
2745 mnt_drop_write(file->f_path.mnt); 2738 mnt_drop_write(file->f_path.mnt);
2746 return 0; 2739 return 0;