aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2012-11-15 03:14:47 -0500
committerJosef Bacik <jbacik@fusionio.com>2013-02-20 09:36:37 -0500
commit7892b5afe4a1a00af25107e27357db30434ab876 (patch)
tree12746239009189e6ab10b0d8d829e5725df5dc9e /fs/btrfs/transaction.c
parent7b5a1c5310a50abc96c9ca07039688027d0a4282 (diff)
Btrfs: use common work instead of delayed work
Since we do not want to delay the async transaction commit, we should use common work, not delayed work. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index a1455f1e4676..86bb105b3982 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1305,13 +1305,13 @@ static void wait_current_trans_commit_start_and_unblock(struct btrfs_root *root,
1305struct btrfs_async_commit { 1305struct btrfs_async_commit {
1306 struct btrfs_trans_handle *newtrans; 1306 struct btrfs_trans_handle *newtrans;
1307 struct btrfs_root *root; 1307 struct btrfs_root *root;
1308 struct delayed_work work; 1308 struct work_struct work;
1309}; 1309};
1310 1310
1311static void do_async_commit(struct work_struct *work) 1311static void do_async_commit(struct work_struct *work)
1312{ 1312{
1313 struct btrfs_async_commit *ac = 1313 struct btrfs_async_commit *ac =
1314 container_of(work, struct btrfs_async_commit, work.work); 1314 container_of(work, struct btrfs_async_commit, work);
1315 1315
1316 /* 1316 /*
1317 * We've got freeze protection passed with the transaction. 1317 * We've got freeze protection passed with the transaction.
@@ -1339,7 +1339,7 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,
1339 if (!ac) 1339 if (!ac)
1340 return -ENOMEM; 1340 return -ENOMEM;
1341 1341
1342 INIT_DELAYED_WORK(&ac->work, do_async_commit); 1342 INIT_WORK(&ac->work, do_async_commit);
1343 ac->root = root; 1343 ac->root = root;
1344 ac->newtrans = btrfs_join_transaction(root); 1344 ac->newtrans = btrfs_join_transaction(root);
1345 if (IS_ERR(ac->newtrans)) { 1345 if (IS_ERR(ac->newtrans)) {
@@ -1363,7 +1363,7 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,
1363 &root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1], 1363 &root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1],
1364 1, _THIS_IP_); 1364 1, _THIS_IP_);
1365 1365
1366 schedule_delayed_work(&ac->work, 0); 1366 schedule_work(&ac->work);
1367 1367
1368 /* wait for transaction to start and unblock */ 1368 /* wait for transaction to start and unblock */
1369 if (wait_for_unblock) 1369 if (wait_for_unblock)