[Ocfs2-commits] zab commits r2524 - trunk/fs/ocfs2/cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Aug 18 16:07:34 CDT 2005


Author: zab
Signed-off-by: mfasheh
Date: 2005-08-18 16:07:33 -0500 (Thu, 18 Aug 2005)
New Revision: 2524

Modified:
   trunk/fs/ocfs2/cluster/tcp.c
Log:
o more consistently print node descriptions with name/num/ip:port

Signed-off-by: mfasheh



Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c	2005-08-18 19:02:05 UTC (rev 2523)
+++ trunk/fs/ocfs2/cluster/tcp.c	2005-08-18 21:07:33 UTC (rev 2524)
@@ -71,6 +71,11 @@
 
 #include "tcp_internal.h"
 
+#define SC_NODEF_FMT "node %s (num %u) at %u.%u.%u.%u:%u"
+#define SC_NODEF_ARGS(sc) sc->sc_node->nd_name, sc->sc_node->nd_num,	\
+			  NIPQUAD(sc->sc_node->nd_ipv4_address),	\
+			  ntohs(sc->sc_node->nd_ipv4_port)
+
 /*
  * In the following two log macros, the whitespace after the ',' just
  * before ##args is intentional. Otherwise, gcc 2.95 will eat the
@@ -394,11 +399,8 @@
 	}
 
 	if (was_valid && !valid) {
-		mlog(ML_NOTICE, "no longer connected to "
-		       "node %s at %u.%u.%u.%u:%d\n",
-		       old_sc->sc_node->nd_name,
-		       NIPQUAD(old_sc->sc_node->nd_ipv4_address),
-		       ntohs(old_sc->sc_node->nd_ipv4_port));
+		mlog(ML_NOTICE, "no longer connected to " SC_NODEF_FMT "\n",
+		     SC_NODEF_ARGS(old_sc));
 		o2net_complete_nodes_nsw(nn);
 	}
 
@@ -410,12 +412,10 @@
 		 * the only way to start connecting again is to down
 		 * heartbeat and bring it back up. */
 		cancel_delayed_work(&nn->nn_connect_expired);
-		mlog(ML_NOTICE, "%s node %s num %u at %u.%u.%u.%u:%d\n",
+		mlog(ML_NOTICE, "%s " SC_NODEF_FMT "\n", 
 		     o2nm_this_node() > sc->sc_node->nd_num ?
 		     	"connected to" : "accepted connection from",
-		     sc->sc_node->nd_name, sc->sc_node->nd_num,
-		     NIPQUAD(sc->sc_node->nd_ipv4_address),
-		     ntohs(sc->sc_node->nd_ipv4_port));
+		     SC_NODEF_ARGS(sc));
 	}
 
 	/* trigger the connecting worker func as long as we're not valid,
@@ -825,8 +825,8 @@
 					 (long)kmalloced_virt & ~PAGE_MASK,
 					 size, MSG_DONTWAIT);
 	if (ret != size) {
-		mlog(ML_ERROR, "sendpage of size %zu failed with %zd\n",
-		     size, ret);
+		mlog(ML_ERROR, "sendpage of size %zu to " SC_NODEF_FMT 
+		     " failed with %zd\n", size, SC_NODEF_ARGS(sc), ret);
 		o2net_ensure_shutdown(nn, sc, 0);
 	}
 }
@@ -1099,13 +1099,11 @@
 	struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num);
 
 	if (hand->protocol_version != cpu_to_be64(O2NET_PROTOCOL_VERSION)) {
-		mlog(ML_NOTICE, "node %s at %u.%u.%u.%u:%u advertised "
-		     "net protocol version %llu but %llu is required,"
-		     "disconnecting\n", sc->sc_node->nd_name,
-		       NIPQUAD(sc->sc_node->nd_ipv4_address),
-		       ntohs(sc->sc_node->nd_ipv4_port),
-		       (unsigned long long)be64_to_cpu(hand->protocol_version),
-		       O2NET_PROTOCOL_VERSION);
+		mlog(ML_NOTICE, SC_NODEF_FMT " advertised net protocol "
+		     "version %llu but %llu is required, disconnecting\n",
+		     SC_NODEF_ARGS(sc),
+		     (unsigned long long)be64_to_cpu(hand->protocol_version),
+		     O2NET_PROTOCOL_VERSION);
 
 		/* don't bother reconnecting if its the wrong version. */
 		o2net_ensure_shutdown(nn, sc, -ENOTCONN);
@@ -1290,11 +1288,8 @@
 {
 	struct o2net_sock_container *sc = (struct o2net_sock_container *)data;
 
-	mlog(ML_NOTICE, "connection to node %s num %u at %u.%u.%u.%u:%d has "
-	     "been idle for 10 seconds, shutting it down.\n",
-	     sc->sc_node->nd_name, sc->sc_node->nd_num,
-	     NIPQUAD(sc->sc_node->nd_ipv4_address),
-	     ntohs(sc->sc_node->nd_ipv4_port));
+	mlog(ML_NOTICE, "connection to " SC_NODEF_FMT " has been idle for 10 "
+	     "seconds, shutting it down.\n", SC_NODEF_ARGS(sc));
 
 	o2net_sc_queue_work(sc, &sc->sc_shutdown_work);
 }
@@ -1393,11 +1388,8 @@
 
 out:
 	if (ret) {
-		mlog(ML_NOTICE, "connect attempt to node %s num %u at "
-		     "%u.%u.%u.%u:%d failed with errno %d\n",
-		     sc->sc_node->nd_name, sc->sc_node->nd_num,
-		     NIPQUAD(sc->sc_node->nd_ipv4_address),
-		     ntohs(sc->sc_node->nd_ipv4_port), ret);
+		mlog(ML_NOTICE, "connect attempt to " SC_NODEF_FMT " failed "
+		     "with errno %d\n", SC_NODEF_ARGS(sc), ret);
 		/* 0 err so that another will be queued and attempted
 		 * from set_nn_state */
 		if (sc)



More information about the Ocfs2-commits mailing list