staging: lustre: debug: initialize debug_msg_data if needed
authorOleg Drokin <green@linuxhacker.ru>
Thu, 28 Apr 2016 16:07:31 +0000 (12:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Apr 2016 04:55:26 +0000 (21:55 -0700)
initialize the libcfs_debug_msg_data only if needed

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1408
Reviewed-on: http://review.whamcloud.com/8338
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/cl_object.h
drivers/staging/lustre/lustre/include/lu_object.h

index 587a236a6a62d443237b2d53f83159243bead4df..d4c33dd110abb4e5eaa988261d0e34a8414db23c 100644 (file)
@@ -1041,9 +1041,8 @@ struct cl_page_operations {
  */
 #define CL_PAGE_DEBUG(mask, env, page, format, ...)                 \
 do {                                                               \
-       LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);                \
-                                                                       \
        if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {              \
+               LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);        \
                cl_page_print(env, &msgdata, lu_cdebug_printer, page);  \
                CDEBUG(mask, format, ## __VA_ARGS__);             \
        }                                                              \
@@ -1054,9 +1053,8 @@ do {                                                                  \
  */
 #define CL_PAGE_HEADER(mask, env, page, format, ...)                     \
 do {                                                                     \
-       LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);                      \
-                                                                             \
        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); \
                CDEBUG(mask, format, ## __VA_ARGS__);                   \
        }                                                                    \
index a27e76f0d68798efb612295fdc396dc0f8c29588..2816512185af4afd66a8a8d5734665ff30e82584 100644 (file)
@@ -780,9 +780,8 @@ int lu_cdebug_printer(const struct lu_env *env,
  */
 #define LU_OBJECT_DEBUG(mask, env, object, format, ...)                   \
 do {                                                                 \
-       LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);                  \
-                                                                         \
        if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {                \
+               LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);                \
                lu_object_print(env, &msgdata, lu_cdebug_printer, object);\
                CDEBUG(mask, format, ## __VA_ARGS__);               \
        }                                                                \
@@ -793,9 +792,8 @@ do {                                                                      \
  */
 #define LU_OBJECT_HEADER(mask, env, object, format, ...)               \
 do {                                                               \
-       LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);                \
-                                                                       \
        if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {              \
+               LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);                \
                lu_object_header_print(env, &msgdata, lu_cdebug_printer,\
                                       (object)->lo_header);        \
                lu_cdebug_printer(env, &msgdata, "\n");          \