Skip to content

Commit

Permalink
Btrfs: Remove unnecessary finish_wait() in wait_current_trans()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zhao Lei authored and Chris Mason committed Mar 31, 2010
1 parent 90d2c51 commit 471fa17
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 471fa17

Please sign in to comment.