linux-mips
[Top] [All Lists]

[PATCH] read_can_lock and write_can_lock for MIPS

To: linux-mips@linux-mips.org
Subject: [PATCH] read_can_lock and write_can_lock for MIPS
From: Manish Lachwani <mlachwani@mvista.com>
Date: Tue, 1 Feb 2005 13:26:03 -0800
Cc: ralf@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.1i
Hi Ralf,

With SMP+PREEMPT, read_can_lock() and write_can_lock() need to be defined. 
Attached
patch does this. Please review.

Thanks
Manish Lachwani
Index: linux/include/asm-mips/spinlock.h
===================================================================
--- linux.orig/include/asm-mips/spinlock.h
+++ linux/include/asm-mips/spinlock.h
@@ -140,6 +140,9 @@
 
 #define rwlock_init(x)  do { *(x) = RW_LOCK_UNLOCKED; } while(0)
 
+#define read_can_lock(rw)      ((rw)->lock >= 0)
+#define write_can_lock(rw)     (!(rw)->lock)
+
 static inline void _raw_read_lock(rwlock_t *rw)
 {
        unsigned int tmp;
<Prev in Thread] Current Thread [Next in Thread>