Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39f9d028 authored by Liu Bo's avatar Liu Bo Committed by Josef Bacik
Browse files

Btrfs: save us a read_lock



This does not change the logic of code, but can save us a read_lock.

Signed-off-by: default avatarLiu Bo <bo.li.liu@oracle.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent 51fab693
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);