diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2019-09-10 15:04:09 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2019-09-10 16:29:49 +0200 |
commit | 4c4f03f78ca9ce41a158710b87ad7e6d363e881a (patch) | |
tree | 8e29dd28a0ed27ee3f6030162ebf546c76428846 /fs/fuse/file.c | |
parent | 4c29afece8729c6f6c1dd4865b6b7c972b7b3bbd (diff) | |
download | linux-4c4f03f78ca9ce41a158710b87ad7e6d363e881a.tar.bz2 |
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/file.c')
-rw-r--r-- | fs/fuse/file.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 53f2cc6970f1..c3e95002f489 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -19,6 +19,18 @@ #include <linux/falloc.h> #include <linux/uio.h> +struct page **fuse_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); + + return pages; +} + static int fuse_send_open(struct fuse_conn *fc, u64 nodeid, struct file *file, int opcode, struct fuse_open_out *outargp) { |