aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c14
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
78static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req) 78static 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)
137void fuse_release_fill(struct fuse_file *ff, u64 nodeid, int flags, int opcode) 138void 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);