Skip to content

Commit

Permalink
fuse: cleanup in release
Browse files Browse the repository at this point in the history
Move dput/mntput pair from request_end() to fuse_release_end(), because
there's no other place they are used.

Signed-off-by: Miklos Szeredi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Oct 17, 2007
1 parent ebc14c4 commit 819c4b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,6 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
fc->num_background--;
}
spin_unlock(&fc->lock);
dput(req->dentry);
mntput(req->vfsmount);
wake_up(&req->waitq);
if (end)
end(fc, req);
Expand Down
8 changes: 8 additions & 0 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,19 @@ static struct fuse_file *fuse_file_get(struct fuse_file *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)
{
if (atomic_dec_and_test(&ff->count)) {
struct fuse_req *req = ff->reserved_req;
struct fuse_conn *fc = get_fuse_conn(req->dentry->d_inode);
req->end = fuse_release_end;
request_send_background(fc, req);
kfree(ff);
}
Expand Down

0 comments on commit 819c4b3

Please sign in to comment.