aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2007-10-18 06:07:03 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:31 -0400
commit93a8c3cd9e9834dc5f5c373336f3a0065521152d (patch)
treece8731adbf7a2bcd441e8b82d3d932abf94b13df /fs/fuse/file.c
parenta9ff4f87056cd31a8232b88d013dc6c9ad719c18 (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/file.c')
-rw-r--r--fs/fuse/file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 471ea70be48d..c4c59c7d0038 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -56,6 +56,7 @@ struct fuse_file *fuse_file_alloc(void)
56 kfree(ff); 56 kfree(ff);
57 ff = NULL; 57 ff = NULL;
58 } 58 }
59 INIT_LIST_HEAD(&ff->write_entry);
59 atomic_set(&ff->count, 0); 60 atomic_set(&ff->count, 0);
60 } 61 }
61 return ff; 62 return ff;
@@ -150,12 +151,18 @@ int fuse_release_common(struct inode *inode, struct file *file, int isdir)
150{ 151{
151 struct fuse_file *ff = file->private_data; 152 struct fuse_file *ff = file->private_data;
152 if (ff) { 153 if (ff) {
154 struct fuse_conn *fc = get_fuse_conn(inode);
155
153 fuse_release_fill(ff, get_node_id(inode), file->f_flags, 156 fuse_release_fill(ff, get_node_id(inode), file->f_flags,
154 isdir ? FUSE_RELEASEDIR : FUSE_RELEASE); 157 isdir ? FUSE_RELEASEDIR : FUSE_RELEASE);
155 158
156 /* Hold vfsmount and dentry until release is finished */ 159 /* Hold vfsmount and dentry until release is finished */
157 ff->reserved_req->vfsmount = mntget(file->f_path.mnt); 160 ff->reserved_req->vfsmount = mntget(file->f_path.mnt);
158 ff->reserved_req->dentry = dget(file->f_path.dentry); 161 ff->reserved_req->dentry = dget(file->f_path.dentry);
162
163 spin_lock(&fc->lock);
164 list_del(&ff->write_entry);
165 spin_unlock(&fc->lock);
159 /* 166 /*
160 * Normally this will send the RELEASE request, 167 * Normally this will send the RELEASE request,
161 * however if some asynchronous READ or WRITE requests 168 * however if some asynchronous READ or WRITE requests