diff options
author | Maxim Patlasov <mpatlasov@parallels.com> | 2012-10-26 11:48:07 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2013-01-24 10:21:25 -0500 |
commit | 4250c0668ea10a19f3d37b1733f54ce6c8a37234 (patch) | |
tree | 4f0e6bd382fa5c9cba0d584298c38b19bcdd1841 /fs/fuse/fuse_i.h | |
parent | 0b05b18381eea98c9c9ada95629bf659a88c9374 (diff) |
fuse: general infrastructure for pages[] of variable size
The patch removes inline array of FUSE_MAX_PAGES_PER_REQ page pointers from
fuse_req. Instead of that, req->pages may now point either to small inline
array or to an array allocated dynamically.
This essentially means that all callers of fuse_request_alloc[_nofs] should
pass the number of pages needed explicitly.
The patch doesn't make any logic changes.
Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse/fuse_i.h')
-rw-r--r-- | fs/fuse/fuse_i.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 5c5055306d3c..0c5b9310f930 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
@@ -44,6 +44,9 @@ | |||
44 | doing the mount will be allowed to access the filesystem */ | 44 | doing the mount will be allowed to access the filesystem */ |
45 | #define FUSE_ALLOW_OTHER (1 << 1) | 45 | #define FUSE_ALLOW_OTHER (1 << 1) |
46 | 46 | ||
47 | /** Number of page pointers embedded in fuse_req */ | ||
48 | #define FUSE_REQ_INLINE_PAGES 1 | ||
49 | |||
47 | /** List of active connections */ | 50 | /** List of active connections */ |
48 | extern struct list_head fuse_conn_list; | 51 | extern struct list_head fuse_conn_list; |
49 | 52 | ||
@@ -291,7 +294,13 @@ struct fuse_req { | |||
291 | } misc; | 294 | } misc; |
292 | 295 | ||
293 | /** page vector */ | 296 | /** page vector */ |
294 | struct page *pages[FUSE_MAX_PAGES_PER_REQ]; | 297 | struct page **pages; |
298 | |||
299 | /** size of the 'pages' array */ | ||
300 | unsigned max_pages; | ||
301 | |||
302 | /** inline page vector */ | ||
303 | struct page *inline_pages[FUSE_REQ_INLINE_PAGES]; | ||
295 | 304 | ||
296 | /** number of pages in vector */ | 305 | /** number of pages in vector */ |
297 | unsigned num_pages; | 306 | unsigned num_pages; |
@@ -664,9 +673,9 @@ void fuse_ctl_cleanup(void); | |||
664 | /** | 673 | /** |
665 | * Allocate a request | 674 | * Allocate a request |
666 | */ | 675 | */ |
667 | struct fuse_req *fuse_request_alloc(void); | 676 | struct fuse_req *fuse_request_alloc(unsigned npages); |
668 | 677 | ||
669 | struct fuse_req *fuse_request_alloc_nofs(void); | 678 | struct fuse_req *fuse_request_alloc_nofs(unsigned npages); |
670 | 679 | ||
671 | /** | 680 | /** |
672 | * Free a request | 681 | * Free a request |