Whamcloud - gitweb
LU-2335 kernel: add CONFIG_ prefix to config values
authorPeng Tao <tao.peng@emc.com>
Wed, 31 Oct 2012 07:03:46 +0000 (15:03 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 11 Jun 2013 16:05:11 +0000 (12:05 -0400)
Kernel uses CONFIG_ prefix for all values that comes from
Kconfig. So do the same for Lustre.

Rename OBD_MAX_IOCTL_BUFFER to CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER,
LNET_MAX_PAYLOAD to CONFIG_LNET_MAX_PAYLOAD, and INVARIANT_CHECK
to CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: I3b1fdea02ba195ce7ff0793c218ac1f505243bb3
Reviewed-on: http://review.whamcloud.com/4646
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
12 files changed:
libcfs/include/libcfs/libcfs_private.h
lnet/autoconf/lustre-lnet.m4
lnet/include/lnet/types.h
lustre/autoconf/lustre-core.m4
lustre/include/lclient.h
lustre/include/lustre_lib.h
lustre/obdclass/cl_page.c
lustre/obdclass/darwin/darwin-module.c
lustre/osc/osc_cl_internal.h
lustre/osc/osc_lock.c
lustre/osc/osc_object.c
lustre/osc/osc_page.c

index f699862..921431a 100644 (file)
@@ -107,7 +107,7 @@ do {                                                                        \
 # define LASSERTF(cond, ...) ((void)sizeof!!(cond))
 #endif /* !LIBCFS_DEBUG */
 
-#ifdef INVARIANT_CHECK
+#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 --enable-invariants
@@ -274,7 +274,7 @@ do {                                                                           \
           assert(cond);                                                        \
 } while (0)
 #  define LBUG()   assert(0)
-#  ifdef INVARIANT_CHECK
+#  ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK
 #   define LINVRNT(exp) LASSERT(exp)
 #  else
 #   define LINVRNT(exp) ((void)sizeof!!(exp))
index 01c2794..0a1232e 100644 (file)
@@ -10,13 +10,13 @@ AC_ARG_WITH([max-payload-mb],
                        [set maximum lnet payload in MBytes]),
         [
                AC_MSG_RESULT([$with_max_payload_mb])
-               LNET_MAX_PAYLOAD_MB=$with_max_payload_mb
-               LNET_MAX_PAYLOAD="(($with_max_payload_mb)<<20)"
+               CONFIG_LNET_MAX_PAYLOAD_MB=$with_max_payload_mb
+               CONFIG_LNET_MAX_PAYLOAD="(($with_max_payload_mb)<<20)"
        ], [
                AC_MSG_RESULT([no])
-               LNET_MAX_PAYLOAD="LNET_MTU"
+               CONFIG_LNET_MAX_PAYLOAD="LNET_MTU"
        ])
-        AC_DEFINE_UNQUOTED(LNET_MAX_PAYLOAD, $LNET_MAX_PAYLOAD,
+       AC_DEFINE_UNQUOTED(CONFIG_LNET_MAX_PAYLOAD, $CONFIG_LNET_MAX_PAYLOAD,
                           [Max LNET payload])
 ])
 
index 2e7d269..eb82bb0 100644 (file)
@@ -279,9 +279,10 @@ typedef struct {
 #define LNET_MAX_IOV    256
 
 /* Max payload size */
-#ifndef LNET_MAX_PAYLOAD
-# error "LNET_MAX_PAYLOAD must be defined in config.h"
+#ifndef CONFIG_LNET_MAX_PAYLOAD
+# error "CONFIG_LNET_MAX_PAYLOAD must be defined in config.h"
 #else
+# define LNET_MAX_PAYLOAD      CONFIG_LNET_MAX_PAYLOAD
 # if (LNET_MAX_PAYLOAD < LNET_MTU)
 #  error "LNET_MAX_PAYLOAD too small - error in configure --with-max-payload-mb"
 # elif defined(__KERNEL__)
index 067090f..d769124 100644 (file)
@@ -62,7 +62,7 @@ AC_ARG_WITH([obd-buffer-size],
                OBD_BUFFER_SIZE=8192
        ])
 AC_MSG_RESULT([$OBD_BUFFER_SIZE bytes])
-AC_DEFINE_UNQUOTED(OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
+AC_DEFINE_UNQUOTED(CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER, $OBD_BUFFER_SIZE, [IOCTL Buffer Size])
 ])
 
 #
