From: Zhao Lei Date: Thu, 25 Mar 2010 12:35:14 +0000 (+0000) Subject: Btrfs: Remove unnecessary finish_wait() in wait_current_trans() X-Git-Tag: MMI-PSA29.97-13-9~23937^2~15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=471fa17dff556ad38caf26de097c0630530d8cbe;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Miao Xie Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 2d654c1c794d..43054285f638 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -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); } }