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>
这个提交包含在:
Maxim Patlasov
2012-10-26 19:48:07 +04:00
提交者 Miklos Szeredi
父节点 0b05b18381
当前提交 4250c0668e
修改 4 个文件,包含 50 行新增20 行删除

查看文件

@@ -44,6 +44,9 @@
doing the mount will be allowed to access the filesystem */
#define FUSE_ALLOW_OTHER (1 << 1)
/** Number of page pointers embedded in fuse_req */
#define FUSE_REQ_INLINE_PAGES 1
/** List of active connections */
extern struct list_head fuse_conn_list;
@@ -291,7 +294,13 @@ struct fuse_req {
} misc;
/** page vector */
struct page *pages[FUSE_MAX_PAGES_PER_REQ];
struct page **pages;
/** size of the 'pages' array */
unsigned max_pages;
/** inline page vector */
struct page *inline_pages[FUSE_REQ_INLINE_PAGES];
/** number of pages in vector */
unsigned num_pages;
@@ -664,9 +673,9 @@ void fuse_ctl_cleanup(void);
/**
* Allocate a request
*/
struct fuse_req *fuse_request_alloc(void);
struct fuse_req *fuse_request_alloc(unsigned npages);
struct fuse_req *fuse_request_alloc_nofs(void);
struct fuse_req *fuse_request_alloc_nofs(unsigned npages);
/**
* Free a request