aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2012-10-25 05:28:04 -0400
committerJosef Bacik <jbacik@fusionio.com>2012-12-11 13:31:37 -0500
commit8ccf6f19b67f7e0921063cc309f4672a6afcb528 (patch)
tree98cd76ca5dd2e7c93adc1bd363fefaa803acc824 /fs/btrfs/transaction.c
parent7b398f8e58c415738e397645c926253c428cf002 (diff)
Btrfs: make delalloc inodes be flushed by multi-task
This patch introduce a new worker pool named "flush_workers", and if we want to force all the inode with pending delalloc to the disks, we can queue those inodes into the work queue of the worker pool, in this way, those inodes will be flushed by multi-task. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 4e1def4c06b..9c466f9f817 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1497,7 +1497,11 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
1497 WARN_ON(cur_trans != trans->transaction); 1497 WARN_ON(cur_trans != trans->transaction);
1498 1498
1499 if (flush_on_commit || snap_pending) { 1499 if (flush_on_commit || snap_pending) {
1500 btrfs_start_delalloc_inodes(root, 1); 1500 ret = btrfs_start_delalloc_inodes(root, 1);
1501 if (ret) {
1502 btrfs_abort_transaction(trans, root, ret);
1503 goto cleanup_transaction;
1504 }
1501 btrfs_wait_ordered_extents(root, 1); 1505 btrfs_wait_ordered_extents(root, 1);
1502 } 1506 }
1503 1507