[Ocfs2-commits] manish commits r2314 - trunk/fs/ocfs2/cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue May 24 16:30:34 CDT 2005


Author: manish
Signed-off-by: mfasheh
Signed-off-by: jlbec
Date: 2005-05-24 16:30:33 -0500 (Tue, 24 May 2005)
New Revision: 2314

Modified:
   trunk/fs/ocfs2/cluster/masklog.h
   trunk/fs/ocfs2/cluster/tcp.c
Log:
Lame tweaks to get us to build with gcc 2.95

Signed-off-by: mfasheh
Signed-off-by: jlbec


Modified: trunk/fs/ocfs2/cluster/masklog.h
===================================================================
--- trunk/fs/ocfs2/cluster/masklog.h	2005-05-24 18:45:36 UTC (rev 2313)
+++ trunk/fs/ocfs2/cluster/masklog.h	2005-05-24 21:30:33 UTC (rev 2314)
@@ -168,9 +168,14 @@
 	put_cpu();			\
 	_cpu;				\
 })
+
+/* In the following two macros, the whitespace after the ',' just
+ * before ##args is intentional. Otherwise, gcc 2.95 will eat the
+ * previous token if args expands to nothing.
+ */
 #define __mlog_printk(level, fmt, args...)				\
 	printk(level "(%u,%lu):%s:%d " fmt, current->pid,		\
-	       __mlog_cpu_guess, __PRETTY_FUNCTION__, __LINE__,		\
+	       __mlog_cpu_guess, __PRETTY_FUNCTION__, __LINE__ ,	\
 	       ##args)
 
 #define mlog(mask, fmt, args...) do {					\
@@ -198,10 +203,10 @@
 	mlog(ML_ENTRY, "ENTRY:\n");					\
 } while (0)
 
-/* We disable this since sparse doesn't handle the
- * __builtin_types_compatible_p stuff just yet.
+/* We disable this for old compilers since they don't have support for
+ * __builtin_types_compatible_p.
  */
-#ifndef __CHECKER__
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
 #define mlog_exit(st) do {						     \
 	if (__builtin_types_compatible_p(typeof(st), unsigned long))	     \
 		mlog(ML_EXIT, "EXIT: %lu\n", (unsigned long) (st));	     \
@@ -221,7 +226,9 @@
 		mlog(ML_EXIT, "EXIT: %llu\n", (unsigned long long) (st));    \
 } while (0)
 #else
-#define mlog_exit(st) do { (void)(st); } while (0)
+#define mlog_exit(st) do {						     \
+	mlog(ML_EXIT, "EXIT: %lld\n", (long long) (st));		     \
+} while (0)
 #endif
 
 #define mlog_exit_ptr(ptr) do {						\

Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c	2005-05-24 18:45:36 UTC (rev 2313)
+++ trunk/fs/ocfs2/cluster/tcp.c	2005-05-24 21:30:33 UTC (rev 2314)
@@ -106,13 +106,17 @@
 #define MLOG_MASK_PREFIX ML_TCP
 #include "masklog.h"
 
+/* In the following two log macros, the whitespace after the ',' just
+ * before ##args is intentional. Otherwise, gcc 2.95 will eat the
+ * previous token if args expands to nothing.
+ */
 
 #define __msg_fmt "[mag %u len %u typ %u stat %d sys_stat %d key %u num %u] "
 #define __msg_args __hdr->magic, __hdr->data_len, __hdr->msg_type, 	\
  	__hdr->status,	__hdr->sys_status, __hdr->key, __hdr->msg_num
 #define msglog(hdr, fmt, args...) do {					\
 	typeof(hdr) __hdr = (hdr);					\
-	mlog(ML_MSG, __msg_fmt fmt, __msg_args, ##args);		\
+	mlog(ML_MSG, __msg_fmt fmt, __msg_args , ##args);		\
 } while (0)
 
 #define __sc_fmt 							\
@@ -123,7 +127,7 @@
 	!list_empty(&__sc->sc_item), __sc->sc_page, __sc->sc_page_off
 #define sclog(sc, fmt, args...) do {					\
 	typeof(sc) __sc = (sc);						\
-	mlog(ML_SOCKET, __sc_fmt fmt, __sc_args, ##args);		\
+	mlog(ML_SOCKET, __sc_fmt fmt, __sc_args , ##args);		\
 } while (0)
 
 



More information about the Ocfs2-commits mailing list