summaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-09-19 06:22:32 -0700
committerSteve French <smfrench@gmail.com>2012-09-24 21:46:32 -0500
commit8321fec436050b586cee448f2da0a6999e5172dd (patch)
treeee361f0ea1ca398158f7ccc71e2dc4ae4b9b89b0 /fs/cifs/cifssmb.c
parentc5fab6f4f081afcfcd7c1d444d9b900d6ef3e50b (diff)
downloadop-kernel-dev-8321fec436050b586cee448f2da0a6999e5172dd.zip
op-kernel-dev-8321fec436050b586cee448f2da0a6999e5172dd.tar.gz
cifs: convert async read code to use pages array without kmapping
Replace the "marshal_iov" function with a "read_into_pages" function. That function will copy the read data off the socket and into the pages array, kmapping and reading pages one at a time. Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index a110e07..5d7bd75 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1496,6 +1496,7 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
/* set up first iov for signature check */
rdata->iov[0].iov_base = buf;
rdata->iov[0].iov_len = server->total_read;
+ rdata->nr_iov = 1;
cFYI(1, "0: iov_base=%p iov_len=%zu",
rdata->iov[0].iov_base, rdata->iov[0].iov_len);
@@ -1507,23 +1508,11 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
return cifs_readv_discard(server, mid);
}
- /* marshal up the page array */
- cifs_kmap_lock();
- len = rdata->marshal_iov(rdata, data_len);
- cifs_kmap_unlock();
- data_len -= len;
-
- /* issue the read if we have any iovecs left to fill */
- if (rdata->nr_iov > 1) {
- length = cifs_readv_from_socket(server, &rdata->iov[1],
- rdata->nr_iov - 1, len);
- if (length < 0)
- return length;
- server->total_read += length;
- } else {
- length = 0;
- }
+ length = rdata->read_into_pages(server, rdata, data_len);
+ if (length < 0)
+ return length;
+ server->total_read += length;
rdata->bytes = length;
cFYI(1, "total_read=%u buflen=%u remaining=%u", server->total_read,
@@ -1544,7 +1533,11 @@ cifs_readv_callback(struct mid_q_entry *mid)
struct cifs_tcon *tcon = tlink_tcon(rdata->cfile->tlink);
struct TCP_Server_Info *server = tcon->ses->server;
struct smb_rqst rqst = { .rq_iov = rdata->iov,
- .rq_nvec = rdata->nr_iov };
+ .rq_nvec = rdata->nr_iov,
+ .rq_pages = rdata->pages,
+ .rq_npages = rdata->nr_pages,
+ .rq_pagesz = rdata->pagesz,
+ .rq_tailsz = rdata->tailsz };
cFYI(1, "%s: mid=%llu state=%d result=%d bytes=%u", __func__,
mid->mid, mid->mid_state, rdata->result, rdata->bytes);
OpenPOWER on IntegriCloud