diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2012-12-27 09:01:22 +0000 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-02-20 09:37:17 -0500 |
commit | 39f9d028c9906cc7b625df84442205f6bcc84477 (patch) | |
tree | f8c3f46583c9bf05893bb70b9cb4157980389be2 | |
parent | 51fab693477c39ba82c153d3fb30a4cc6de49874 (diff) | |
download | linux-39f9d028c9906cc7b625df84442205f6bcc84477.tar.bz2 |
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.c | 5 |
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); |