summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2010-03-25 12:35:14 +0000
committerChris Mason <chris.mason@oracle.com>2010-03-30 21:19:08 -0400
commit471fa17dff556ad38caf26de097c0630530d8cbe (patch)
tree1a89bf8fa9eb34df3512c1216d5a92a29327a98d /fs/btrfs/transaction.c
parent90d2c51dbb4db05c040bc7db264bb7ab35e35455 (diff)
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>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 2d654c1c794..43054285f63 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);
}
}