aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2013-05-15 03:48:25 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-06-14 11:29:44 -0400
commitac6738792fe4478df2da9c1f41e3540e9ef79604 (patch)
treea10be3006879d4d50438dc9f332e6bd5548209be /fs/btrfs/disk-io.c
parent6a03843df4d29593912e558c72a2ce39274d2366 (diff)
Btrfs: cleanup unnecessary assignment when cleaning up all the residual transaction
When we umount a fs with serious errors, we will invoke btrfs_cleanup_transactions() to clean up the residual transaction. At this time, It is impossible to start a new transaction, so we needn't assign trans_no_join to 1, and also needn't clear running transaction every time we destroy a residual transaction. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 0f873872d1f8..885245f5acdc 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3994,7 +3994,7 @@ static int btrfs_cleanup_transaction(struct btrfs_root *root)
3994 3994
3995 spin_lock(&root->fs_info->trans_lock); 3995 spin_lock(&root->fs_info->trans_lock);
3996 list_splice_init(&root->fs_info->trans_list, &list); 3996 list_splice_init(&root->fs_info->trans_list, &list);
3997 root->fs_info->trans_no_join = 1; 3997 root->fs_info->running_transaction = NULL;
3998 spin_unlock(&root->fs_info->trans_lock); 3998 spin_unlock(&root->fs_info->trans_lock);
3999 3999
4000 while (!list_empty(&list)) { 4000 while (!list_empty(&list)) {
@@ -4030,10 +4030,6 @@ static int btrfs_cleanup_transaction(struct btrfs_root *root)
4030 4030
4031 btrfs_destroy_all_delalloc_inodes(root->fs_info); 4031 btrfs_destroy_all_delalloc_inodes(root->fs_info);
4032 4032
4033 spin_lock(&root->fs_info->trans_lock);
4034 root->fs_info->running_transaction = NULL;
4035 spin_unlock(&root->fs_info->trans_lock);
4036
4037 btrfs_destroy_marked_extents(root, &t->dirty_pages, 4033 btrfs_destroy_marked_extents(root, &t->dirty_pages,
4038 EXTENT_DIRTY); 4034 EXTENT_DIRTY);
4039 4035
@@ -4046,9 +4042,6 @@ static int btrfs_cleanup_transaction(struct btrfs_root *root)
4046 kmem_cache_free(btrfs_transaction_cachep, t); 4042 kmem_cache_free(btrfs_transaction_cachep, t);
4047 } 4043 }
4048 4044
4049 spin_lock(&root->fs_info->trans_lock);
4050 root->fs_info->trans_no_join = 0;
4051 spin_unlock(&root->fs_info->trans_lock);
4052 mutex_unlock(&root->fs_info->transaction_kthread_mutex); 4045 mutex_unlock(&root->fs_info->transaction_kthread_mutex);
4053 4046
4054 return 0; 4047 return 0;