[Ocfs2-commits] mfasheh commits r2031 - in trunk/fs/ocfs2: cluster dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Mar 21 18:49:11 CST 2005


Author: mfasheh
Signed-off-by: manish
Signed-off-by: jlbec
Date: 2005-03-21 18:49:10 -0600 (Mon, 21 Mar 2005)
New Revision: 2031

Modified:
   trunk/fs/ocfs2/cluster/Makefile
   trunk/fs/ocfs2/cluster/heartbeat.c
   trunk/fs/ocfs2/cluster/nodemanager.c
   trunk/fs/ocfs2/cluster/tcp.c
   trunk/fs/ocfs2/dlm/dlmmod.c
Log:
* make it easy to silence cluster/ output

* don't disable the output in dlm_print_nodes as that's going to be
  very useful for finding bugs during betas.

Signed-off-by: manish
Signed-off-by: jlbec



Modified: trunk/fs/ocfs2/cluster/Makefile
===================================================================
--- trunk/fs/ocfs2/cluster/Makefile	2005-03-21 23:53:02 UTC (rev 2030)
+++ trunk/fs/ocfs2/cluster/Makefile	2005-03-22 00:49:10 UTC (rev 2031)
@@ -20,6 +20,11 @@
 EXTRA_CFLAGS += -I$(OUR_TOPDIR)/fs/usysfs/
 # XXX should be folded into the kapi stuff
 EXTRA_CFLAGS += -I$(OUR_TOPDIR)/fs/usysfs/compatinclude
+ifneq ($(QUIET),1)
+EXTRA_CFLAGS += -DENABLE_HBPRINTK
+EXTRA_CFLAGS += -DENABLE_NMPRINTK
+EXTRA_CFLAGS += -DENABLE_NETPRINTK
+endif
 
 INSTALL_MOD_DIR := fs/ocfs2
 

Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c	2005-03-21 23:53:02 UTC (rev 2030)
+++ trunk/fs/ocfs2/cluster/heartbeat.c	2005-03-22 00:49:10 UTC (rev 2031)
@@ -91,13 +91,12 @@
 	struct semaphore sem;
 } hb_callbacks[HB_NUM_CB];
 
-//#if 0
-#define hbprintk(x, arg...)    printk("(hb:%d) " x, current->pid, ##arg)
-#define hbprintk0(x)           printk("(hb:%d) " x, current->pid)
-//#else
-#if 0
+#ifndef ENABLE_HBPRINTK
 #define hbprintk(x, arg...)    
 #define hbprintk0(x)           
+#else
+#define hbprintk(x, arg...)    printk("(hb:%d) " x, current->pid, ##arg)
+#define hbprintk0(x)           printk("(hb:%d) " x, current->pid)
 #endif
 
 #define HB_THREAD_MS                  2000   // every 2 seconds

Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c	2005-03-21 23:53:02 UTC (rev 2030)
+++ trunk/fs/ocfs2/cluster/nodemanager.c	2005-03-22 00:49:10 UTC (rev 2031)
@@ -74,11 +74,12 @@
  * cluster references throughout where nodes are looked up */
 static struct nm_cluster *nm_single_cluster = NULL;
 
+#ifndef ENABLE_NMPRINTK
+#define nmprintk(x, arg...)
+#define nmprintk0(x)
+#else
 #define nmprintk(x, arg...)    printk("(nm:%d) " x, current->pid, ##arg)
 #define nmprintk0(x)           printk("(nm:%d) " x, current->pid)
-#if 0
-#define nmprintk(x, arg...)
-#define nmprintk0(x)
 #endif
 
 struct nm_cluster {

Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c	2005-03-21 23:53:02 UTC (rev 2030)
+++ trunk/fs/ocfs2/cluster/tcp.c	2005-03-22 00:49:10 UTC (rev 2031)
@@ -109,7 +109,12 @@
 #include "tcp.h"
 #include "nodemanager.h"
 
-#if 0
+#ifndef ENABLE_NETPRINTK
+#define netprintk(x, arg...)    
+#define netprintk0(x)           
+#define msgprintk(hdr, fmt, args...)
+#define msgprintk0(hdr, fmt)
+#else
 #define netprintk(x, arg...)    printk("(tcp:%d)(%s:%d) " x, current->pid, __FUNCTION__, __LINE__, ##arg)
 #define netprintk0(x)           printk("(tcp:%d)(%s:%d) " x, current->pid, __FUNCTION__, __LINE__)
 /* yeah, a little gross, but it gets the job done */
@@ -124,12 +129,6 @@
 	typeof(hdr) __hdr = (hdr);					\
 	printk(__msg_fmt fmt, __msg_args);				\
 } while (0)
-
-#else
-#define netprintk(x, arg...)    
-#define netprintk0(x)           
-#define msgprintk(hdr, fmt, args...)
-#define msgprintk0(hdr, fmt)
 #endif
 
 /* let's only pollute this unit with these ridiculous definitions */

Modified: trunk/fs/ocfs2/dlm/dlmmod.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmod.c	2005-03-21 23:53:02 UTC (rev 2030)
+++ trunk/fs/ocfs2/dlm/dlmmod.c	2005-03-22 00:49:10 UTC (rev 2031)
@@ -946,13 +946,13 @@
 
 	assert_spin_locked(&dlm->spinlock);
 
-	dlmprintk("Nodes in my domain (\"%s\"):\n", dlm->name);
+	printk("ocfs2_dlm: Nodes in my domain (\"%s\"):\n", dlm->name);
 
 	while ((node = find_next_bit(dlm->domain_map, NM_MAX_NODES, node + 1))
 	       != -1) {
 		if (node >= NM_MAX_NODES)
 			break;
-		dlmprintk(" node %d\n", node);
+		printk(" node %d\n", node);
 	}
 }
 



More information about the Ocfs2-commits mailing list