diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2007-10-18 06:07:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 17:37:31 -0400 |
commit | 93a8c3cd9e9834dc5f5c373336f3a0065521152d (patch) | |
tree | ce8731adbf7a2bcd441e8b82d3d932abf94b13df /fs/fuse/inode.c | |
parent | a9ff4f87056cd31a8232b88d013dc6c9ad719c18 (diff) |
fuse: add list of writable files to fuse_inode
Each WRITE request must carry a valid file descriptor. When a page is written
back from a memory mapping, the file through which the page was dirtied is not
available, so a new mechananism is needed to find a suitable file in
->writepage(s).
A list of fuse_files is added to fuse_inode. The file is removed from the
list in fuse_release().
This patch is in preparation for writable mmap support.
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>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r-- | fs/fuse/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 3c13981f48e2..49d716036ea7 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -56,6 +56,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb) | |||
56 | fi->i_time = 0; | 56 | fi->i_time = 0; |
57 | fi->nodeid = 0; | 57 | fi->nodeid = 0; |
58 | fi->nlookup = 0; | 58 | fi->nlookup = 0; |
59 | INIT_LIST_HEAD(&fi->write_files); | ||
59 | fi->forget_req = fuse_request_alloc(); | 60 | fi->forget_req = fuse_request_alloc(); |
60 | if (!fi->forget_req) { | 61 | if (!fi->forget_req) { |
61 | kmem_cache_free(fuse_inode_cachep, inode); | 62 | kmem_cache_free(fuse_inode_cachep, inode); |
@@ -68,6 +69,7 @@ static struct inode *fuse_alloc_inode(struct super_block *sb) | |||
68 | static void fuse_destroy_inode(struct inode *inode) | 69 | static void fuse_destroy_inode(struct inode *inode) |
69 | { | 70 | { |
70 | struct fuse_inode *fi = get_fuse_inode(inode); | 71 | struct fuse_inode *fi = get_fuse_inode(inode); |
72 | BUG_ON(!list_empty(&fi->write_files)); | ||
71 | if (fi->forget_req) | 73 | if (fi->forget_req) |
72 | fuse_request_free(fi->forget_req); | 74 | fuse_request_free(fi->forget_req); |
73 | kmem_cache_free(fuse_inode_cachep, inode); | 75 | kmem_cache_free(fuse_inode_cachep, inode); |