9p: Add fscache support to 9p

This patch adds a persistent, read-only caching facility for
9p clients using the FS-Cache caching backend.

When the fscache facility is enabled, each inode is associated
with a corresponding vcookie which is an index into the FS-Cache
indexing tree. The FS-Cache indexing tree is indexed at 3 levels:
- session object associated with each mount.
- inode/vcookie
- actual data (pages)

A cache tag is chosen randomly for each session. These tags can
be read off /sys/fs/9p/caches and can be passed as a mount-time
parameter to re-attach to the specified caching session.

Signed-off-by: Abhishek Kulkarni <adkulkar@umail.iu.edu>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
This commit is contained in:
Abhishek Kulkarni 2009-09-23 13:00:27 -05:00 committed by Eric Van Hensbergen
parent 637d020a02
commit 60e78d2c99
12 changed files with 1009 additions and 42 deletions

View file

@ -44,20 +44,8 @@
#include "v9fs_vfs.h"
#include "fid.h"
static void v9fs_clear_inode(struct inode *);
static const struct super_operations v9fs_super_ops;
/**
* v9fs_clear_inode - release an inode
* @inode: inode to release
*
*/
static void v9fs_clear_inode(struct inode *inode)
{
filemap_fdatawrite(inode->i_mapping);
}
/**
* v9fs_set_super - set the superblock
* @s: super block
@ -220,6 +208,10 @@ v9fs_umount_begin(struct super_block *sb)
}
static const struct super_operations v9fs_super_ops = {
#ifdef CONFIG_9P_FSCACHE
.alloc_inode = v9fs_alloc_inode,
.destroy_inode = v9fs_destroy_inode,
#endif
.statfs = simple_statfs,
.clear_inode = v9fs_clear_inode,
.show_options = generic_show_options,