From patchwork Sun Nov 5 05:43:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 834274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yV4Xq4sTnz9t38 for ; Sun, 5 Nov 2017 16:50:19 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753246AbdKEFtI (ORCPT ); Sun, 5 Nov 2017 01:49:08 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:55854 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbdKEFpx (ORCPT ); Sun, 5 Nov 2017 01:45:53 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BDjTeEGqoV6DQBDjTe8bOT; Sat, 04 Nov 2017 22:44:52 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eBDjT-0006E2-Kh; Sat, 04 Nov 2017 22:44:31 -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, Christoph Hellwig , Tom Talpey , Matthew Wilcox , Stephen Hemminger Cc: Long Li Subject: [Patch v6 01/22] CIFS: SMBD: Add parameter rdata to smb2_new_read_req Date: Sat, 4 Nov 2017 22:43:43 -0700 Message-Id: <20171105054404.23886-2-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171105054404.23886-1-longli@exchange.microsoft.com> References: <20171105054404.23886-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfOv9aqhE6n0GWlVUcvvzu0V4zHH2RyX8Gx2AYW6wd0R5gVw/bij2dhGZLaMwSCgNobMMK1lE7wdmEPj5Ihj7OyK2fY1iZQt3GiPLUrfhlMSaF008O16m YKIoRYIXXwSmEbRVZ4uhob7+U0tEk3tUq497WQrEFydPmj9/EA9OwJ/aKvUmLOBHgyXLx5T8MRFLna+cMiKFnpN92Jvlszn59nIXgXauuLd5m0yaqEoAd30p luaH+SDDUuxuQzguTVAf4hwvHtMf5A0zJkKxVl7pmfcg3p4bFBCA1MCCBmjoIQXPVwqx0liic7sYoC/CquNHdTPlgzAc09xP+bmeVc7NdYy9C5TkA9F0gk3c u4W3Cmvbtf82QA31O4Ij4M17MzuKLkfaxsNIcfUuZnhwjAh7DGfnJSLCmrxPBeIL1U/nQfohglGpoJJbJQ/7/ai8L0Mh4L40L2/UpievXzx0/elFIYivVRwX rwMLETK6rw4aQ+UZdMZZzxEmRNWwTEG4JCDVqQ== Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org From: Long Li This patch is for preparing upper layer for doing SMB read via RDMA write. When the SMB read packet header is assembled, SMB Direct code needs to know the I/O layout if this request is to use a RDMA write. rdata has all the information of I/O layout 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 bab3da6..32ad590 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2350,18 +2350,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; @@ -2489,7 +2492,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 */ @@ -2557,7 +2561,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;