Skip to content

Commit

Permalink
staging/lustre/libcfs: restore LINVRNT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peng Tao authored and Greg Kroah-Hartman committed Jun 6, 2013
1 parent d29dc2e commit 4b5b4c7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 10 additions & 0 deletions drivers/staging/lustre/lustre/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 4b5b4c7

Please sign in to comment.