From patchwork Wed Oct 18 23:09:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 10015523 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ABB50602C8 for ; Wed, 18 Oct 2017 23:14:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EC532889E for ; Wed, 18 Oct 2017 23:14:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92294288DA; Wed, 18 Oct 2017 23:14:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BF8B2889E for ; Wed, 18 Oct 2017 23:14:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751649AbdJRXO1 (ORCPT ); Wed, 18 Oct 2017 19:14:27 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:38006 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751506AbdJRXK5 (ORCPT ); Wed, 18 Oct 2017 19:10:57 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id 4xT9ej0vse1QA4xT9enUYT; Wed, 18 Oct 2017 16:09:55 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1e4xT9-0005W3-FM; Wed, 18 Oct 2017 16:09:47 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Tom Talpey , Matthew Wilcox , Stephen Hemminger Cc: Long Li Subject: [Patch v5 18/21] CIFS: SMBD: Add parameter rdata to smb2_new_read_req Date: Wed, 18 Oct 2017 16:09:17 -0700 Message-Id: <20171018230920.21042-19-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171018230920.21042-1-longli@exchange.microsoft.com> References: <20171018230920.21042-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfJ/BuENV/CbcvoHzu6kD93leXBo9w4Eu52IKW9LZtimYp644CkywumzA/Oq20/7gmihdtOclQhag4dlLw9aFEcViOQ8xordYIl8RHKUShVFG4iAwrQms MuEtgBiwaE7j+Jfo08XXMJzfiUbgxALeYbFA2DFMyz12Sla3krxvfwZlobHwoX4sMiMvSRXEcRKzrB7rtuOz9oXkEW4uE2Rmt1SHr6rQYqfkSTYmHWXgGvJD oghdvoj0CWaYM2d6LIbasTc0JIqg/U/UGe+J0x+71yGeCxhpH84VsLYSAM8oP77KX6qhNjmALb7wczoWqHa58M7VO0yYrr8+5HmBsGCJ7TTdebj2zruLU7+p othzHZl1RkRU0egbczJmaeVrobR99pMFdLxQycJXgaXdFEqj1KyOP3mWSe4UzlYRz7DprtJor04ycFpMICWcKSSJx8XUom74oyzhmJjIGjKhNL7hF1zGDoFK GsIYbxDS14rzdwuX Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Long Li This patch is for preparing upper layer for doing SMB read via RDMA write. When we assemble the SMB read packet header, we need to know the I/O layout if this request is to use a RDMA write. rdata has all the information we need for memory registration. Add rdata to smb2_new_read_req. Signed-off-by: Long Li --- fs/cifs/smb2pdu.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 0841aba..8ef4a2f 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2353,18 +2353,21 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, */ static int smb2_new_read_req(void **buf, unsigned int *total_len, - struct cifs_io_parms *io_parms, unsigned int remaining_bytes, - int request_type) + struct cifs_io_parms *io_parms, struct cifs_readdata *rdata, + unsigned int remaining_bytes, int request_type) { int rc = -EACCES; struct smb2_read_plain_req *req = NULL; struct smb2_sync_hdr *shdr; + struct TCP_Server_Info *server; rc = smb2_plain_req_init(SMB2_READ, io_parms->tcon, (void **) &req, total_len); if (rc) return rc; - if (io_parms->tcon->ses->server == NULL) + + server = io_parms->tcon->ses->server; + if (server == NULL) return -ECONNABORTED; shdr = &req->sync_hdr; @@ -2492,7 +2495,8 @@ smb2_async_readv(struct cifs_readdata *rdata) server = io_parms.tcon->ses->server; - rc = smb2_new_read_req((void **) &buf, &total_len, &io_parms, 0, 0); + rc = smb2_new_read_req( + (void **) &buf, &total_len, &io_parms, rdata, 0, 0); if (rc) { if (rc == -EAGAIN && rdata->credits) { /* credits was reset by reconnect */ @@ -2560,7 +2564,7 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, struct cifs_ses *ses = io_parms->tcon->ses; *nbytes = 0; - rc = smb2_new_read_req((void **)&req, &total_len, io_parms, 0, 0); + rc = smb2_new_read_req((void **)&req, &total_len, io_parms, NULL, 0, 0); if (rc) return rc;