Merge tag 'upstream-4.6-rc1' of git://git.infradead.org/linux-ubifs
[deliverable/linux.git] / fs / nfs / callback_xdr.c
index beac58b0e09cbbb0a3cc74fbb55bfe6853c1d616..976c90608e5618103d385a3436cafe461873a867 100644 (file)
@@ -78,8 +78,7 @@ static __be32 *read_buf(struct xdr_stream *xdr, int nbytes)
 
        p = xdr_inline_decode(xdr, nbytes);
        if (unlikely(p == NULL))
-               printk(KERN_WARNING "NFS: NFSv4 callback reply buffer overflowed "
-                                                       "or truncated request.\n");
+               printk(KERN_WARNING "NFS: NFSv4 callback reply buffer overflowed!\n");
        return p;
 }
 
@@ -753,7 +752,8 @@ preprocess_nfs41_op(int nop, unsigned int op_nr, struct callback_op **op)
        return htonl(NFS_OK);
 }
 
-static void nfs4_callback_free_slot(struct nfs4_session *session)
+static void nfs4_callback_free_slot(struct nfs4_session *session,
+               struct nfs4_slot *slot)
 {
        struct nfs4_slot_table *tbl = &session->bc_slot_table;
 
@@ -762,15 +762,17 @@ static void nfs4_callback_free_slot(struct nfs4_session *session)
         * Let the state manager know callback processing done.
         * A single slot, so highest used slotid is either 0 or -1
         */
-       tbl->highest_used_slotid = NFS4_NO_SLOT;
+       nfs4_free_slot(tbl, slot);
        nfs4_slot_tbl_drain_complete(tbl);
        spin_unlock(&tbl->slot_tbl_lock);
 }
 
 static void nfs4_cb_free_slot(struct cb_process_state *cps)
 {
-       if (cps->slotid != NFS4_NO_SLOT)
-               nfs4_callback_free_slot(cps->clp->cl_session);
+       if (cps->slot) {
+               nfs4_callback_free_slot(cps->clp->cl_session, cps->slot);
+               cps->slot = NULL;
+       }
 }
 
 #else /* CONFIG_NFS_V4_1 */
@@ -890,20 +892,17 @@ static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *r
        struct cb_compound_hdr_arg hdr_arg = { 0 };
        struct cb_compound_hdr_res hdr_res = { NULL };
        struct xdr_stream xdr_in, xdr_out;
-       struct xdr_buf *rq_arg = &rqstp->rq_arg;
        __be32 *p, status;
        struct cb_process_state cps = {
                .drc_status = 0,
                .clp = NULL,
-               .slotid = NFS4_NO_SLOT,
                .net = SVC_NET(rqstp),
        };
        unsigned int nops = 0;
 
        dprintk("%s: start\n", __func__);
 
-       rq_arg->len = rq_arg->head[0].iov_len + rq_arg->page_len;
-       xdr_init_decode(&xdr_in, rq_arg, rq_arg->head[0].iov_base);
+       xdr_init_decode(&xdr_in, &rqstp->rq_arg, rqstp->rq_arg.head[0].iov_base);
 
        p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len);
        xdr_init_encode(&xdr_out, &rqstp->rq_res, p);
This page took 0.027576 seconds and 5 git commands to generate.