From patchwork Thu May 19 20:22:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 799832 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4JKNV8M018246 for ; Thu, 19 May 2011 20:23:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934599Ab1ESUXL (ORCPT ); Thu, 19 May 2011 16:23:11 -0400 Received: from mail-vx0-f174.google.com ([209.85.220.174]:60205 "EHLO mail-vx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934511Ab1ESUXI (ORCPT ); Thu, 19 May 2011 16:23:08 -0400 Received: by mail-vx0-f174.google.com with SMTP id 39so2208003vxi.19 for ; Thu, 19 May 2011 13:23:08 -0700 (PDT) Received: by 10.52.67.75 with SMTP id l11mr693773vdt.225.1305836588019; Thu, 19 May 2011 13:23:08 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-076-182-054-018.nc.res.rr.com [76.182.54.18]) by mx.google.com with ESMTPS id y6sm1312205vbx.16.2011.05.19.13.23.07 (version=SSLv3 cipher=OTHER); Thu, 19 May 2011 13:23:07 -0700 (PDT) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org Subject: [PATCH 4/7] cifs: add ignore_pend flag to cifs_call_async Date: Thu, 19 May 2011 16:22:55 -0400 Message-Id: <1305836578-26333-5-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1305836578-26333-1-git-send-email-jlayton@redhat.com> References: <1305836578-26333-1-git-send-email-jlayton@redhat.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 19 May 2011 20:23:32 +0000 (UTC) The current code always ignores the max_pending limit. Have it instead only optionally ignore the pending limit. For CIFSSMBEcho, we need to ignore it to make sure they always can go out. For async reads, writes and potentially other calls, we need to respect it. Signed-off-by: Jeff Layton --- fs/cifs/cifsproto.h | 2 +- fs/cifs/cifssmb.c | 2 +- fs/cifs/transport.c | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index b5407a6..6931631 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h @@ -69,7 +69,7 @@ extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer, extern void DeleteMidQEntry(struct mid_q_entry *midEntry); extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, unsigned int nvec, mid_callback_t *callback, - void *cbdata); + void *cbdata, bool ignore_pend); extern int SendReceive(const unsigned int /* xid */ , struct cifsSesInfo *, struct smb_hdr * /* input */ , struct smb_hdr * /* out */ , diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index b998996..0aff051 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -743,7 +743,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server) iov.iov_base = smb; iov.iov_len = be32_to_cpu(smb->hdr.smb_buf_length) + 4; - rc = cifs_call_async(server, &iov, 1, cifs_echo_callback, server); + rc = cifs_call_async(server, &iov, 1, cifs_echo_callback, server, true); if (rc) cFYI(1, "Echo request failed: %d", rc); diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index b3c3c6d..d1998b6 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -343,13 +343,14 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ) */ int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, - unsigned int nvec, mid_callback_t *callback, void *cbdata) + unsigned int nvec, mid_callback_t *callback, void *cbdata, + bool ignore_pend) { int rc; struct mid_q_entry *mid; struct smb_hdr *hdr = (struct smb_hdr *)iov[0].iov_base; - rc = wait_for_free_request(server, CIFS_ASYNC_OP); + rc = wait_for_free_request(server, ignore_pend ? CIFS_ASYNC_OP : 0); if (rc) return rc;