Commit dd2b63d0 authored by Ricardo Labiaga's avatar Ricardo Labiaga Committed by Benny Halevy

nfs41: Rename rq_received to rq_reply_bytes_recvd

The 'rq_received' member of 'struct rpc_rqst' is used to track when we
have received a reply to our request.  With v4.1, the backchannel
can now accept callback requests over the existing connection.  Rename
this field to make it clear that it is only used for tracking reply bytes
and not all bytes received on the connection.
Signed-off-by: default avatarRicardo Labiaga <Ricardo.Labiaga@netapp.com>
Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
parent 281fe15d
...@@ -67,7 +67,8 @@ struct rpc_rqst { ...@@ -67,7 +67,8 @@ struct rpc_rqst {
struct rpc_task * rq_task; /* RPC task data */ struct rpc_task * rq_task; /* RPC task data */
__be32 rq_xid; /* request XID */ __be32 rq_xid; /* request XID */
int rq_cong; /* has incremented xprt->cong */ int rq_cong; /* has incremented xprt->cong */
int rq_received; /* receive completed */ int rq_reply_bytes_recvd; /* number of reply */
/* bytes received */
u32 rq_seqno; /* gss seq no. used on req. */ u32 rq_seqno; /* gss seq no. used on req. */
int rq_enc_pages_num; int rq_enc_pages_num;
struct page **rq_enc_pages; /* scratch pages for use by struct page **rq_enc_pages; /* scratch pages for use by
......
...@@ -230,7 +230,7 @@ struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt) ...@@ -230,7 +230,7 @@ struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt)
if (req != NULL) { if (req != NULL) {
set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); set_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
req->rq_received = 0; req->rq_reply_bytes_recvd = 0;
req->rq_bytes_sent = 0; req->rq_bytes_sent = 0;
memcpy(&req->rq_private_buf, &req->rq_rcv_buf, memcpy(&req->rq_private_buf, &req->rq_rcv_buf,
sizeof(req->rq_private_buf)); sizeof(req->rq_private_buf));
......
...@@ -1258,8 +1258,8 @@ call_status(struct rpc_task *task) ...@@ -1258,8 +1258,8 @@ call_status(struct rpc_task *task)
struct rpc_rqst *req = task->tk_rqstp; struct rpc_rqst *req = task->tk_rqstp;
int status; int status;
if (req->rq_received > 0 && !req->rq_bytes_sent) if (req->rq_reply_bytes_recvd > 0 && !req->rq_bytes_sent)
task->tk_status = req->rq_received; task->tk_status = req->rq_reply_bytes_recvd;
dprint_status(task); dprint_status(task);
...@@ -1376,7 +1376,7 @@ call_decode(struct rpc_task *task) ...@@ -1376,7 +1376,7 @@ call_decode(struct rpc_task *task)
/* /*
* Ensure that we see all writes made by xprt_complete_rqst() * Ensure that we see all writes made by xprt_complete_rqst()
* before it changed req->rq_received. * before it changed req->rq_reply_bytes_recvd.
*/ */
smp_rmb(); smp_rmb();
req->rq_rcv_buf.len = req->rq_private_buf.len; req->rq_rcv_buf.len = req->rq_private_buf.len;
...@@ -1417,7 +1417,7 @@ call_decode(struct rpc_task *task) ...@@ -1417,7 +1417,7 @@ call_decode(struct rpc_task *task)
task->tk_status = 0; task->tk_status = 0;
/* Note: rpc_verify_header() may have freed the RPC slot */ /* Note: rpc_verify_header() may have freed the RPC slot */
if (task->tk_rqstp == req) { if (task->tk_rqstp == req) {
req->rq_received = req->rq_rcv_buf.len = 0; req->rq_reply_bytes_recvd = req->rq_rcv_buf.len = 0;
if (task->tk_client->cl_discrtry) if (task->tk_client->cl_discrtry)
xprt_conditional_disconnect(task->tk_xprt, xprt_conditional_disconnect(task->tk_xprt,
req->rq_connect_cookie); req->rq_connect_cookie);
......
...@@ -156,7 +156,7 @@ void rpc_count_iostats(struct rpc_task *task) ...@@ -156,7 +156,7 @@ void rpc_count_iostats(struct rpc_task *task)
op_metrics->om_timeouts += task->tk_timeouts; op_metrics->om_timeouts += task->tk_timeouts;
op_metrics->om_bytes_sent += task->tk_bytes_sent; op_metrics->om_bytes_sent += task->tk_bytes_sent;
op_metrics->om_bytes_recv += req->rq_received; op_metrics->om_bytes_recv += req->rq_reply_bytes_recvd;
queue = (long)req->rq_xtime - task->tk_start; queue = (long)req->rq_xtime - task->tk_start;
if (queue < 0) if (queue < 0)
......
...@@ -806,9 +806,10 @@ void xprt_complete_rqst(struct rpc_task *task, int copied) ...@@ -806,9 +806,10 @@ void xprt_complete_rqst(struct rpc_task *task, int copied)
list_del_init(&req->rq_list); list_del_init(&req->rq_list);
req->rq_private_buf.len = copied; req->rq_private_buf.len = copied;
/* Ensure all writes are done before we update req->rq_received */ /* Ensure all writes are done before we update */
/* req->rq_reply_bytes_recvd */
smp_wmb(); smp_wmb();
req->rq_received = copied; req->rq_reply_bytes_recvd = copied;
rpc_wake_up_queued_task(&xprt->pending, task); rpc_wake_up_queued_task(&xprt->pending, task);
} }
EXPORT_SYMBOL_GPL(xprt_complete_rqst); EXPORT_SYMBOL_GPL(xprt_complete_rqst);
...@@ -823,7 +824,7 @@ static void xprt_timer(struct rpc_task *task) ...@@ -823,7 +824,7 @@ static void xprt_timer(struct rpc_task *task)
dprintk("RPC: %5u xprt_timer\n", task->tk_pid); dprintk("RPC: %5u xprt_timer\n", task->tk_pid);
spin_lock_bh(&xprt->transport_lock); spin_lock_bh(&xprt->transport_lock);
if (!req->rq_received) { if (!req->rq_reply_bytes_recvd) {
if (xprt->ops->timer) if (xprt->ops->timer)
xprt->ops->timer(task); xprt->ops->timer(task);
} else } else
...@@ -845,8 +846,8 @@ int xprt_prepare_transmit(struct rpc_task *task) ...@@ -845,8 +846,8 @@ int xprt_prepare_transmit(struct rpc_task *task)
dprintk("RPC: %5u xprt_prepare_transmit\n", task->tk_pid); dprintk("RPC: %5u xprt_prepare_transmit\n", task->tk_pid);
spin_lock_bh(&xprt->transport_lock); spin_lock_bh(&xprt->transport_lock);
if (req->rq_received && !req->rq_bytes_sent) { if (req->rq_reply_bytes_recvd && !req->rq_bytes_sent) {
err = req->rq_received; err = req->rq_reply_bytes_recvd;
goto out_unlock; goto out_unlock;
} }
if (!xprt->ops->reserve_xprt(task)) if (!xprt->ops->reserve_xprt(task))
...@@ -875,7 +876,7 @@ void xprt_transmit(struct rpc_task *task) ...@@ -875,7 +876,7 @@ void xprt_transmit(struct rpc_task *task)
dprintk("RPC: %5u xprt_transmit(%u)\n", task->tk_pid, req->rq_slen); dprintk("RPC: %5u xprt_transmit(%u)\n", task->tk_pid, req->rq_slen);
if (!req->rq_received) { if (!req->rq_reply_bytes_recvd) {
if (list_empty(&req->rq_list) && rpc_reply_expected(task)) { if (list_empty(&req->rq_list) && rpc_reply_expected(task)) {
/* /*
* Add to the list only if we're expecting a reply * Add to the list only if we're expecting a reply
...@@ -914,7 +915,7 @@ void xprt_transmit(struct rpc_task *task) ...@@ -914,7 +915,7 @@ void xprt_transmit(struct rpc_task *task)
/* Don't race with disconnect */ /* Don't race with disconnect */
if (!xprt_connected(xprt)) if (!xprt_connected(xprt))
task->tk_status = -ENOTCONN; task->tk_status = -ENOTCONN;
else if (!req->rq_received && rpc_reply_expected(task)) { else if (!req->rq_reply_bytes_recvd && rpc_reply_expected(task)) {
/* /*
* Sleep on the pending queue since * Sleep on the pending queue since
* we're expecting a reply. * we're expecting a reply.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment