Commit 819c4b3b authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Linus Torvalds
Browse files

fuse: cleanup in release



Move dput/mntput pair from request_end() to fuse_release_end(), because
there's no other place they are used.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ebc14c4d
...@@ -231,8 +231,6 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req) ...@@ -231,8 +231,6 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
fc->num_background--; fc->num_background--;
} }
spin_unlock(&fc->lock); spin_unlock(&fc->lock);
dput(req->dentry);
mntput(req->vfsmount);
wake_up(&req->waitq); wake_up(&req->waitq);
if (end) if (end)
end(fc, req); end(fc, req);
......
...@@ -71,11 +71,19 @@ static struct fuse_file *fuse_file_get(struct fuse_file *ff) ...@@ -71,11 +71,19 @@ static struct fuse_file *fuse_file_get(struct fuse_file *ff)
return ff; return ff;
} }
static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req)
{
dput(req->dentry);
mntput(req->vfsmount);
fuse_put_request(fc, req);
}
static void fuse_file_put(struct fuse_file *ff) static void fuse_file_put(struct fuse_file *ff)
{ {
if (atomic_dec_and_test(&ff->count)) { if (atomic_dec_and_test(&ff->count)) {
struct fuse_req *req = ff->reserved_req; struct fuse_req *req = ff->reserved_req;
struct fuse_conn *fc = get_fuse_conn(req->dentry->d_inode); struct fuse_conn *fc = get_fuse_conn(req->dentry->d_inode);
req->end = fuse_release_end;
request_send_background(fc, req); request_send_background(fc, req);
kfree(ff); kfree(ff);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment