aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 728e8fe5d2cc..75b31caade29 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -333,6 +333,9 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
333 memset(trans, 0, sizeof(*trans)); 333 memset(trans, 0, sizeof(*trans));
334 kmem_cache_free(btrfs_trans_handle_cachep, trans); 334 kmem_cache_free(btrfs_trans_handle_cachep, trans);
335 335
336 if (throttle)
337 btrfs_run_delayed_iputs(root);
338
336 return 0; 339 return 0;
337} 340}
338 341
@@ -991,11 +994,11 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
991 mutex_unlock(&root->fs_info->trans_mutex); 994 mutex_unlock(&root->fs_info->trans_mutex);
992 995
993 if (flush_on_commit) { 996 if (flush_on_commit) {
994 btrfs_start_delalloc_inodes(root); 997 btrfs_start_delalloc_inodes(root, 1);
995 ret = btrfs_wait_ordered_extents(root, 0); 998 ret = btrfs_wait_ordered_extents(root, 0, 1);
996 BUG_ON(ret); 999 BUG_ON(ret);
997 } else if (snap_pending) { 1000 } else if (snap_pending) {
998 ret = btrfs_wait_ordered_extents(root, 1); 1001 ret = btrfs_wait_ordered_extents(root, 0, 1);
999 BUG_ON(ret); 1002 BUG_ON(ret);
1000 } 1003 }
1001 1004
@@ -1113,6 +1116,10 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
1113 current->journal_info = NULL; 1116 current->journal_info = NULL;
1114 1117
1115 kmem_cache_free(btrfs_trans_handle_cachep, trans); 1118 kmem_cache_free(btrfs_trans_handle_cachep, trans);
1119
1120 if (current != root->fs_info->transaction_kthread)
1121 btrfs_run_delayed_iputs(root);
1122
1116 return ret; 1123 return ret;
1117} 1124}
1118 1125