SUNRPC: Don't reuse bvec on retransmission of the request
[sfrench/cifs-2.6.git] / net / sunrpc / xprtsock.c
index eba1be9984f89ff6952bae6db23fcab4c17e514b..e976007f4fd00f2c6238c9756370dd3231f2c98a 100644 (file)
@@ -822,17 +822,9 @@ static int xs_stream_nospace(struct rpc_rqst *req, bool vm_wait)
        return ret;
 }
 
-static int
-xs_stream_prepare_request(struct rpc_rqst *req)
+static int xs_stream_prepare_request(struct rpc_rqst *req, struct xdr_buf *buf)
 {
-       gfp_t gfp = rpc_task_gfp_mask();
-       int ret;
-
-       ret = xdr_alloc_bvec(&req->rq_snd_buf, gfp);
-       if (ret < 0)
-               return ret;
-       xdr_free_bvec(&req->rq_rcv_buf);
-       return xdr_alloc_bvec(&req->rq_rcv_buf, gfp);
+       return xdr_alloc_bvec(buf, rpc_task_gfp_mask());
 }
 
 /*