Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83522
b: refs/heads/master
c: b57d426
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Feb 6, 2008
1 parent 96d6ece commit 24d1754
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0952b2a4a82b2deb76463dbcf1355b806dc81134
refs/heads/master: b57d426445c98789265de6a9338cdb06462d15fb
14 changes: 8 additions & 6 deletions trunk/fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,17 @@ static struct fuse_file *fuse_file_get(struct fuse_file *ff)

static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req)
{
dput(req->dentry);
mntput(req->vfsmount);
dput(req->misc.release.dentry);
mntput(req->misc.release.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);
struct inode *inode = req->misc.release.dentry->d_inode;
struct fuse_conn *fc = get_fuse_conn(inode);
req->end = fuse_release_end;
request_send_background(fc, req);
kfree(ff);
Expand Down Expand Up @@ -137,7 +138,7 @@ int fuse_open_common(struct inode *inode, struct file *file, int isdir)
void fuse_release_fill(struct fuse_file *ff, u64 nodeid, int flags, int opcode)
{
struct fuse_req *req = ff->reserved_req;
struct fuse_release_in *inarg = &req->misc.release_in;
struct fuse_release_in *inarg = &req->misc.release.in;

inarg->fh = ff->fh;
inarg->flags = flags;
Expand All @@ -153,13 +154,14 @@ int fuse_release_common(struct inode *inode, struct file *file, int isdir)
struct fuse_file *ff = file->private_data;
if (ff) {
struct fuse_conn *fc = get_fuse_conn(inode);
struct fuse_req *req = ff->reserved_req;

fuse_release_fill(ff, get_node_id(inode), file->f_flags,
isdir ? FUSE_RELEASEDIR : FUSE_RELEASE);

/* Hold vfsmount and dentry until release is finished */
ff->reserved_req->vfsmount = mntget(file->f_path.mnt);
ff->reserved_req->dentry = dget(file->f_path.dentry);
req->misc.release.vfsmount = mntget(file->f_path.mnt);
req->misc.release.dentry = dget(file->f_path.dentry);

spin_lock(&fc->lock);
list_del(&ff->write_entry);
Expand Down
12 changes: 5 additions & 7 deletions trunk/fs/fuse/fuse_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ struct fuse_req {
/** Data for asynchronous requests */
union {
struct fuse_forget_in forget_in;
struct fuse_release_in release_in;
struct {
struct fuse_release_in in;
struct vfsmount *vfsmount;
struct dentry *dentry;
} release;
struct fuse_init_in init_in;
struct fuse_init_out init_out;
struct fuse_read_in read_in;
Expand All @@ -238,12 +242,6 @@ struct fuse_req {
/** File used in the request (or NULL) */
struct fuse_file *ff;

/** vfsmount used in release */
struct vfsmount *vfsmount;

/** dentry used in release */
struct dentry *dentry;

/** Request completion callback */
void (*end)(struct fuse_conn *, struct fuse_req *);

Expand Down

0 comments on commit 24d1754

Please sign in to comment.