Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4829923imm; Wed, 30 May 2018 12:53:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI/2Np9KRQvlMx92rhJaeSVgUN2snuVsbzHLORWGXutBj0AvFSgVa2P+ZyEh6M2uGNqWLm7 X-Received: by 2002:a62:4fd8:: with SMTP id f85-v6mr4042237pfj.77.1527710017459; Wed, 30 May 2018 12:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527710017; cv=none; d=google.com; s=arc-20160816; b=gyEInUIl93tscz9YjQCetf4RbGG0j60s4rlf6S7FV1AZrV1QPrbiPg/UAurPAxCm8b 3vluqI7mJlwj9DohoZt5bD4vS0OBTWj3iOgFFV6+5nIn7oq/rh8RExAuEuuIr7TDb9T/ GKXAJGSTXetUagTXKKC4ByUB3SPbnBhgZruIMXce2QgCqUR108hSJ6Lo++1xUBT/0n2Z vPNioBA/IM7HCvh0tbBYxdomy+y+7lcXkAI1ZfiLz6w7EWVqHI1IXgnhNAe9NlevLBP/ SwyWXpiiZWilMeOnSHUxnvrBbR+qJLE5laCu7j8aDqRyvGNFAu1q0nVYeZc1AIJHIO8C w3lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=Nu8Pmpbu2LuVq+6xgND0XqOrqzxculeQm1HIs+M46pI=; b=aDJlWgAFG1DYwC0I1KtBPMqV+7kxfBnHazEBdMDFWXQkiGeyJeaca1tTBs6eS+lvTx 14fkkyFQlr63xiIGIeq0M7duX62Y2GHwVQEKewOWpDgb6X5tGa9rLWVCgfZNo5NKI3dj H3IWgk2Sg0vZZNWmHfEPVxGFISTZFJ9rTFIvulibKTUJOodtr4pqab6lIgX7YLwa0gZS MeVubGzIv0nSn3w+QeQeq889d1Kgiyp17PPiIvpEKa/wMfcyKbF1itqnk0Cn1uh4lZen BReHEibftr+b6a3iMKqYcWrWlsgaFQJeK1gmhX+DgTkhF4lk9+ExjgNiwInhVH5Rn+Dn gRYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f127-v6si25248296pgc.503.2018.05.30.12.53.23; Wed, 30 May 2018 12:53:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932518AbeE3TwU (ORCPT + 99 others); Wed, 30 May 2018 15:52:20 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:60152 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932249AbeE3Ttv (ORCPT ); Wed, 30 May 2018 15:49:51 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id O75Ff6FLnN7esO75Ff2xhr; Wed, 30 May 2018 12:48:50 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.91) (envelope-from ) id 1fO75E-0008FP-Tk; Wed, 30 May 2018 12:48:32 -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: [Patch v2 01/15] CIFS: Introduce offset for the 1st page in data transfer structures Date: Wed, 30 May 2018 12:47:53 -0700 Message-Id: <20180530194807.31657-2-longli@linuxonhyperv.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180530194807.31657-1-longli@linuxonhyperv.com> References: <20180530194807.31657-1-longli@linuxonhyperv.com> Reply-To: longli@microsoft.com X-CMAE-Envelope: MS4wfOXTRW/GUneQYLoecZdiasFtUNNpaLz/S4ZgqJTHTd47qxTI9hnEpOeZuC3eJfSjt+3HCyi7Xh8iGB7Q73GOCL/4yhlKfWu5dEKGWxcRadQzcMXOxlXd lPIyqCpuY3Fpk5GlN27fT/4RbBc0B//xwgIYBEpHh61YbXPQZH9qNQ0SFm9+zY23JX9QyDmh09Lvr526uu96D7CNyE7TXgRakqRr/NRMXz96JGtn/uOElhXq M2ZH3M+W6JmHn7pHE/2e7SgJfcvwrOKphbHscKRUo3LkP/RXske6Gvh00LaKe3acLBJjpWx8lp/Rwiremo1/KidT/AWevz1iZl6ZPygNImcHJad4Cs+PaBJ2 bcGEATleor/q1coFObJGUz+zC/Eu7P5xdGxb7g6wZRzx6okCjfRi5dJ2S08bNb1u6redKPed Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li When direct I/O is used, the data buffer may not always align to page boundaries. Introduce a page offset in transport data structures to describe the location of the buffer within the page. Also change the function to pass the page offset when sending data to transport. Signed-off-by: Long Li --- fs/cifs/cifsglob.h | 3 +++ fs/cifs/smb2pdu.c | 1 + 2 files changed, 4 insertions(+) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 4f674b7..8d16c3e 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 */ @@ -1174,6 +1175,7 @@ struct cifs_readdata { struct smbd_mr *mr; #endif unsigned int pagesz; + unsigned int page_offset; unsigned int tailsz; unsigned int credits; unsigned int nr_pages; @@ -1199,6 +1201,7 @@ struct cifs_writedata { struct smbd_mr *mr; #endif unsigned int pagesz; + unsigned int page_offset; unsigned int tailsz; unsigned int credits; unsigned int nr_pages; diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 47d5331..a02f6b6 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3045,6 +3045,7 @@ smb2_async_writev(struct cifs_writedata *wdata, rqst.rq_iov = iov; rqst.rq_nvec = 2; rqst.rq_pages = wdata->pages; + rqst.rq_offset = wdata->page_offset; rqst.rq_npages = wdata->nr_pages; rqst.rq_pagesz = wdata->pagesz; rqst.rq_tailsz = wdata->tailsz; -- 2.7.4