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/file.c | |
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/file.c')
-rw-r--r-- | fs/fuse/file.c | 14 |
1 files changed, 8 insertions, 6 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); |