fuse: add reference counting to fuse_file

Make lifetime of 'struct fuse_file' independent from 'struct file' by adding a
reference counter and destructor.

This will enable asynchronous page writeback, where it cannot be guaranteed,
that the file is not released while a request with this file handle is being
served.

The actual RELEASE request is only sent when there are no more references to
the fuse_file.

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>
This commit is contained in:
Miklos Szeredi
2007-10-16 23:31:00 -07:00
committed by Linus Torvalds
parent de5e3dec42
commit c756e0a4d7
4 changed files with 59 additions and 42 deletions

View File

@@ -233,8 +233,6 @@ static void request_end(struct fuse_conn *fc, struct fuse_req *req)
spin_unlock(&fc->lock);
dput(req->dentry);
mntput(req->vfsmount);
if (req->file)
fput(req->file);
wake_up(&req->waitq);
if (end)
end(fc, req);