@@ -2829,7 +2829,7 @@ AC_ARG_ENABLE([invariants],
 AC_MSG_CHECKING([whether to check invariants (expensive cpu-wise)])
 AC_MSG_RESULT([$enable_invariants])
 if test x$enable_invariants = xyes ; then
-        AC_DEFINE([INVARIANT_CHECK], 1, [enable invariant checking])
+       AC_DEFINE([CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK], 1, [enable invariant checking])
 fi
 
 AC_ARG_ENABLE([lu_ref],
index f0e456f..ae8f0c7 100644 (file)
@@ -390,7 +390,7 @@ __u16 ll_dirent_type_get(struct lu_dirent *ent);
 __u64 cl_fid_build_ino(const struct lu_fid *fid, int api32);
 __u32 cl_fid_build_gen(const struct lu_fid *fid);
 
-#ifdef INVARIANT_CHECK
+#ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK
 # define CLOBINVRNT(env, clob, expr)                                    \
   do {                                                                  \
           if (unlikely(!(expr))) {                                      \
@@ -398,10 +398,10 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid);
                   LINVRNT(0);                                           \
           }                                                             \
   } while (0)
-#else /* !INVARIANT_CHECK */
+#else /* !CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK */
 # define CLOBINVRNT(env, clob, expr)                                    \
-        ((void)sizeof(env), (void)sizeof(clob), (void)sizeof !!(expr))
-#endif /* !INVARIANT_CHECK */
+        ((void)sizeof(env), (void)sizeof(clob), (void)sizeof !!(expr))
+#endif /* !CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK */
 
 int cl_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp);
 int cl_ocd_update(struct obd_device *host,
index 2a008fe..92fc0d1 100644 (file)
@@ -94,6 +94,7 @@ int do_set_info_async(struct obd_import *imp,
                       struct ptlrpc_request_set *set);
 
 #define OBD_RECOVERY_MAX_TIME (obd_timeout * 18) /* b13079 */
+#define OBD_MAX_IOCTL_BUFFER CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER
 
 void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id);
 
index e837d30..cfa1f60 100644 (file)
@@ -64,7 +64,7 @@ static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg,
         ((void)sizeof(env), (void)sizeof(page), (void)sizeof !!(exp))
 #endif /* !LIBCFS_DEBUG */
 
-#ifdef INVARIANT_CHECK
+#ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK
 # define PINVRNT(env, page, expr)                                       \
   do {                                                                    \
           if (unlikely(!(expr))) {                                      \
@@ -72,10 +72,10 @@ static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg,
                   LINVRNT(0);                                           \
           }                                                             \
   } while (0)
-#else /* !INVARIANT_CHECK */
+#else /* !CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK */
 # define PINVRNT(env, page, exp) \
-        ((void)sizeof(env), (void)sizeof(page), (void)sizeof !!(exp))
-#endif /* !INVARIANT_CHECK */
+        ((void)sizeof(env), (void)sizeof(page), (void)sizeof !!(exp))
+#endif /* !CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK */
 
 /* Disable page statistic by default due to huge performance penalty. */
 #ifdef CONFIG_DEBUG_PAGESTATE_TRACKING
index ee9db9a..f5969d2 100644 (file)
 #include <lprocfs_status.h>
 
 #ifndef OBD_MAX_IOCTL_BUFFER
-#define OBD_MAX_IOCTL_BUFFER 8192
+#ifdef CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER
+#define OBD_MAX_IOCTL_BUFFER   CONFIG_LUSTRE_OBD_MAX_IOCTL_BUFFER
+#else
+#define OBD_MAX_IOCTL_BUFFER   8192
+#endif
 #endif
 
 /* buffer MUST be at least the size of obd_ioctl_hdr */
index 0dea7b5..d53c29f 100644 (file)
@@ -123,7 +123,7 @@ struct osc_object {
          */
         int                oo_contended;
         cfs_time_t         oo_contention_time;
-#ifdef INVARIANT_CHECK
+#ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK
         /**
          * IO context used for invariant checks in osc_lock_has_pages().
          */
index 7404845..f32ba86 100644 (file)
@@ -1354,7 +1354,7 @@ static void osc_lock_cancel(const struct lu_env *env,
         osc_lock_detach(env, olck);
 }
 
-#ifdef INVARIANT_CHECK
+#ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK
 static int check_cb(const struct lu_env *env, struct cl_io *io,
                     struct cl_page *page, void *cbdata)
 {
@@ -1425,7 +1425,7 @@ static int osc_lock_has_pages(struct osc_lock *olck)
 {
         return 0;
 }
-#endif /* INVARIANT_CHECK */
+#endif /* CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK */
 
 static void osc_lock_delete(const struct lu_env *env,
                             const struct cl_lock_slice *slice)
index 741cc48..2f02791 100644 (file)
@@ -77,7 +77,7 @@ static int osc_object_init(const struct lu_env *env, struct lu_object *obj,
         int i;
 
         osc->oo_oinfo = cconf->u.coc_oinfo;
-#ifdef INVARIANT_CHECK
+#ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK
        mutex_init(&osc->oo_debug_mutex);
 #endif
        spin_lock_init(&osc->oo_seatbelt);
index 6e89354..89c0aa0 100644 (file)
@@ -529,7 +529,7 @@ int osc_page_init(const struct lu_env *env, struct cl_object *obj,
         * Cannot assert osc_page_protected() here as read-ahead
         * creates temporary pages outside of a lock.
         */
-#ifdef INVARIANT_CHECK
+#ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK
        opg->ops_temp = !osc_page_protected(env, opg, CLM_READ, 1);
 #endif
        /* ops_inflight and ops_lru are the same field, but it doesn't