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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Jun 1 18:15:27 CDT 2005


Author: zab
Signed-off-by: mfasheh
Date: 2005-06-01 18:15:25 -0500 (Wed, 01 Jun 2005)
New Revision: 2350

Modified:
   trunk/fs/ocfs2/cluster/tcp.c
Log:
o don't poke around in tcp's innards with tcp_sk().  This avoids being 
  exposed to innard-drift between -mm-current and distros.

Signed-off-by: mfasheh


Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c	2005-06-01 22:33:46 UTC (rev 2349)
+++ trunk/fs/ocfs2/cluster/tcp.c	2005-06-01 23:15:25 UTC (rev 2350)
@@ -82,6 +82,7 @@
 #include <linux/slab.h>
 #include <linux/kthread.h>
 #include <linux/kref.h>
+#include <net/tcp.h>
 
 #include <asm/uaccess.h>
 
@@ -416,7 +417,7 @@
 		list_empty(&o2net_attach_list);
 	spin_unlock_bh(&o2net_active_lock);
 
-	return !empty || tcp_sk(sock->sk)->accept_queue;
+	return !empty || tcp_poll(NULL, sock, NULL);
 }
 
 static int o2net_receive_thread(void *data)
@@ -1235,11 +1236,11 @@
  */
 static int o2net_attach_sc(struct o2net_sock_container *sc)
 {
-	struct sock *sk;
-	int ret = 0;
+	int ret = 0, opt = 1;
 	u8 this_node = nm_this_node(); /* :( */
 	struct o2net_sock_container *detach = NULL;
 	struct nm_node *node = sc->sc_node;
+	mm_segment_t oldfs;
 
 	sclog(sc, "attaching with node %p\n", node);
 
@@ -1294,10 +1295,14 @@
 		detach = NULL;
 	}
 
-	sk = sc->sc_sock->sk;
-	tcp_sk(sk)->nonagle = 1;
-	sk_register_callbacks(sk, sc);
+	oldfs = get_fs();
+	set_fs(KERNEL_DS);
+	ret = sc->sc_sock->ops->setsockopt(sc->sc_sock, SOL_TCP, TCP_NODELAY,
+					   (char __user *)&opt, sizeof(opt));
+	set_fs(oldfs);
 
+	sk_register_callbacks(sc->sc_sock->sk, sc);
+
 	/* record it as active initially to make sure we didn't miss
 	 * any incoming data while we were setting it up */
 	spin_lock_bh(&o2net_active_lock);



More information about the Ocfs2-commits mailing list