diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2009-04-28 10:56:36 -0400 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2009-04-28 10:56:36 -0400 |
commit | da5e4714578ff323f7a61af490fc3539e68f188b (patch) | |
tree | d884149d9945f000ed526463058ea0228637c671 /fs/fuse | |
parent | d09cb9d7f6e4cb1dd0cf12ee0d352440291c74cf (diff) |
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>
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/file.c | 2 | ||||
-rw-r--r-- | 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 b83d7d86b527..3be030105354 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) | |||
54 | if (unlikely(!ff)) | 54 | if (unlikely(!ff)) |
55 | return NULL; | 55 | return NULL; |
56 | 56 | ||
57 | ff->fc = fc; | ||
57 | ff->reserved_req = fuse_request_alloc(); | 58 | ff->reserved_req = fuse_request_alloc(); |
58 | if (unlikely(!ff->reserved_req)) { | 59 | if (unlikely(!ff->reserved_req)) { |
59 | kfree(ff); | 60 | kfree(ff); |
@@ -111,6 +112,7 @@ void fuse_finish_open(struct inode *inode, struct file *file, | |||
111 | if (outarg->open_flags & FOPEN_NONSEEKABLE) | 112 | if (outarg->open_flags & FOPEN_NONSEEKABLE) |
112 | nonseekable_open(inode, file); | 113 | nonseekable_open(inode, file); |
113 | ff->fh = outarg->fh; | 114 | ff->fh = outarg->fh; |
115 | ff->nodeid = get_node_id(inode); | ||
114 | file->private_data = fuse_file_get(ff); | 116 | file->private_data = fuse_file_get(ff); |
115 | } | 117 | } |
116 | 118 | ||
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 146317ff81b9..4469d9971588 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
@@ -97,8 +97,13 @@ struct fuse_inode { | |||
97 | struct list_head writepages; | 97 | struct list_head writepages; |
98 | }; | 98 | }; |
99 | 99 | ||
100 | struct fuse_conn; | ||
101 | |||
100 | /** FUSE specific file data */ | 102 | /** FUSE specific file data */ |
101 | struct fuse_file { | 103 | struct fuse_file { |
104 | /** Fuse connection for this file */ | ||
105 | struct fuse_conn *fc; | ||
106 | |||
102 | /** Request reserved for flush and release */ | 107 | /** Request reserved for flush and release */ |
103 | struct fuse_req *reserved_req; | 108 | struct fuse_req *reserved_req; |
104 | 109 | ||
@@ -108,6 +113,9 @@ struct fuse_file { | |||
108 | /** File handle used by userspace */ | 113 | /** File handle used by userspace */ |
109 | u64 fh; | 114 | u64 fh; |
110 | 115 | ||
116 | /** Node id of this file */ | ||
117 | u64 nodeid; | ||
118 | |||
111 | /** Refcount */ | 119 | /** Refcount */ |
112 | atomic_t count; | 120 | atomic_t count; |
113 | 121 | ||
@@ -185,8 +193,6 @@ enum fuse_req_state { | |||
185 | FUSE_REQ_FINISHED | 193 | FUSE_REQ_FINISHED |
186 | }; | 194 | }; |
187 | 195 | ||
188 | struct fuse_conn; | ||
189 | |||
190 | /** | 196 | /** |
191 | * A request to the client | 197 | * A request to the client |
192 | */ | 198 | */ |