summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2012-12-27 10:01:22 +0100
committerJosef Bacik <jbacik@fusionio.com>2013-02-20 15:37:17 +0100
commit39f9d028c9906cc7b625df84442205f6bcc84477 (patch)
treef8c3f46583c9bf05893bb70b9cb4157980389be2
parentBtrfs: use token to avoid times mapping extent buffer (diff)
downloadlinux-39f9d028c9906cc7b625df84442205f6bcc84477.tar.xz
linux-39f9d028c9906cc7b625df84442205f6bcc84477.zip
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>
-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);