From patchwork Mon Mar 10 15:38:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Derr X-Patchwork-Id: 3804111 X-Patchwork-Delegate: ericvh@gmail.com Return-Path: X-Original-To: patchwork-v9fs-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 67BB79F1CD for ; Mon, 10 Mar 2014 16:11:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 828BA202A1 for ; Mon, 10 Mar 2014 16:11:23 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 37430201ED for ; Mon, 10 Mar 2014 16:11:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1WN2nR-0008JB-Gw; Mon, 10 Mar 2014 16:11:21 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1WN2nQ-0008Iz-Ew for v9fs-developer@lists.sourceforge.net; Mon, 10 Mar 2014 16:11:20 +0000 X-ACL-Warn: Received: from ecfrec.frec.bull.fr ([129.183.4.8]) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1WN2nJ-0005CX-Fp for v9fs-developer@lists.sourceforge.net; Mon, 10 Mar 2014 16:11:20 +0000 Received: from atlas.frec.bull.fr (atlas.frec.bull.fr [129.183.91.13]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id AF81E6F5A0; Mon, 10 Mar 2014 16:39:12 +0100 (CET) Received: from atlas.frec.bull.fr (localhost [127.0.0.1]) by atlas.frec.bull.fr (Postfix) with ESMTP id B9316A1854; Mon, 10 Mar 2014 16:39:10 +0100 (CET) Received: (from derr@localhost) by atlas.frec.bull.fr (8.14.4/8.14.4/Submit) id s2AFdABC015286; Mon, 10 Mar 2014 16:39:10 +0100 From: Simon Derr To: v9fs-developer@lists.sourceforge.net Date: Mon, 10 Mar 2014 16:38:52 +0100 Message-Id: <1394465932-11520-5-git-send-email-simon.derr@bull.net> X-Mailer: git-send-email 1.7.10.1 In-Reply-To: <1394465932-11520-1-git-send-email-simon.derr@bull.net> References: <1394465932-11520-1-git-send-email-simon.derr@bull.net> X-Spam-Score: -0.0 (/) X-Headers-End: 1WN2nJ-0005CX-Fp Subject: [V9fs-developer] [PATCH 4/4] 9P: Get rid of REQ_STATUS_FLSH X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- include/net/9p/client.h | 2 -- net/9p/client.c | 2 +- net/9p/trans_fd.c | 7 ++----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/net/9p/client.h b/include/net/9p/client.h index 115aeac..81790a6 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h @@ -67,7 +67,6 @@ enum p9_trans_status { * @REQ_STATUS_ALLOC: request has been allocated but not sent * @REQ_STATUS_UNSENT: request waiting to be sent * @REQ_STATUS_SENT: request sent to server - * @REQ_STATUS_FLSH: a flush has been sent for this request * @REQ_STATUS_RCVD: response received from server * @REQ_STATUS_FLSHD: request has been flushed * @REQ_STATUS_ERROR: request encountered an error on the client side @@ -83,7 +82,6 @@ enum p9_req_status_t { REQ_STATUS_ALLOC, REQ_STATUS_UNSENT, REQ_STATUS_SENT, - REQ_STATUS_FLSH, REQ_STATUS_RCVD, REQ_STATUS_FLSHD, REQ_STATUS_ERROR, diff --git a/net/9p/client.c b/net/9p/client.c index 354bfb8..515b493 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) * if we haven't received a response for oldreq, * remove it from the list */ - if (oldreq->status == REQ_STATUS_FLSH) + if (oldreq->status == REQ_STATUS_SENT) if (c->trans_mod->cancelled) c->trans_mod->cancelled(c, oldreq); diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index fda4951..9c80642 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) "mux %p pkt: size: %d bytes tag: %d\n", m, n, tag); m->req = p9_tag_lookup(m->client, tag); - if (!m->req || (m->req->status != REQ_STATUS_SENT && - m->req->status != REQ_STATUS_FLSH)) { + if (!m->req || (m->req->status != REQ_STATUS_SENT)) { p9_debug(P9_DEBUG_ERROR, "Unexpected packet tag %d\n", tag); err = -EIO; @@ -701,9 +700,7 @@ static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req) list_del(&req->req_list); req->status = REQ_STATUS_FLSHD; ret = 0; - } else if (req->status == REQ_STATUS_SENT) - req->status = REQ_STATUS_FLSH; - + } spin_unlock(&client->lock); return ret;