diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2008-02-06 04:38:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 13:41:13 -0500 |
commit | b57d426445c98789265de6a9338cdb06462d15fb (patch) | |
tree | 66ff8e708c15275af806b0a9847e01d9e3a2f8e5 /fs/fuse | |
parent | 0952b2a4a82b2deb76463dbcf1355b806dc81134 (diff) |
fuse: save space in struct fuse_req
Move the fields 'dentry' and 'vfsmount' into the request specific union, since
these are only used for the RELEASE request.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/file.c | 14 | ||||
-rw-r--r-- | fs/fuse/fuse_i.h | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index bb05d227cf30..676b0bc8a86d 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -77,8 +77,8 @@ static struct fuse_file *fuse_file_get(struct fuse_file *ff) | |||
77 | 77 | ||
78 | static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req) | 78 | static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req) |
79 | { | 79 | { |
80 | dput(req->dentry); | 80 | dput(req->misc.release.dentry); |
81 | mntput(req->vfsmount); | 81 | mntput(req->misc.release.vfsmount); |
82 | fuse_put_request(fc, req); | 82 | fuse_put_request(fc, req); |
83 | } | 83 | } |
84 | 84 | ||
@@ -86,7 +86,8 @@ static void fuse_file_put(struct fuse_file *ff) | |||
86 | { | 86 | { |
87 | if (atomic_dec_and_test(&ff->count)) { | 87 | if (atomic_dec_and_test(&ff->count)) { |
88 | struct fuse_req *req = ff->reserved_req; | 88 | struct fuse_req *req = ff->reserved_req; |
89 | struct fuse_conn *fc = get_fuse_conn(req->dentry->d_inode); | 89 | struct inode *inode = req->misc.release.dentry->d_inode; |
90 | struct fuse_conn *fc = get_fuse_conn(inode); | ||
90 | req->end = fuse_release_end; | 91 | req->end = fuse_release_end; |
91 | request_send_background(fc, req); | 92 | request_send_background(fc, req); |
92 | kfree(ff); | 93 | kfree(ff); |
@@ -137,7 +138,7 @@ int fuse_open_common(struct inode *inode, struct file *file, int isdir) | |||
137 | void fuse_release_fill(struct fuse_file *ff, u64 nodeid, int flags, int opcode) | 138 | void fuse_release_fill(struct fuse_file *ff, u64 nodeid, int flags, int opcode) |
138 | { | 139 | { |
139 | struct fuse_req *req = ff->reserved_req; | 140 | struct fuse_req *req = ff->reserved_req; |
140 | struct fuse_release_in *inarg = &req->misc.release_in; | 141 | struct fuse_release_in *inarg = &req->misc.release.in; |
141 | 142 | ||
142 | inarg->fh = ff->fh; | 143 | inarg->fh = ff->fh; |
143 | inarg->flags = flags; | 144 | inarg->flags = flags; |
@@ -153,13 +154,14 @@ int fuse_release_common(struct inode *inode, struct file *file, int isdir) | |||
153 | struct fuse_file *ff = file->private_data; | 154 | struct fuse_file *ff = file->private_data; |
154 | if (ff) { | 155 | if (ff) { |
155 | struct fuse_conn *fc = get_fuse_conn(inode); | 156 | struct fuse_conn *fc = get_fuse_conn(inode); |
157 | struct fuse_req *req = ff->reserved_req; | ||
156 | 158 | ||
157 | fuse_release_fill(ff, get_node_id(inode), file->f_flags, | 159 | fuse_release_fill(ff, get_node_id(inode), file->f_flags, |
158 | isdir ? FUSE_RELEASEDIR : FUSE_RELEASE); | 160 | isdir ? FUSE_RELEASEDIR : FUSE_RELEASE); |
159 | 161 | ||
160 | /* Hold vfsmount and dentry until release is finished */ | 162 | /* Hold vfsmount and dentry until release is finished */ |
161 | ff->reserved_req->vfsmount = mntget(file->f_path.mnt); | 163 | req->misc.release.vfsmount = mntget(file->f_path.mnt); |
162 | ff->reserved_req->dentry = dget(file->f_path.dentry); | 164 | req->misc.release.dentry = dget(file->f_path.dentry); |
163 | 165 | ||
164 | spin_lock(&fc->lock); | 166 | spin_lock(&fc->lock); |
165 | list_del(&ff->write_entry); | 167 | list_del(&ff->write_entry); |
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 3ab8a3048e8b..c5c1ebff1e2d 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h | |||
@@ -215,7 +215,11 @@ struct fuse_req { | |||
215 | /** Data for asynchronous requests */ | 215 | /** Data for asynchronous requests */ |
216 | union { | 216 | union { |
217 | struct fuse_forget_in forget_in; | 217 | struct fuse_forget_in forget_in; |
218 | struct fuse_release_in release_in; | 218 | struct { |
219 | struct fuse_release_in in; | ||
220 | struct vfsmount *vfsmount; | ||
221 | struct dentry *dentry; | ||
222 | } release; | ||
219 | struct fuse_init_in init_in; | 223 | struct fuse_init_in init_in; |
220 | struct fuse_init_out init_out; | 224 | struct fuse_init_out init_out; |
221 | struct fuse_read_in read_in; | 225 | struct fuse_read_in read_in; |
@@ -238,12 +242,6 @@ struct fuse_req { | |||
238 | /** File used in the request (or NULL) */ | 242 | /** File used in the request (or NULL) */ |
239 | struct fuse_file *ff; | 243 | struct fuse_file *ff; |
240 | 244 | ||
241 | /** vfsmount used in release */ | ||
242 | struct vfsmount *vfsmount; | ||
243 | |||
244 | /** dentry used in release */ | ||
245 | struct dentry *dentry; | ||
246 | |||
247 | /** Request completion callback */ | 245 | /** Request completion callback */ |
248 | void (*end)(struct fuse_conn *, struct fuse_req *); | 246 | void (*end)(struct fuse_conn *, struct fuse_req *); |
249 | 247 | ||