From patchwork Fri May 18 00:22:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 10407959 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 AFE8E60353 for ; Fri, 18 May 2018 00:25:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DA00287C7 for ; Fri, 18 May 2018 00:25:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F161287D1; Fri, 18 May 2018 00:25:41 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, 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 388B8287C9 for ; Fri, 18 May 2018 00:25:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752160AbeERAXf (ORCPT ); Thu, 17 May 2018 20:23:35 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:34646 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751543AbeERAXe (ORCPT ); Thu, 17 May 2018 20:23:34 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id JTA6frHCCN7esJTA6fCI3u; Thu, 17 May 2018 17:22:32 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.91) (envelope-from ) id 1fJTA5-0001U1-TE; Thu, 17 May 2018 17:22:21 -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 Cc: Long Li Subject: [RFC PATCH 01/09] Introduce offset for the 1st page in data transfer structures Date: Thu, 17 May 2018 17:22:06 -0700 Message-Id: <20180518002214.5657-2-longli@linuxonhyperv.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518002214.5657-1-longli@linuxonhyperv.com> References: <20180518002214.5657-1-longli@linuxonhyperv.com> Reply-To: longli@microsoft.com X-CMAE-Envelope: MS4wfO8fZXtynARGtWqOPkeDrS6NM0lo4gYGp6bIh04vsq+9TnF/coRlOwVtuK8MPwQ0xdA+cZk+RALOKCuIpAgMvL4FiC0SNelO988/2pG837ivj7i7C7Bf QSty9VeeiLIt9LaiAtNow57C9YqIXKbASqruaOmQpH90xCf76RwxhGLsGFlProkAgaOlDb8NkdiO72JHC2koH2nxim2FWkU/T8rXJmMaLchSXYXzw7bLbNd0 lBnZcc9giiG7m4uBFWuMOKzw4npL1TeSsITOhdeTCEmK9kARX7uC07thTHAsYY/puVK+5nvdOs3mPmTxr/P8leKUcKHaEkJXSZzBUvJEuszbdfRscRu20QqW csA4oYkuP5v7DSH6bctpPyAdyGqk8fTCoc/trd5JSiRsyf/TxW6Nrh6VwAdnpSXbwjY2OvmG Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Long Li Currently CIFS allocates its own pages for data transfer, they don't need offset since it's always 0 in the 1st page. Direct data transfer needs to define an offset because user-data may not start on the page boundary Signed-off-by: Long Li --- fs/cifs/cifsglob.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index cb950a5..a51855c 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -176,6 +176,7 @@ struct smb_rqst { struct kvec *rq_iov; /* array of kvecs */ unsigned int rq_nvec; /* number of kvecs in array */ struct page **rq_pages; /* pointer to array of page ptrs */ + unsigned int rq_offset; /* the offset to the 1st page */ unsigned int rq_npages; /* number pages in array */ unsigned int rq_pagesz; /* page size to use */ unsigned int rq_tailsz; /* length of last page */ @@ -1167,8 +1168,10 @@ struct cifs_readdata { struct kvec iov[2]; #ifdef CONFIG_CIFS_SMB_DIRECT struct smbd_mr *mr; + struct page **direct_pages; #endif unsigned int pagesz; + unsigned int page_offset; unsigned int tailsz; unsigned int credits; unsigned int nr_pages; @@ -1192,8 +1195,10 @@ struct cifs_writedata { int result; #ifdef CONFIG_CIFS_SMB_DIRECT struct smbd_mr *mr; + struct page **direct_pages; #endif unsigned int pagesz; + unsigned int page_offset; unsigned int tailsz; unsigned int credits; unsigned int nr_pages;