summaryrefslogtreecommitdiff
path: root/fs/btrfs/locking.c
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2012-12-27 09:01:22 +0000
committerJosef Bacik <jbacik@fusionio.com>2013-02-20 09:37:17 -0500
commit39f9d028c9906cc7b625df84442205f6bcc84477 (patch)
treef8c3f46583c9bf05893bb70b9cb4157980389be2 /fs/btrfs/locking.c
parent51fab693477c39ba82c153d3fb30a4cc6de49874 (diff)
Btrfs: save us a read_lock
This does not change the logic of code, but can save us a read_lock. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/locking.c')
-rw-r--r--fs/btrfs/locking.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c
index 2a1762c66041..e95df435d897 100644
--- a/fs/btrfs/locking.c
+++ b/fs/btrfs/locking.c
@@ -113,11 +113,10 @@ again:
read_unlock(&eb->lock);
return;
}
- read_unlock(&eb->lock);
- wait_event(eb->write_lock_wq, atomic_read(&eb->blocking_writers) == 0);
- read_lock(&eb->lock);
if (atomic_read(&eb->blocking_writers)) {
read_unlock(&eb->lock);
+ wait_event(eb->write_lock_wq,
+ atomic_read(&eb->blocking_writers) == 0);
goto again;
}
atomic_inc(&eb->read_locks);