fuse: use struct path in release structure
Use struct path instead of separate dentry and vfsmount in req->misc.release. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
This commit is contained in:
parent
6b2db28a7a
commit
b0be46ebf7
2 changed files with 5 additions and 7 deletions
|
@ -86,15 +86,14 @@ static struct fuse_file *fuse_file_get(struct fuse_file *ff)
|
||||||
|
|
||||||
static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req)
|
static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req)
|
||||||
{
|
{
|
||||||
dput(req->misc.release.dentry);
|
path_put(&req->misc.release.path);
|
||||||
mntput(req->misc.release.vfsmount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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 inode *inode = req->misc.release.dentry->d_inode;
|
struct inode *inode = req->misc.release.path.dentry->d_inode;
|
||||||
struct fuse_conn *fc = get_fuse_conn(inode);
|
struct fuse_conn *fc = get_fuse_conn(inode);
|
||||||
req->end = fuse_release_end;
|
req->end = fuse_release_end;
|
||||||
fuse_request_send_background(fc, req);
|
fuse_request_send_background(fc, req);
|
||||||
|
@ -177,8 +176,8 @@ int fuse_release_common(struct inode *inode, struct file *file, int isdir)
|
||||||
isdir ? FUSE_RELEASEDIR : FUSE_RELEASE);
|
isdir ? FUSE_RELEASEDIR : FUSE_RELEASE);
|
||||||
|
|
||||||
/* Hold vfsmount and dentry until release is finished */
|
/* Hold vfsmount and dentry until release is finished */
|
||||||
req->misc.release.vfsmount = mntget(file->f_path.mnt);
|
path_get(&file->f_path);
|
||||||
req->misc.release.dentry = dget(file->f_path.dentry);
|
req->misc.release.path = file->f_path;
|
||||||
|
|
||||||
spin_lock(&fc->lock);
|
spin_lock(&fc->lock);
|
||||||
list_del(&ff->write_entry);
|
list_del(&ff->write_entry);
|
||||||
|
|
|
@ -248,8 +248,7 @@ struct fuse_req {
|
||||||
struct fuse_forget_in forget_in;
|
struct fuse_forget_in forget_in;
|
||||||
struct {
|
struct {
|
||||||
struct fuse_release_in in;
|
struct fuse_release_in in;
|
||||||
struct vfsmount *vfsmount;
|
struct path path;
|
||||||
struct dentry *dentry;
|
|
||||||
} release;
|
} release;
|
||||||
struct fuse_init_in init_in;
|
struct fuse_init_in init_in;
|
||||||
struct fuse_init_out init_out;
|
struct fuse_init_out init_out;
|
||||||
|
|
Loading…
Add table
Reference in a new issue