[Pvfs2-cvs] commit by slang in pvfs2/src/common/gossip: gossip.h

CVS commit program cvs at parl.clemson.edu
Fri Aug 18 01:12:02 EDT 2006


Update of /projects/cvsroot/pvfs2/src/common/gossip
In directory parlweb1:/tmp/cvs-serv28668/src/common/gossip

Modified Files:
      Tag: kunkel-branch
	gossip.h 
Log Message:
reverse merge from trunk.  working for now.


Index: gossip.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/common/gossip/gossip.h,v
diff -p -u -r1.16 -r1.16.6.1
--- gossip.h	5 Jun 2006 22:52:50 -0000	1.16
+++ gossip.h	18 Aug 2006 05:12:02 -0000	1.16.6.1
@@ -20,8 +20,10 @@
 #ifndef __GOSSIP_H
 #define __GOSSIP_H
 
+#ifndef __KERNEL__
 #include <stdint.h>
 #include "syslog.h"
+#endif
 #include "pvfs2-config.h"
 
 /********************************************************************
@@ -39,6 +41,34 @@ enum gossip_logstamp
 };
 #define GOSSIP_LOGSTAMP_DEFAULT GOSSIP_LOGSTAMP_USEC
 
+/* Keep a simplified version for the kmod */
+#ifdef __KERNEL__
+
+#ifdef GOSSIP_DISABLE_DEBUG
+#define gossip_debug(mask, format, f...) do {} while(0)
+#else
+extern int gossip_debug_mask;
+
+/* try to avoid function call overhead by checking masks in macro */
+#define gossip_debug(mask, format, f...)                  \
+do {                                                      \
+    if (gossip_debug_mask & mask)                         \
+    {                                                     \
+        printk(format, ##f);                              \
+    }                                                     \
+} while(0)
+#endif /* GOSSIP_DISABLE_DEBUG */
+
+/* do file and line number printouts w/ the GNU preprocessor */
+#define gossip_ldebug(mask, format, f...)                  \
+do {                                                       \
+    gossip_debug(mask, "%s: " format, __func__ , ##f); \
+} while(0)
+
+#define gossip_err printk
+
+#else
+
 int gossip_enable_syslog(
     int priority);
 int gossip_enable_stderr(
@@ -154,6 +184,8 @@ int gossip_err(
 #define gossip_lerr gossip_err
 
 #endif /* __GNUC__ */
+
+#endif /* __KERNEL__ */
 
 #endif /* __GOSSIP_H */
 



More information about the Pvfs2-cvs mailing list