diff mbox

[RFC] btrfs: Simplify locking

Message ID 20110321165955.GG12003@htj.dyndns.org (mailing list archive)
State New, archived
Headers show

Commit Message

Tejun Heo March 21, 2011, 4:59 p.m. UTC
None
diff mbox

Patch

Index: work/fs/btrfs/locking.h
===================================================================
--- work.orig/fs/btrfs/locking.h
+++ work/fs/btrfs/locking.h
@@ -28,6 +28,8 @@  static inline bool btrfs_try_spin_lock(s
 
 static inline void btrfs_tree_lock(struct extent_buffer *eb)
 {
+	if (mutex_tryspin(&eb->lock))
+		return;
 	mutex_lock(&eb->lock);
 }