staging/lustre/libcfs: restore LINVRNT
authorPeng Tao <bergwolf@gmail.com>
Thu, 6 Jun 2013 14:59:11 +0000 (22:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Jun 2013 18:31:02 +0000 (11:31 -0700)
It was mistakenly removed by coan. Add it back and also with a new
Kconfig option to enable it.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
drivers/staging/lustre/lustre/Kconfig

index c4f59075ed42cd14be657a40e612a55a847da8ee..056caa467126b158a84bc83b90ee4391c3cdda79 100644 (file)
@@ -72,7 +72,16 @@ do {                                                                 \
 
 #define LASSERT(cond) LASSERTF(cond, "\n")
 
+#ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK
+/**
+ * This is for more expensive checks that one doesn't want to be enabled all
+ * the time. LINVRNT() has to be explicitly enabled by
+ * CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK option.
+ */
+# define LINVRNT(exp) LASSERT(exp)
+#else
 # define LINVRNT(exp) ((void)sizeof!!(exp))
+#endif
 
 #define KLASSERT(e) LASSERT(e)
 
index d0a0e08afbc719b0608f783eba9825e90c9cf44b..ab3e126e612556019ea258b9d7a6bb9b3a29eb25 100644 (file)
@@ -31,3 +31,13 @@ config LUSTRE_OBD_MAX_IOCTL_BUFFER
          applications can pass to Lustre kernel module through ioctl interface.
 
          If unsure, use default.
+
+config LUSTRE_DEBUG_EXPENSIVE_CHECK
+       bool "Enable Lustre DEBUG checks"
+       depends on LUSTRE_FS
+       default false
+       help
+         This option is mainly for debug purpose. It enables Lustre code to do
+         expensive checks that may have a performance impact.
+
+         Use with caution. If unsure, say N.