Whamcloud - gitweb
Branch HEAD
authoradilger <adilger>
Wed, 22 Oct 2008 21:04:39 +0000 (21:04 +0000)
committeradilger <adilger>
Wed, 22 Oct 2008 21:04:39 +0000 (21:04 +0000)
The infiniband code includes its own lockdep compatibility code and this
#defines lockdep_set_class but doesn't include mutex_lock_nested() or
down_write_nested(), causing a compiler error in obdclass/llog_cat.c.

mutex_{un,}lock_nested() and down_{read,write}_nested() are functions
under CONFIG_DEBUG_LOCK_ALLOC, but #defined to regular locks without
CONFIG_DEBUG_LOCK_ALLOC so just checking #ifndef isn't sufficient.
b=16450

libcfs/include/libcfs/linux/linux-lock.h

index f1c442f..701c3fc 100644 (file)
@@ -160,9 +160,11 @@ struct lock_class_key {
 
 # define lockdep_set_class(lock, key) \
         do { (void)sizeof (lock);(void)sizeof (key); } while (0)
-
 /* This has to be a macro, so that `subclass' can be undefined in kernels that
  * do not support lockdep. */
+#endif /* lockdep_set_class */
+
+#ifndef CONFIG_DEBUG_LOCK_ALLOC
 #ifndef mutex_lock_nested
 # define mutex_lock_nested(mutex, subclass) mutex_lock(mutex)
 #endif
@@ -178,7 +180,7 @@ struct lock_class_key {
 #ifndef down_write_nested
 # define down_write_nested(lock, subclass) down_write(lock)
 #endif
+#endif /* CONFIG_DEBUG_LOCK_ALLOC */
 
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) */
 
 #endif /* __LIBCFS_LINUX_CFS_LOCK_H__ */