Commit 83e8d02c authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging: lustre: debug: initialize debug_msg_data if needed

initialize the libcfs_debug_msg_data only if needed
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1408
Reviewed-on: http://review.whamcloud.com/8338Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1b3f4f90
...@@ -1041,9 +1041,8 @@ struct cl_page_operations { ...@@ -1041,9 +1041,8 @@ struct cl_page_operations {
*/ */
#define CL_PAGE_DEBUG(mask, env, page, format, ...) \ #define CL_PAGE_DEBUG(mask, env, page, format, ...) \
do { \ do { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \
\
if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \ if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \
cl_page_print(env, &msgdata, lu_cdebug_printer, page); \ cl_page_print(env, &msgdata, lu_cdebug_printer, page); \
CDEBUG(mask, format, ## __VA_ARGS__); \ CDEBUG(mask, format, ## __VA_ARGS__); \
} \ } \
...@@ -1054,9 +1053,8 @@ do { \ ...@@ -1054,9 +1053,8 @@ do { \
*/ */
#define CL_PAGE_HEADER(mask, env, page, format, ...) \ #define CL_PAGE_HEADER(mask, env, page, format, ...) \
do { \ do { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \
\
if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \ if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \
cl_page_header_print(env, &msgdata, lu_cdebug_printer, page); \ cl_page_header_print(env, &msgdata, lu_cdebug_printer, page); \
CDEBUG(mask, format, ## __VA_ARGS__); \ CDEBUG(mask, format, ## __VA_ARGS__); \
} \ } \
......
...@@ -780,9 +780,8 @@ int lu_cdebug_printer(const struct lu_env *env, ...@@ -780,9 +780,8 @@ int lu_cdebug_printer(const struct lu_env *env,
*/ */
#define LU_OBJECT_DEBUG(mask, env, object, format, ...) \ #define LU_OBJECT_DEBUG(mask, env, object, format, ...) \
do { \ do { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \
\
if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \ if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \
lu_object_print(env, &msgdata, lu_cdebug_printer, object);\ lu_object_print(env, &msgdata, lu_cdebug_printer, object);\
CDEBUG(mask, format, ## __VA_ARGS__); \ CDEBUG(mask, format, ## __VA_ARGS__); \
} \ } \
...@@ -793,9 +792,8 @@ do { \ ...@@ -793,9 +792,8 @@ do { \
*/ */
#define LU_OBJECT_HEADER(mask, env, object, format, ...) \ #define LU_OBJECT_HEADER(mask, env, object, format, ...) \
do { \ do { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \
\
if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \ if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \
lu_object_header_print(env, &msgdata, lu_cdebug_printer,\ lu_object_header_print(env, &msgdata, lu_cdebug_printer,\
(object)->lo_header); \ (object)->lo_header); \
lu_cdebug_printer(env, &msgdata, "\n"); \ lu_cdebug_printer(env, &msgdata, "\n"); \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment