summaryrefslogtreecommitdiff
path: root/fs/fuse/dev.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2019-09-10 15:04:09 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2019-09-10 16:29:49 +0200
commit4c4f03f78ca9ce41a158710b87ad7e6d363e881a (patch)
tree8e29dd28a0ed27ee3f6030162ebf546c76428846 /fs/fuse/dev.c
parent4c29afece8729c6f6c1dd4865b6b7c972b7b3bbd (diff)
fuse: move page alloc
fuse_req_pages_alloc() is moved to file.c, since its internal use by the device code will eventually be removed. Rename to fuse_pages_alloc() to signify that it's not only usable for fuse_req page array. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r--fs/fuse/dev.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 3ef85c957122..0a6624aeced9 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -54,18 +54,6 @@ static void fuse_request_init(struct fuse_req *req, struct page **pages,
__set_bit(FR_PENDING, &req->flags);
}
-static struct page **fuse_req_pages_alloc(unsigned int npages, gfp_t flags,
- struct fuse_page_desc **desc)
-{
- struct page **pages;
-
- pages = kzalloc(npages * (sizeof(struct page *) +
- sizeof(struct fuse_page_desc)), flags);
- *desc = (void *) pages + npages * sizeof(struct page *);
-
- return pages;
-}
-
static struct fuse_req *__fuse_request_alloc(unsigned npages, gfp_t flags)
{
struct fuse_req *req = kmem_cache_zalloc(fuse_req_cachep, flags);
@@ -75,8 +63,7 @@ static struct fuse_req *__fuse_request_alloc(unsigned npages, gfp_t flags)
WARN_ON(npages > FUSE_MAX_MAX_PAGES);
if (npages > FUSE_REQ_INLINE_PAGES) {
- pages = fuse_req_pages_alloc(npages, flags,
- &page_descs);
+ pages = fuse_pages_alloc(npages, flags, &page_descs);
if (!pages) {
kmem_cache_free(fuse_req_cachep, req);
return NULL;
@@ -120,7 +107,7 @@ bool fuse_req_realloc_pages(struct fuse_conn *fc, struct fuse_req *req,
fc->max_pages);
WARN_ON(npages <= req->max_pages);
- pages = fuse_req_pages_alloc(npages, flags, &page_descs);
+ pages = fuse_pages_alloc(npages, flags, &page_descs);
if (!pages)
return false;