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>
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index b24fc9b..5657cca 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -70,6 +70,9 @@
/** 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 */
@@ -82,6 +85,9 @@
/** Refcount */
atomic_t count;
+
+ /** Entry on inode's write_files list */
+ struct list_head write_entry;
};
/** One input argument of a request */