All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Tucker <tom@opengridcomputing.com>
To: nfs@lists.sourceforge.net
Cc: neilb@suse.de, bfields@fieldses.org, gnb@sgi.com
Subject: [RFC, PATCH 30/35] svc: Removing remaining references to rq_sock in rqstp
Date: Mon, 01 Oct 2007 14:28:36 -0500	[thread overview]
Message-ID: <20071001192836.3250.72057.stgit@dell3.ogc.int> (raw)
In-Reply-To: <20071001191426.3250.15371.stgit@dell3.ogc.int>


This functionally empty patch removes rq_sock and unamed union 
from rqstp structure. 

Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
---

 include/linux/sunrpc/svc.h |    5 +----
 net/sunrpc/svcsock.c       |   38 ++++++++++++++++++++++++--------------
 2 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 40adc9d..04eb20e 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -204,10 +204,7 @@ union svc_addr_u {
 struct svc_rqst {
 	struct list_head	rq_list;	/* idle list */
 	struct list_head	rq_all;		/* all threads list */
-	union {
-		struct svc_xprt *	rq_xprt;	/* transport ptr */
-		struct svc_sock *	rq_sock; 	/* socket ptr */
-	};
+	struct svc_xprt *	rq_xprt;	/* transport ptr */
 	struct sockaddr_storage	rq_addr;	/* peer address */
 	size_t			rq_addrlen;
 
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index f1ea6f7..0f57426 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -197,10 +197,12 @@ svc_release_skb(struct svc_rqst *rqstp)
 	struct svc_deferred_req *dr = rqstp->rq_deferred;
 
 	if (skb) {
+		struct svc_sock *svsk =
+			container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt);
 		rqstp->rq_xprt_ctxt = NULL;
 
 		dprintk("svc: service %p, releasing skb %p\n", rqstp, skb);
-		skb_free_datagram(rqstp->rq_sock->sk_sk, skb);
+		skb_free_datagram(svsk->sk_sk, skb);
 	}
 	if (dr) {
 		rqstp->rq_deferred = NULL;
@@ -429,7 +431,7 @@ svc_wake_up(struct svc_serv *serv)
 			dprintk("svc: daemon %p woken up.\n", rqstp);
 			/*
 			svc_thread_dequeue(pool, rqstp);
-			rqstp->rq_sock = NULL;
+			rqstp->rq_xprt = NULL;
 			 */
 			wake_up(&rqstp->rq_wait);
 		}
@@ -446,7 +448,9 @@ #define SVC_PKTINFO_SPACE \
 
 static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh)
 {
-	switch (rqstp->rq_sock->sk_sk->sk_family) {
+	struct svc_sock *svsk =
+		container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt);
+	switch (svsk->sk_sk->sk_family) {
 	case AF_INET: {
 			struct in_pktinfo *pki = CMSG_DATA(cmh);
 
@@ -479,7 +483,8 @@ static void svc_set_cmsg_data(struct svc
 static int
 svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
 {
-	struct svc_sock	*svsk = rqstp->rq_sock;
+	struct svc_sock	*svsk =
+		container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt);
 	struct socket	*sock = svsk->sk_sock;
 	int		slen;
 	union {
@@ -552,7 +557,7 @@ svc_sendto(struct svc_rqst *rqstp, struc
 	}
 out:
 	dprintk("svc: socket %p sendto([%p %Zu... ], %d) = %d (addr %s)\n",
-		rqstp->rq_sock, xdr->head[0].iov_base, xdr->head[0].iov_len,
+		svsk, xdr->head[0].iov_base, xdr->head[0].iov_len,
 		xdr->len, len, svc_print_addr(rqstp, buf, sizeof(buf)));
 
 	return len;
@@ -628,7 +633,8 @@ svc_recv_available(struct svc_sock *svsk
 static int
 svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen)
 {
-	struct svc_sock *svsk = rqstp->rq_sock;
+	struct svc_sock *svsk =
+		container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt);
 	struct msghdr msg = {
 		.msg_flags	= MSG_DONTWAIT,
 	};
@@ -711,7 +717,9 @@ svc_write_space(struct sock *sk)
 static inline void svc_udp_get_dest_address(struct svc_rqst *rqstp,
 					    struct cmsghdr *cmh)
 {
-	switch (rqstp->rq_sock->sk_sk->sk_family) {
+	struct svc_sock *svsk =
+		container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt);
+	switch (svsk->sk_sk->sk_family) {
 	case AF_INET: {
 		struct in_pktinfo *pki = CMSG_DATA(cmh);
 		rqstp->rq_daddr.addr.s_addr = pki->ipi_spec_dst.s_addr;
@@ -731,7 +739,8 @@ static inline void svc_udp_get_dest_addr
 static int
 svc_udp_recvfrom(struct svc_rqst *rqstp)
 {
-	struct svc_sock	*svsk = rqstp->rq_sock;
+	struct svc_sock	*svsk =
+		container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt);
 	struct svc_serv	*serv = svsk->sk_xprt.xpt_server;
 	struct sk_buff	*skb;
 	union {
@@ -1118,7 +1127,8 @@ failed:
 static int
 svc_tcp_recvfrom(struct svc_rqst *rqstp)
 {
-	struct svc_sock	*svsk = rqstp->rq_sock;
+	struct svc_sock	*svsk =
+		container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt);
 	struct svc_serv	*serv = svsk->sk_xprt.xpt_server;
 	int		len;
 	struct kvec *vec;
@@ -1281,16 +1291,16 @@ svc_tcp_sendto(struct svc_rqst *rqstp)
 	reclen = htonl(0x80000000|((xbufp->len ) - 4));
 	memcpy(xbufp->head[0].iov_base, &reclen, 4);
 
-	if (test_bit(XPT_DEAD, &rqstp->rq_sock->sk_xprt.xpt_flags))
+	if (test_bit(XPT_DEAD, &rqstp->rq_xprt->xpt_flags))
 		return -ENOTCONN;
 
 	sent = svc_sendto(rqstp, &rqstp->rq_res);
 	if (sent != xbufp->len) {
 		printk(KERN_NOTICE "rpc-srv/tcp: %s: %s %d when sending %d bytes - shutting down socket\n",
-		       rqstp->rq_sock->sk_xprt.xpt_server->sv_name,
+		       rqstp->rq_xprt->xpt_server->sv_name,
 		       (sent<0)?"got error":"sent only",
 		       sent, xbufp->len);
-		set_bit(XPT_CLOSE, &rqstp->rq_sock->sk_xprt.xpt_flags);
+		set_bit(XPT_CLOSE, &rqstp->rq_xprt->xpt_flags);
 		svc_xprt_enqueue(rqstp->rq_xprt);
 		sent = -EAGAIN;
 	}
@@ -1312,7 +1322,7 @@ svc_tcp_prep_reply_hdr(struct svc_rqst *
 static int
 svc_tcp_has_wspace(struct svc_xprt *xprt)
 {
-	struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt);
+	struct svc_sock *svsk =	container_of(xprt, struct svc_sock, sk_xprt);
 	struct svc_serv	*serv = svsk->sk_xprt.xpt_server;
 	int required;
 
@@ -1655,7 +1665,7 @@ svc_recv(struct svc_rqst *rqstp, long ti
 void
 svc_drop(struct svc_rqst *rqstp)
 {
-	dprintk("svc: socket %p dropped request\n", rqstp->rq_sock);
+	dprintk("svc: xprt %p dropped request\n", rqstp->rq_xprt);
 	svc_xprt_release(rqstp);
 }
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  parent reply	other threads:[~2007-10-01 19:28 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-01 19:14 [RFC,PATCH 00/35] SVC Transport Switch Tom Tucker
2007-10-01 19:27 ` [RFC,PATCH 01/35] svc: Add an svc transport class Tom Tucker
2007-10-01 19:27 ` [RFC,PATCH 02/35] svc: Make svc_sock the tcp/udp transport Tom Tucker
2007-10-01 19:27 ` [RFC, PATCH 03/35] svc: Change the svc_sock in the rqstp structure to a transport Tom Tucker
2007-10-01 19:27 ` [RFC, PATCH 04/35] svc: Add a max payload value to the transport Tom Tucker
2007-10-02 14:54   ` Chuck Lever
2007-10-02 16:28     ` Tom Tucker
2007-10-03 11:09       ` Greg Banks
2007-10-03 14:26         ` Tom Tucker
2007-10-03 15:18           ` Chuck Lever
2007-10-04  1:10           ` Greg Banks
2007-10-01 19:27 ` [RFC, PATCH 05/35] svc: Move sk_sendto and sk_recvfrom to svc_xprt_class Tom Tucker
2007-10-02 15:04   ` Chuck Lever
2007-10-02 16:29     ` Tom Tucker
2007-10-02 16:57       ` Chuck Lever
2007-10-02 18:24         ` Tom Tucker
2007-10-02 18:30           ` Tom Tucker
2007-10-02 18:47             ` Chuck Lever
2007-10-02 19:55               ` Tom Tucker
2007-10-02 20:29                 ` Chuck Lever
2007-10-02 20:35                   ` Tom Tucker
2007-10-02 20:38                     ` Tom Tucker
2007-10-04  1:34                 ` Greg Banks
2007-10-04  1:21             ` Greg Banks
2007-10-03 11:13       ` Greg Banks
2007-10-01 19:27 ` [RFC, PATCH 06/35] svc: Add transport specific xpo_release function Tom Tucker
2007-10-02 15:18   ` Chuck Lever
2007-10-02 16:35     ` Tom Tucker
2007-10-04  1:48     ` Greg Banks
2007-10-01 19:27 ` [RFC,PATCH 07/35] svc: Add per-transport delete functions Tom Tucker
2007-10-01 19:27 ` [RFC,PATCH 08/35] svc: Add xpo_prep_reply_hdr Tom Tucker
2007-10-01 19:27 ` [RFC, PATCH 09/35] svc: Add a transport function that checks for write space Tom Tucker
2007-10-01 19:27 ` [RFC, PATCH 10/35] svc: Move close processing to a single place Tom Tucker
2007-10-01 19:27 ` [RFC,PATCH 11/35] svc: Add xpo_accept transport function Tom Tucker
2007-10-02 15:33   ` Chuck Lever
2007-10-02 16:41     ` Tom Tucker
2007-10-02 17:07       ` Chuck Lever
2007-10-02 18:28         ` Tom Tucker
2007-10-02 18:49           ` Chuck Lever
2007-10-04  1:54           ` Greg Banks
2007-10-01 19:27 ` [RFC, PATCH 12/35] svc: Add a generic transport svc_create_xprt function Tom Tucker
2007-10-02 15:39   ` Chuck Lever
2007-10-03 20:01     ` Tom Tucker
2007-10-03 20:04       ` Tom Tucker
2007-10-04  2:30     ` Greg Banks
2007-10-04 15:18       ` Chuck Lever
2007-10-01 19:27 ` [RFC, PATCH 13/35] svc: Change services to use new svc_create_xprt service Tom Tucker
2007-10-02 15:44   ` Chuck Lever
2007-10-02 16:45     ` Tom Tucker
2007-10-03 15:25       ` Chuck Lever
2007-10-03 16:23         ` Tom Tucker
2007-10-04  2:35     ` Greg Banks
2007-10-04 14:27       ` Tom Tucker
2007-10-09 17:09   ` J. Bruce Fields
2007-10-09 18:32     ` Tom Tucker
2007-10-09 19:49       ` J. Bruce Fields
2007-10-09 20:19       ` J. Bruce Fields
2007-10-01 19:28 ` [RFC,PATCH 14/35] svc: Change sk_inuse to a kref Tom Tucker
2007-10-03 11:12   ` Christoph Hellwig
2007-10-03 14:39     ` Tom Tucker
2007-10-03 14:45     ` J. Bruce Fields
2007-10-03 14:52       ` Christoph Hellwig
2007-10-03 15:11         ` J. Bruce Fields
2007-10-03 15:15           ` Christoph Hellwig
2007-10-08  3:52             ` Neil Brown
2007-10-03 15:13         ` Chuck Lever
2007-10-03 15:34           ` J. Bruce Fields
2007-10-04  2:51             ` Greg Banks
2007-10-01 19:28 ` [RFC, PATCH 15/35] svc: Move sk_flags to the svc_xprt structure Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 16/35] svc: Move sk_server and sk_pool to svc_xprt Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 17/35] svc: Make close transport independent Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 18/35] svc: Move sk_reserved to svc_xprt Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 19/35] svc: Make the enqueue service transport neutral and export it Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 20/35] svc: Make svc_send transport neutral Tom Tucker
2007-10-02 16:15   ` Chuck Lever
2007-10-02 16:46     ` Tom Tucker
2007-10-02 16:54       ` Chuck Lever
2007-10-04  2:59         ` Greg Banks
2007-10-01 19:28 ` [RFC, PATCH 21/35] svc: Change svc_sock_received to svc_xprt_received and export it Tom Tucker
2007-10-02 16:18   ` Chuck Lever
2007-10-01 19:28 ` [RFC,PATCH 22/35] svc: Remove sk_lastrecv Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 23/35] svc: Move the authinfo cache to svc_xprt Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 24/35] svc: Make deferral processing xprt independent Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 25/35] svc: Move the sockaddr information to svc_xprt Tom Tucker
2007-10-02 16:34   ` Chuck Lever
2007-10-02 16:50     ` Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 26/35] svc: Make svc_sock_release svc_xprt_release Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 27/35] svc: Make svc_recv transport neutral Tom Tucker
2007-10-02 16:36   ` Chuck Lever
2007-10-01 19:28 ` [RFC, PATCH 28/35] svc: Make svc_age_temp_sockets svc_age_temp_transports Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 29/35] svc: Move common create logic to common code Tom Tucker
2007-10-02 16:42   ` Chuck Lever
2007-10-02 16:51     ` Tom Tucker
2007-10-01 19:28 ` Tom Tucker [this message]
2007-10-01 19:28 ` [RFC, PATCH 31/35] svc: Make svc_check_conn_limits xprt independent Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 32/35] svc: Move the xprt independent code to the svc_xprt.c file Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 33/35] svc: Add transport hdr size for defer/revisit Tom Tucker
2007-10-01 19:28 ` [RFC,PATCH 34/35] svc: Add /proc/sys/sunrpc/transport files Tom Tucker
2007-10-01 19:28 ` [RFC, PATCH 35/35] knfsd: Support adding transports by writing portlist file Tom Tucker
2007-10-02 15:25 ` [RFC,PATCH 00/35] SVC Transport Switch J. Bruce Fields
2007-10-02 16:18   ` Tom Tucker
2007-10-03 11:03 ` Greg Banks
2007-10-03 14:02   ` Tom Tucker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071001192836.3250.72057.stgit@dell3.ogc.int \
    --to=tom@opengridcomputing.com \
    --cc=bfields@fieldses.org \
    --cc=gnb@sgi.com \
    --cc=neilb@suse.de \
    --cc=nfs@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.