From: Long Li <longli@linuxonhyperv.com>
To: Steve French <sfrench@samba.org>,
linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org
Cc: Long Li <longli@microsoft.com>
Subject: [RFC PATCH 04/09] Change function to support offset when reading pages
Date: Thu, 17 May 2018 17:22:09 -0700 [thread overview]
Message-ID: <20180518002214.5657-5-longli@linuxonhyperv.com> (raw)
In-Reply-To: <20180518002214.5657-1-longli@linuxonhyperv.com>
From: Long Li <longli@microsoft.com>
It's possible that we may want to read data into an offset to the 1st page, change
the functions to pass the offset to transport.
Signed-off-by: Long Li <longli@microsoft.com>
---
fs/cifs/cifsproto.h | 2 +-
fs/cifs/connect.c | 4 ++--
fs/cifs/file.c | 4 ++--
fs/cifs/smb2ops.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 94106b9..cc034e2 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -197,7 +197,7 @@ extern void dequeue_mid(struct mid_q_entry *mid, bool malformed);
extern int cifs_read_from_socket(struct TCP_Server_Info *server, char *buf,
unsigned int to_read);
extern int cifs_read_page_from_socket(struct TCP_Server_Info *server,
- struct page *page, unsigned int to_read);
+ struct page *page, unsigned int page_offset, unsigned int to_read);
extern int cifs_setup_cifs_sb(struct smb_vol *pvolume_info,
struct cifs_sb_info *cifs_sb);
extern int cifs_match_super(struct super_block *, void *);
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 58c2083..46d0cf4 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -591,11 +591,11 @@ cifs_read_from_socket(struct TCP_Server_Info *server, char *buf,
}
int
-cifs_read_page_from_socket(struct TCP_Server_Info *server, struct page *page,
+cifs_read_page_from_socket(struct TCP_Server_Info *server, struct page *page, unsigned int page_offset,
unsigned int to_read)
{
struct msghdr smb_msg;
- struct bio_vec bv = {.bv_page = page, .bv_len = to_read};
+ struct bio_vec bv = {.bv_page = page, .bv_len = to_read, .bv_offset = page_offset};
iov_iter_bvec(&smb_msg.msg_iter, READ | ITER_BVEC, &bv, 1, to_read);
return cifs_readv_from_socket(server, &smb_msg);
}
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index ed25e04..e240c7c 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -3044,7 +3044,7 @@ uncached_fill_pages(struct TCP_Server_Info *server,
result = n;
#endif
else
- result = cifs_read_page_from_socket(server, page, n);
+ result = cifs_read_page_from_socket(server, page, page_offset, n);
if (result < 0)
break;
@@ -3614,7 +3614,7 @@ readpages_fill_pages(struct TCP_Server_Info *server,
result = n;
#endif
else
- result = cifs_read_page_from_socket(server, page, n);
+ result = cifs_read_page_from_socket(server, page, 0, n);
if (result < 0)
break;
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index b76b858..f890dd7 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -2387,7 +2387,7 @@ read_data_into_pages(struct TCP_Server_Info *server, struct page **pages,
zero_user(page, len, PAGE_SIZE - len);
len = 0;
}
- length = cifs_read_page_from_socket(server, page, n);
+ length = cifs_read_page_from_socket(server, page, 0, n);
if (length < 0)
return length;
server->total_read += length;
--
2.7.4
next prev parent reply other threads:[~2018-05-18 0:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 0:22 [RFC PATCH 00/09] Implement direct user I/O interfaces for RDMA Long Li
2018-05-17 23:10 ` Tom Talpey
2018-05-18 6:03 ` Long Li
2018-05-18 6:44 ` Christoph Hellwig
2018-05-19 0:58 ` Tom Talpey
2018-05-18 6:42 ` Christoph Hellwig
2018-05-18 0:22 ` [RFC PATCH 01/09] Introduce offset for the 1st page in data transfer structures Long Li
2018-05-18 6:37 ` Steve French
2018-05-18 0:22 ` [RFC PATCH 02/09] Change wdata alloc to support direct pages Long Li
2018-05-19 1:05 ` Tom Talpey
2018-05-18 0:22 ` [RFC PATCH 03/09] Change rdata " Long Li
2018-05-18 0:22 ` Long Li [this message]
2018-05-18 0:22 ` [RFC PATCH 05/09] Change RDMA send to regonize page offset in the 1st page Long Li
2018-05-19 1:09 ` Tom Talpey
2018-05-19 5:54 ` Long Li
2018-05-18 0:22 ` [RFC PATCH 06/09] Change RDMA recv to support " Long Li
2018-05-18 0:22 ` [RFC PATCH 07/09] Support page offset in memory regsitrations Long Li
2018-05-18 0:22 ` [RFC PATCH 08/09] Implement direct file I/O interfaces Long Li
2018-05-18 0:22 ` [RFC PATCH 09/09] Introduce cache=rdma moutning option Long Li
2018-05-18 7:26 ` Christoph Hellwig
2018-05-18 19:00 ` Long Li
2018-05-18 20:44 ` Steve French
2018-05-18 20:58 ` Long Li
2018-05-19 1:20 ` Tom Talpey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180518002214.5657-5-longli@linuxonhyperv.com \
--to=longli@linuxonhyperv.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).