From: Peng Tao Date: Thu, 6 Jun 2013 14:59:11 +0000 (+0800) Subject: staging/lustre/libcfs: restore LINVRNT X-Git-Tag: v3.11-rc1~158^2~262 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b5b4c7222b8eac2279e604e040561c855bbf0ce;p=platform%2Fupstream%2Fkernel-adaptation-pc.git staging/lustre/libcfs: restore LINVRNT It was mistakenly removed by coan. Add it back and also with a new Kconfig option to enable it. Signed-off-by: Peng Tao Signed-off-by: Andreas Dilger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index c4f5907..056caa4 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 d0a0e08..ab3e126 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.