From patchwork Tue Aug 29 19:29:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9928065 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 61E73602B9 for ; Tue, 29 Aug 2017 19:33:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5512B28A30 for ; Tue, 29 Aug 2017 19:33:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49E4928A39; Tue, 29 Aug 2017 19:33:12 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 06B1C28A30 for ; Tue, 29 Aug 2017 19:33:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751552AbdH2Tcu (ORCPT ); Tue, 29 Aug 2017 15:32:50 -0400 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:33218 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751733AbdH2Tat (ORCPT ); Tue, 29 Aug 2017 15:30:49 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id mmCpdvmU0uGJpmmCpdvcgE; Tue, 29 Aug 2017 12:29:48 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1dmmCp-0006sS-Ro; Tue, 29 Aug 2017 12:29: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, Christoph Hellwig , Tom Talpey , Matthew Wilcox Cc: Long Li Subject: [Patch v3 15/19] CIFS: SMBD: Add parameter rdata to smb2_new_read_req Date: Tue, 29 Aug 2017 12:29:11 -0700 Message-Id: <20170829192915.26251-16-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170829192915.26251-1-longli@exchange.microsoft.com> References: <20170829192915.26251-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfCP9NlzP4/jxJ9CngijXKk6ZnHOAjW/ybx/uklClj46yeEO1yZQnWx9ABpfIdUYY7ZtvoxDtrWQyEEwtLAg/Ksq1Id5fpOKfNO0L6OynrsqO+BLk06So 1GxrTJw8mHyBuEfFYzgVhMPPJZW6kW2mdRLt+MExGRCRFqVUU2L10tswIiuGkqESZs6gFZxPd2qgLWIvuKekjQJnGkytbcBzeSNjS/1d4iUqjTg3PRFVhnod cjwqiBvpGLY9UjwHspZ7JIwr/7O0NZShTDtJcG9SSbMeyYxov3hrbNzDZPGJoUmGw7KHXWDnYAS6k2QD+JiZhwrqOnfD551bm7dW+niC4F3o3KV53LuZqym1 qAexYa1DXaMhr8gNC31VpKUs3qWTwTibR6HOYRDM2ORWFNCDaIdMKQe4B+7u2mZswO0RZZ88uClx95o/jTIQlk47WEaH2DpTMbD3RyN/nt5d7pBJoym7AJAV KyU/utWEZlGZcUWh 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 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 5551053..fbad987 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -2363,18 +2363,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; @@ -2502,7 +2505,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 */ @@ -2570,7 +2574,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;