From: Liu Bo Date: Thu, 27 Dec 2012 09:01:22 +0000 (+0000) Subject: Btrfs: save us a read_lock X-Git-Tag: v3.9-rc1~4^2~30^2~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=39f9d028c9906cc7b625df84442205f6bcc84477;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Signed-off-by: Josef Bacik --- diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c index 2a1762c..e95df43 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);