Whamcloud - gitweb
land portals part of b_hd_sec on HEAD.
[fs/lustre-release.git] / lnet / include / libcfs / libcfs.h
index 2fabeab..b6f582c 100644 (file)
@@ -8,7 +8,14 @@
 #define __attribute__(x)
 #endif
 
-#include <libcfs/arch/libcfs.h>
+#if defined(__linux__)
+#include <libcfs/linux/libcfs.h>
+#elif defined(__APPLE__)
+#include <libcfs/darwin/libcfs.h>
+#else
+#error Unsupported operating system.
+#endif
+
 #include "curproc.h"
 
 #define PORTAL_DEBUG
@@ -59,6 +66,7 @@ extern unsigned int portal_printk;
 #define S_CONFOBD     0x00400000
 #define S_LMV         0x00800000
 #define S_CMOBD       0x01000000
+#define S_SEC         0x02000000
 /* If you change these values, please keep these files up to date...
  *    portals/utils/debug.c
  *    utils/lconf
@@ -90,6 +98,9 @@ extern unsigned int portal_printk;
 #define D_READA       0x00400000 /* read-ahead */
 #define D_MMAP        0x00800000
 #define D_CONFIG      0x01000000
+#define D_CONSOLE     0x02000000
+#define D_QUOTA       0x04000000
+#define D_SEC         0x08000000
 /* If you change these values, please keep these files up to date...
  *    portals/utils/debug.c
  *    utils/lconf
@@ -103,7 +114,7 @@ extern unsigned int portal_printk;
 #define CDEBUG(mask, format, a...)                                            \
 do {                                                                          \
         CHECK_STACK(CDEBUG_STACK);                                            \
-        if (((mask) & (D_ERROR | D_EMERG | D_WARNING)) ||                     \
+        if (((mask) & (D_ERROR | D_EMERG | D_WARNING | D_CONSOLE)) ||         \
             (portal_debug & (mask) &&                                         \
              portal_subsystem_debug & DEBUG_SUBSYSTEM))                       \
                 portals_debug_msg(DEBUG_SUBSYSTEM, mask,                      \
@@ -153,6 +164,12 @@ do {                                                                          \
 #define CERROR(format, a...) CDEBUG_LIMIT(D_ERROR, format, ## a)
 #define CEMERG(format, a...) CDEBUG(D_EMERG, format, ## a)
 
+#define LCONSOLE(mask, format, a...) CDEBUG(D_CONSOLE | (mask), format, ## a)
+#define LCONSOLE_INFO(format, a...)  CDEBUG_LIMIT(D_CONSOLE, format, ## a)
+#define LCONSOLE_WARN(format, a...)  CDEBUG_LIMIT(D_CONSOLE | D_WARNING, format, ## a)
+#define LCONSOLE_ERROR(format, a...) CDEBUG_LIMIT(D_CONSOLE | D_ERROR, format, ## a)
+#define LCONSOLE_EMERG(format, a...) CDEBUG(D_CONSOLE | D_EMERG, format, ## a)
+
 #define GOTO(label, rc)                                                 \
 do {                                                                    \
         long GOTO__ret = (long)(rc);                                    \
@@ -211,7 +228,7 @@ do {                                                                    \
 
 #define LUSTRE_SRV_PTL_PID      LUSTRE_PTL_PID
 
-#define PORTALS_CFG_VERSION 0x00010001;
+#define PORTALS_CFG_VERSION 0x00010001
 
 struct portals_cfg {
         __u32 pcfg_version;
@@ -406,7 +423,6 @@ extern void portals_debug_msg(int subsys, int mask, char *file, const char *fn,
                               char *format, ...)
             __attribute__ ((format (printf, 7, 8)));
 
-
 static inline void cfs_slow_warning(cfs_time_t now, int seconds, char *msg)
 {
         if (cfs_time_after(cfs_time_current(),