Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / include / linux / sunrpc / svc.h
index 3700397..5035643 100644 (file)
@@ -171,7 +171,8 @@ xdr_argsize_check(struct svc_rqst *rqstp, u32 *p)
 {
        char *cp = (char *)p;
        struct kvec *vec = &rqstp->rq_arg.head[0];
-       return cp - (char*)vec->iov_base <= vec->iov_len;
+       return cp >= (char*)vec->iov_base
+               && cp <= (char*)vec->iov_base + vec->iov_len;
 }
 
 static inline int
@@ -185,15 +186,27 @@ xdr_ressize_check(struct svc_rqst *rqstp, u32 *p)
        return vec->iov_len <= PAGE_SIZE;
 }
 
-static inline int svc_take_page(struct svc_rqst *rqstp)
+static inline struct page *
+svc_take_res_page(struct svc_rqst *rqstp)
 {
        if (rqstp->rq_arghi <= rqstp->rq_argused)
-               return -ENOMEM;
+               return NULL;
+       rqstp->rq_arghi--;
+       rqstp->rq_respages[rqstp->rq_resused] =
+               rqstp->rq_argpages[rqstp->rq_arghi];
+       return rqstp->rq_respages[rqstp->rq_resused++];
+}
+
+static inline void svc_take_page(struct svc_rqst *rqstp)
+{
+       if (rqstp->rq_arghi <= rqstp->rq_argused) {
+               WARN_ON(1);
+               return;
+       }
        rqstp->rq_arghi--;
        rqstp->rq_respages[rqstp->rq_resused] =
                rqstp->rq_argpages[rqstp->rq_arghi];
        rqstp->rq_resused++;
-       return 0;
 }
 
 static inline void svc_pushback_allpages(struct svc_rqst *rqstp)
@@ -234,15 +247,17 @@ struct svc_deferred_req {
        u32                     prot;   /* protocol (UDP or TCP) */
        struct sockaddr_in      addr;
        struct svc_sock         *svsk;  /* where reply must go */
+       u32                     daddr;  /* where reply must come from */
        struct cache_deferred_req handle;
        int                     argslen;
        u32                     args[0];
 };
 
 /*
- * RPC program
+ * List of RPC programs on the same transport endpoint
  */
 struct svc_program {
+       struct svc_program *    pg_next;        /* other programs (same xprt) */
        u32                     pg_prog;        /* program number */
        unsigned int            pg_lovers;      /* lowest version */
        unsigned int            pg_hivers;      /* lowest version */