[PATCH] rwlock_is_locked undefined for UP systems

From: Prashanth T
Date: Fri Jan 16 2004 - 08:43:30 EST


Hi,
I had to use rwlock_is_locked( ) with linux2.6 for kdb and noticed that
this routine to be undefined for UP. I have attached the patch for 2.6.1
below to return 0 for rwlock_is_locked( ) on UP systems.
Please let me know.

Thanks
Prashanth




diff -urN linux-2.6.1/include/linux/spinlock.h linux-2.6.1-rwlock-patch/include/linux/spinlock.h
--- linux-2.6.1/include/linux/spinlock.h 2004-01-09 12:29:33.000000000 +0530
+++ linux-2.6.1-rwlock-patch/include/linux/spinlock.h 2004-01-16 18:15:10.000000000 +0530
@@ -176,6 +176,7 @@
#endif

#define rwlock_init(lock) do { (void)(lock); } while(0)
+#define rwlock_is_locked(lock) ((void)(lock), 0)
#define _raw_read_lock(lock) do { (void)(lock); } while(0)
#define _raw_read_unlock(lock) do { (void)(lock); } while(0)
#define _raw_write_lock(lock) do { (void)(lock); } while(0)