patch-2.4.0-test12 linux/include/linux/sunrpc/xprt.h

Next file: linux/include/linux/swap.h
Previous file: linux/include/linux/sunrpc/sched.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test11/linux/include/linux/sunrpc/xprt.h linux/include/linux/sunrpc/xprt.h
@@ -138,8 +138,7 @@
 	struct rpc_wait_queue	reconn;		/* waiting for reconnect */
 	struct rpc_rqst *	free;		/* free slots */
 	struct rpc_rqst		slot[RPC_MAXREQS];
-	volatile unsigned char	connected  : 1,	/* TCP: connected */
-				write_space: 1;	/* TCP: can send */
+	unsigned int		sockstate;	/* Socket state */
 	unsigned char		shutdown   : 1,	/* being shut down */
 				nocong	   : 1,	/* no congestion control */
 				stream     : 1,	/* TCP */
@@ -189,6 +188,18 @@
 void			__rpciod_tcp_dispatcher(void);
 
 extern struct list_head	rpc_xprt_pending;
+
+#define XPRT_WSPACE	0
+#define XPRT_CONNECT	1
+
+#define xprt_wspace(xp)			(test_bit(XPRT_WSPACE, &(xp)->sockstate))
+#define xprt_test_and_set_wspace(xp)	(test_and_set_bit(XPRT_WSPACE, &(xp)->sockstate))
+#define xprt_clear_wspace(xp)		(clear_bit(XPRT_WSPACE, &(xp)->sockstate))
+
+#define xprt_connected(xp)		(!(xp)->stream || test_bit(XPRT_CONNECT, &(xp)->sockstate))
+#define xprt_set_connected(xp)		(set_bit(XPRT_CONNECT, &(xp)->sockstate))
+#define xprt_test_and_set_connected(xp)	(test_and_set_bit(XPRT_CONNECT, &(xp)->sockstate))
+#define xprt_clear_connected(xp)	(clear_bit(XPRT_CONNECT, &(xp)->sockstate))
 
 static inline
 int xprt_tcp_pending(void)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)