summaryrefslogtreecommitdiff
path: root/fs/fuse/dev.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2019-09-10 15:04:10 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2019-09-10 16:29:49 +0200
commit33826ebbbe4b45ccecf2f5a08b3457f5d59c6282 (patch)
tree806a7a70bef00091ea21d3bda3f375a88b6dbe3c /fs/fuse/dev.c
parent43f5098eb82b1dbf3988cab0a26e729e88a004fc (diff)
fuse: convert writepages to simple api
Derive fuse_writepage_args from fuse_io_args. Sending the request is tricky since it was done with fi->lock held, hence we must either use atomic allocation or release the lock. Both are possible so try atomic first and if it fails, release the lock and do the regular allocation with GFP_NOFS and __GFP_NOFAIL. Both flags are necessary for correct operation. Move the page realloc function from dev.c to file.c and convert to using fuse_writepage_args. The last caller of fuse_write_fill() is gone, so get rid of it. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r--fs/fuse/dev.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index a52a7380baa4..d87accc9df9d 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -96,33 +96,6 @@ static void fuse_req_pages_free(struct fuse_req *req)
kfree(req->pages);
}
-bool fuse_req_realloc_pages(struct fuse_conn *fc, struct fuse_req *req,
- gfp_t flags)
-{
- struct page **pages;
- struct fuse_page_desc *page_descs;
- unsigned int npages = min_t(unsigned int,
- max_t(unsigned int, req->max_pages * 2,
- FUSE_DEFAULT_MAX_PAGES_PER_REQ),
- fc->max_pages);
- WARN_ON(npages <= req->max_pages);
-
- pages = fuse_pages_alloc(npages, flags, &page_descs);
- if (!pages)
- return false;
-
- memcpy(pages, req->pages, sizeof(struct page *) * req->max_pages);
- memcpy(page_descs, req->page_descs,
- sizeof(struct fuse_page_desc) * req->max_pages);
- fuse_req_pages_free(req);
- __set_bit(FR_ALLOC_PAGES, &req->flags);
- req->pages = pages;
- req->page_descs = page_descs;
- req->max_pages = npages;
-
- return true;
-}
-
void fuse_request_free(struct fuse_req *req)
{
fuse_req_pages_free(req);