VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / net / sunrpc / svcsock.c
index 024e768..d2d8e9b 100644 (file)
@@ -125,7 +125,7 @@ svc_sock_wspace(struct svc_sock *svsk)
        int wspace;
 
        if (svsk->sk_sock->type == SOCK_STREAM)
-               wspace = tcp_wspace(svsk->sk_sk);
+               wspace = sk_stream_wspace(svsk->sk_sk);
        else
                wspace = sock_wspace(svsk->sk_sk);
 
@@ -414,7 +414,6 @@ svc_sendto(struct svc_rqst *rqstp, struct xdr_buf *xdr)
        }
        /* send tail */
        if (xdr->tail[0].iov_len) {
-               /* The tail *will* be in respages[0]; */
                result = sock->ops->sendpage(sock, rqstp->rq_respages[rqstp->rq_restailpage], 
                                             ((unsigned long)xdr->tail[0].iov_base)& (PAGE_SIZE-1),
                                             xdr->tail[0].iov_len, 0);
@@ -451,9 +450,8 @@ svc_recv_available(struct svc_sock *svsk)
  * Generic recvfrom routine.
  */
 static int
-svc_recvfrom(struct svc_rqst *rqstp, struct iovec *iov, int nr, int buflen)
+svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen)
 {
-       mm_segment_t    oldfs;
        struct msghdr   msg;
        struct socket   *sock;
        int             len, alen;
@@ -463,16 +461,12 @@ svc_recvfrom(struct svc_rqst *rqstp, struct iovec *iov, int nr, int buflen)
 
        msg.msg_name    = &rqstp->rq_addr;
        msg.msg_namelen = sizeof(rqstp->rq_addr);
-       msg.msg_iov     = iov;
-       msg.msg_iovlen  = nr;
        msg.msg_control = NULL;
        msg.msg_controllen = 0;
 
        msg.msg_flags   = MSG_DONTWAIT;
 
-       oldfs = get_fs(); set_fs(KERNEL_DS);
-       len = sock_recvmsg(sock, &msg, buflen, MSG_DONTWAIT);
-       set_fs(oldfs);
+       len = kernel_recvmsg(sock, &msg, iov, nr, buflen, MSG_DONTWAIT);
 
        /* sock_recvmsg doesn't fill in the name/namelen, so we must..
         * possibly we should cache this in the svc_sock structure
@@ -899,7 +893,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
        struct svc_sock *svsk = rqstp->rq_sock;
        struct svc_serv *serv = svsk->sk_server;
        int             len;
-       struct iovec vec[RPCSVC_MAXPAGES];
+       struct kvec vec[RPCSVC_MAXPAGES];
        int pnum, vlen;
 
        dprintk("svc: tcp_recv %p data %d conn %d close %d\n",
@@ -943,7 +937,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
         */
        if (svsk->sk_tcplen < 4) {
                unsigned long   want = 4 - svsk->sk_tcplen;
-               struct iovec    iov;
+               struct kvec     iov;
 
                iov.iov_base = ((char *) &svsk->sk_reclen) + svsk->sk_tcplen;
                iov.iov_len  = want;
@@ -1017,7 +1011,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
                rqstp->rq_arg.page_len = len - rqstp->rq_arg.head[0].iov_len;
        }
 
-       rqstp->rq_skbuff      = 0;
+       rqstp->rq_skbuff      = NULL;
        rqstp->rq_prot        = IPPROTO_TCP;
 
        /* Reset TCP read info */
@@ -1057,8 +1051,8 @@ svc_tcp_sendto(struct svc_rqst *rqstp)
        int sent;
        u32 reclen;
 
-       /* Set up the first element of the reply iovec.
-        * Any other iovecs that may be in use have been taken
+       /* Set up the first element of the reply kvec.
+        * Any other kvecs that may be in use have been taken
         * care of by the server implementation itself.
         */
        reclen = htonl(0x80000000|((xbufp->len ) - 4));