Commit da5e4714 authored by Miklos Szeredi's avatar Miklos Szeredi

fuse: add members to struct fuse_file

Add new members ->fc and ->nodeid to struct fuse_file.  This will aid
in converting functions for use by CUSE, where the inode is not owned
by a fuse filesystem.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
parent d09cb9d7
...@@ -54,6 +54,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc) ...@@ -54,6 +54,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc)
if (unlikely(!ff)) if (unlikely(!ff))
return NULL; return NULL;
ff->fc = fc;
ff->reserved_req = fuse_request_alloc(); ff->reserved_req = fuse_request_alloc();
if (unlikely(!ff->reserved_req)) { if (unlikely(!ff->reserved_req)) {
kfree(ff); kfree(ff);
...@@ -111,6 +112,7 @@ void fuse_finish_open(struct inode *inode, struct file *file, ...@@ -111,6 +112,7 @@ void fuse_finish_open(struct inode *inode, struct file *file,
if (outarg->open_flags & FOPEN_NONSEEKABLE) if (outarg->open_flags & FOPEN_NONSEEKABLE)
nonseekable_open(inode, file); nonseekable_open(inode, file);
ff->fh = outarg->fh; ff->fh = outarg->fh;
ff->nodeid = get_node_id(inode);
file->private_data = fuse_file_get(ff); file->private_data = fuse_file_get(ff);
} }
......
...@@ -97,8 +97,13 @@ struct fuse_inode { ...@@ -97,8 +97,13 @@ struct fuse_inode {
struct list_head writepages; struct list_head writepages;
}; };
struct fuse_conn;
/** FUSE specific file data */ /** FUSE specific file data */
struct fuse_file { struct fuse_file {
/** Fuse connection for this file */
struct fuse_conn *fc;
/** Request reserved for flush and release */ /** Request reserved for flush and release */
struct fuse_req *reserved_req; struct fuse_req *reserved_req;
...@@ -108,6 +113,9 @@ struct fuse_file { ...@@ -108,6 +113,9 @@ struct fuse_file {
/** File handle used by userspace */ /** File handle used by userspace */
u64 fh; u64 fh;
/** Node id of this file */
u64 nodeid;
/** Refcount */ /** Refcount */
atomic_t count; atomic_t count;
...@@ -185,8 +193,6 @@ enum fuse_req_state { ...@@ -185,8 +193,6 @@ enum fuse_req_state {
FUSE_REQ_FINISHED FUSE_REQ_FINISHED
}; };
struct fuse_conn;
/** /**
* A request to the client * A request to the client
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment