Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71227
b: refs/heads/master
c: 93a8c3c
h: refs/heads/master
i:
  71225: 915bf51
  71223: 034d8c4
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Oct 18, 2007
1 parent f1562e3 commit 1ffe283
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9ff4f87056cd31a8232b88d013dc6c9ad719c18
refs/heads/master: 93a8c3cd9e9834dc5f5c373336f3a0065521152d
7 changes: 7 additions & 0 deletions trunk/fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct fuse_file *fuse_file_alloc(void)
kfree(ff);
ff = NULL;
}
INIT_LIST_HEAD(&ff->write_entry);
atomic_set(&ff->count, 0);
}
return ff;
Expand Down Expand Up @@ -150,12 +151,18 @@ 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);

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);

spin_lock(&fc->lock);
list_del(&ff->write_entry);
spin_unlock(&fc->lock);
/*
* Normally this will send the RELEASE request,
* however if some asynchronous READ or WRITE requests
Expand Down
6 changes: 6 additions & 0 deletions trunk/fs/fuse/fuse_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ struct fuse_inode {

/** Version of last attribute change */
u64 attr_version;

/** Files usable in writepage. Protected by fc->lock */
struct list_head write_files;
};

/** FUSE specific file data */
Expand All @@ -82,6 +85,9 @@ struct fuse_file {

/** Refcount */
atomic_t count;

/** Entry on inode's write_files list */
struct list_head write_entry;
};

/** One input argument of a request */
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
fi->i_time = 0;
fi->nodeid = 0;
fi->nlookup = 0;
INIT_LIST_HEAD(&fi->write_files);
fi->forget_req = fuse_request_alloc();
if (!fi->forget_req) {
kmem_cache_free(fuse_inode_cachep, inode);
Expand All @@ -68,6 +69,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb)
static void fuse_destroy_inode(struct inode *inode)
{
struct fuse_inode *fi = get_fuse_inode(inode);
BUG_ON(!list_empty(&fi->write_files));
if (fi->forget_req)
fuse_request_free(fi->forget_req);
kmem_cache_free(fuse_inode_cachep, inode);
Expand Down

0 comments on commit 1ffe283

Please sign in to comment.