mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 20:40:52 +07:00
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: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
90d2c51dbb
commit
471fa17dff
@ -147,18 +147,13 @@ static void wait_current_trans(struct btrfs_root *root)
|
||||
while (1) {
|
||||
prepare_to_wait(&root->fs_info->transaction_wait, &wait,
|
||||
TASK_UNINTERRUPTIBLE);
|
||||
if (cur_trans->blocked) {
|
||||
mutex_unlock(&root->fs_info->trans_mutex);
|
||||
schedule();
|
||||
mutex_lock(&root->fs_info->trans_mutex);
|
||||
finish_wait(&root->fs_info->transaction_wait,
|
||||
&wait);
|
||||
} else {
|
||||
finish_wait(&root->fs_info->transaction_wait,
|
||||
&wait);
|
||||
if (!cur_trans->blocked)
|
||||
break;
|
||||
}
|
||||
mutex_unlock(&root->fs_info->trans_mutex);
|
||||
schedule();
|
||||
mutex_lock(&root->fs_info->trans_mutex);
|
||||
}
|
||||
finish_wait(&root->fs_info->transaction_wait, &wait);
|
||||
put_transaction(cur_trans);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user