aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/lustre
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/lustre')
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_private.h9
-rw-r--r--drivers/staging/lustre/lustre/Kconfig10
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
index c4f59075ed42..056caa467126 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
@@ -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)
diff --git a/drivers/staging/lustre/lustre/Kconfig b/drivers/staging/lustre/lustre/Kconfig
index d0a0e08afbc7..ab3e126e6125 100644
--- a/drivers/staging/lustre/lustre/Kconfig
+++ b/drivers/staging/lustre/lustre/Kconfig
@@ -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.