Commit 471fa17d authored by Zhao Lei's avatar Zhao Lei Committed by Chris Mason
Browse files

Btrfs: Remove unnecessary finish_wait() in wait_current_trans()



We only need to call finish_wait() after wait loop.

By the way, this patch makes code of waiting loop similar to
example in wait.h(no functional change)
Signed-off-by: default avatarZhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 90d2c51d
...@@ -147,18 +147,13 @@ static void wait_current_trans(struct btrfs_root *root) ...@@ -147,18 +147,13 @@ static void wait_current_trans(struct btrfs_root *root)
while (1) { while (1) {
prepare_to_wait(&root->fs_info->transaction_wait, &wait, prepare_to_wait(&root->fs_info->transaction_wait, &wait,
TASK_UNINTERRUPTIBLE); TASK_UNINTERRUPTIBLE);
if (cur_trans->blocked) { if (!cur_trans->blocked)
break;
mutex_unlock(&root->fs_info->trans_mutex); mutex_unlock(&root->fs_info->trans_mutex);
schedule(); schedule();
mutex_lock(&root->fs_info->trans_mutex); mutex_lock(&root->fs_info->trans_mutex);
finish_wait(&root->fs_info->transaction_wait,
&wait);
} else {
finish_wait(&root->fs_info->transaction_wait,
&wait);
break;
}
} }
finish_wait(&root->fs_info->transaction_wait, &wait);
put_transaction(cur_trans); put_transaction(cur_trans);
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment