summaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2019-09-10 15:04:11 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2019-09-10 16:29:50 +0200
commit05ea48cc2b098c533193bb058b82aa016a8361bc (patch)
tree2b72b0d7a1a92ba4f26fa17f39ce10f3e46100c0 /fs/fuse
parentd49937749fef2597f6bcaf2a0ed67e88e347b7fb (diff)
downloadlinux-stable-05ea48cc2b098c533193bb058b82aa016a8361bc.tar.gz
linux-stable-05ea48cc2b098c533193bb058b82aa016a8361bc.tar.bz2
linux-stable-05ea48cc2b098c533193bb058b82aa016a8361bc.zip
fuse: stop copying pages to fuse_req
The page array pointers are also duplicated across fuse_args_pages and fuse_req. Get rid of the fuse_req ones. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/dev.c18
-rw-r--r--fs/fuse/fuse_i.h9
2 files changed, 6 insertions, 21 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index dfc0658d990b..d7cae9001ca7 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -448,15 +448,8 @@ static void fuse_force_creds(struct fuse_conn *fc, struct fuse_req *req)
void fuse_args_to_req(struct fuse_req *req, struct fuse_args *args)
{
- struct fuse_args_pages *ap = container_of(args, typeof(*ap), args);
-
req->in.h.opcode = args->opcode;
req->in.h.nodeid = args->nodeid;
- if (args->in_pages || args->out_pages) {
- req->pages = ap->pages;
- req->page_descs = ap->descs;
- req->num_pages = ap->num_pages;
- }
req->args = args;
}
@@ -939,14 +932,15 @@ static int fuse_copy_pages(struct fuse_copy_state *cs, unsigned nbytes,
{
unsigned i;
struct fuse_req *req = cs->req;
+ struct fuse_args_pages *ap = container_of(req->args, typeof(*ap), args);
+
- for (i = 0; i < req->num_pages && (nbytes || zeroing); i++) {
+ for (i = 0; i < ap->num_pages && (nbytes || zeroing); i++) {
int err;
- unsigned offset = req->page_descs[i].offset;
- unsigned count = min(nbytes, req->page_descs[i].length);
+ unsigned int offset = ap->descs[i].offset;
+ unsigned int count = min(nbytes, ap->descs[i].length);
- err = fuse_copy_page(cs, &req->pages[i], offset, count,
- zeroing);
+ err = fuse_copy_page(cs, &ap->pages[i], offset, count, zeroing);
if (err)
return err;
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 9454f2328bd0..378f1fe69d07 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -353,15 +353,6 @@ struct fuse_req {
/** Used to wake up the task waiting for completion of request*/
wait_queue_head_t waitq;
- /** page vector */
- struct page **pages;
-
- /** page-descriptor vector */
- struct fuse_page_desc *page_descs;
-
- /** number of pages in vector */
- unsigned num_pages;
-
};
struct fuse_iqueue {