aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Derr <simon.derr@bull.net>2014-03-10 11:38:52 -0400
committerEric Van Hensbergen <ericvh@gmail.com>2014-03-25 17:38:15 -0400
commit0bfd6845c0b5e3df3507d2b4d230478980e7f04a (patch)
treeabfd8e782c669baa4f16922ffc0e002eeb0af153
parent931700d26bf17c583805f52121a41231e64868f3 (diff)
9P: Get rid of REQ_STATUS_FLSH
This request state is mostly useless, and properly implementing it for RDMA would require an extra lock to be taken in handle_recv() and in rdma_cancel() to avoid this race: handle_recv() rdma_cancel() . . . if req->state == SENT req->state = RCVD . . req->state = FLSH So just get rid of it. Signed-off-by: Simon Derr <simon.derr@bull.net> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
-rw-r--r--include/net/9p/client.h2
-rw-r--r--net/9p/client.c2
-rw-r--r--net/9p/trans_fd.c7
3 files changed, 3 insertions, 8 deletions
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 115aeac401b1..81790a6fc663 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -67,7 +67,6 @@ enum p9_trans_status {
67 * @REQ_STATUS_ALLOC: request has been allocated but not sent 67 * @REQ_STATUS_ALLOC: request has been allocated but not sent
68 * @REQ_STATUS_UNSENT: request waiting to be sent 68 * @REQ_STATUS_UNSENT: request waiting to be sent
69 * @REQ_STATUS_SENT: request sent to server 69 * @REQ_STATUS_SENT: request sent to server
70 * @REQ_STATUS_FLSH: a flush has been sent for this request
71 * @REQ_STATUS_RCVD: response received from server 70 * @REQ_STATUS_RCVD: response received from server
72 * @REQ_STATUS_FLSHD: request has been flushed 71 * @REQ_STATUS_FLSHD: request has been flushed
73 * @REQ_STATUS_ERROR: request encountered an error on the client side 72 * @REQ_STATUS_ERROR: request encountered an error on the client side
@@ -83,7 +82,6 @@ enum p9_req_status_t {
83 REQ_STATUS_ALLOC, 82 REQ_STATUS_ALLOC,
84 REQ_STATUS_UNSENT, 83 REQ_STATUS_UNSENT,
85 REQ_STATUS_SENT, 84 REQ_STATUS_SENT,
86 REQ_STATUS_FLSH,
87 REQ_STATUS_RCVD, 85 REQ_STATUS_RCVD,
88 REQ_STATUS_FLSHD, 86 REQ_STATUS_FLSHD,
89 REQ_STATUS_ERROR, 87 REQ_STATUS_ERROR,
diff --git a/net/9p/client.c b/net/9p/client.c
index 40e558172bbe..0004cbaac4a4 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -667,7 +667,7 @@ static int p9_client_flush(struct p9_client *c, struct p9_req_t *oldreq)
667 * if we haven't received a response for oldreq, 667 * if we haven't received a response for oldreq,
668 * remove it from the list 668 * remove it from the list
669 */ 669 */
670 if (oldreq->status == REQ_STATUS_FLSH) 670 if (oldreq->status == REQ_STATUS_SENT)
671 if (c->trans_mod->cancelled) 671 if (c->trans_mod->cancelled)
672 c->trans_mod->cancelled(c, oldreq); 672 c->trans_mod->cancelled(c, oldreq);
673 673
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index fda4951c869e..9c806428e91a 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -345,8 +345,7 @@ static void p9_read_work(struct work_struct *work)
345 "mux %p pkt: size: %d bytes tag: %d\n", m, n, tag); 345 "mux %p pkt: size: %d bytes tag: %d\n", m, n, tag);
346 346
347 m->req = p9_tag_lookup(m->client, tag); 347 m->req = p9_tag_lookup(m->client, tag);
348 if (!m->req || (m->req->status != REQ_STATUS_SENT && 348 if (!m->req || (m->req->status != REQ_STATUS_SENT)) {
349 m->req->status != REQ_STATUS_FLSH)) {
350 p9_debug(P9_DEBUG_ERROR, "Unexpected packet tag %d\n", 349 p9_debug(P9_DEBUG_ERROR, "Unexpected packet tag %d\n",
351 tag); 350 tag);
352 err = -EIO; 351 err = -EIO;
@@ -701,9 +700,7 @@ static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req)
701 list_del(&req->req_list); 700 list_del(&req->req_list);
702 req->status = REQ_STATUS_FLSHD; 701 req->status = REQ_STATUS_FLSHD;
703 ret = 0; 702 ret = 0;
704 } else if (req->status == REQ_STATUS_SENT) 703 }
705 req->status = REQ_STATUS_FLSH;
706
707 spin_unlock(&client->lock); 704 spin_unlock(&client->lock);
708 705
709 return ret; 706 return ret;