fuse: add members to struct fuse_file

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, June 12, 2009 - 10:59 am

Gitweb:     http://git.kernel.org/linus/da5e4714578ff323f7a61af490fc3539e68f188b
Commit:     da5e4714578ff323f7a61af490fc3539e68f188b
Parent:     d09cb9d7f6e4cb1dd0cf12ee0d352440291c74cf
Author:     Miklos Szeredi <mszeredi@suse.cz>
AuthorDate: Tue Apr 28 16:56:36 2009 +0200
Committer:  Miklos Szeredi <mszeredi@suse.cz>
CommitDate: Tue Apr 28 16:56:36 2009 +0200

    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: Miklos Szeredi <mszeredi@suse.cz>
---
 fs/fuse/file.c   |    2 ++
 fs/fuse/fuse_i.h |   10 ++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index b83d7d8..3be0301 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -54,6 +54,7 @@ struct fuse_file *fuse_file_alloc(struct fuse_conn *fc)
 	if (unlikely(!ff))
 		return NULL;
 
+	ff->fc = fc;
 	ff->reserved_req = fuse_request_alloc();
 	if (unlikely(!ff->reserved_req)) {
 		kfree(ff);
@@ -111,6 +112,7 @@ void fuse_finish_open(struct inode *inode, struct file *file,
 	if (outarg->open_flags & FOPEN_NONSEEKABLE)
 		nonseekable_open(inode, file);
 	ff->fh = outarg->fh;
+	ff->nodeid = get_node_id(inode);
 	file->private_data = fuse_file_get(ff);
 }
 
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 146317f..4469d99 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -97,8 +97,13 @@ struct fuse_inode {
 	struct list_head writepages;
 };
 
+struct fuse_conn;
+
 /** FUSE specific file data */
 struct fuse_file {
+	/** Fuse connection for this file */
+	struct fuse_conn *fc;
+
 	/** Request reserved for flush and release */
 	struct fuse_req *reserved_req;
 
@@ -108,6 +113,9 @@ struct fuse_file {
 	/** File handle used by userspace */
 	u64 fh;
 
+	/** Node id of this file */
+	u64 nodeid;
+
 	/** Refcount */
 	atomic_t count;
 
@@ -185,8 +193,6 @@ enum fuse_req_state {
 	FUSE_REQ_FINISHED
 };
 
-struct fuse_conn;
-
 /**
  * A request to the client
  */
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
fuse: add members to struct fuse_file, Linux Kernel Mailing ..., (Fri Jun 12, 10:59 am)