diff options
author | Abhishek Kulkarni <adkulkar@umail.iu.edu> | 2009-09-23 14:00:27 -0400 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@strongmad.austin.ibm.com> | 2009-09-23 14:03:46 -0400 |
commit | 60e78d2c993e58d890596d951fff77d5965adcd6 (patch) | |
tree | 3d53ed7254c613ef8d8de36fdceda25bc493f4f7 /fs/9p/v9fs.h | |
parent | 637d020a02cd734bf27acfc56c6d942cddd9eb80 (diff) |
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>
Diffstat (limited to 'fs/9p/v9fs.h')
-rw-r--r-- | fs/9p/v9fs.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h index 38762bf102a9..019f4ccb70c1 100644 --- a/fs/9p/v9fs.h +++ b/fs/9p/v9fs.h | |||
@@ -51,6 +51,7 @@ enum p9_session_flags { | |||
51 | enum p9_cache_modes { | 51 | enum p9_cache_modes { |
52 | CACHE_NONE, | 52 | CACHE_NONE, |
53 | CACHE_LOOSE, | 53 | CACHE_LOOSE, |
54 | CACHE_FSCACHE, | ||
54 | }; | 55 | }; |
55 | 56 | ||
56 | /** | 57 | /** |
@@ -60,6 +61,8 @@ enum p9_cache_modes { | |||
60 | * @debug: debug level | 61 | * @debug: debug level |
61 | * @afid: authentication handle | 62 | * @afid: authentication handle |
62 | * @cache: cache mode of type &p9_cache_modes | 63 | * @cache: cache mode of type &p9_cache_modes |
64 | * @cachetag: the tag of the cache associated with this session | ||
65 | * @fscache: session cookie associated with FS-Cache | ||
63 | * @options: copy of options string given by user | 66 | * @options: copy of options string given by user |
64 | * @uname: string user name to mount hierarchy as | 67 | * @uname: string user name to mount hierarchy as |
65 | * @aname: mount specifier for remote hierarchy | 68 | * @aname: mount specifier for remote hierarchy |
@@ -68,7 +71,7 @@ enum p9_cache_modes { | |||
68 | * @dfltgid: default numeric groupid to mount hierarchy as | 71 | * @dfltgid: default numeric groupid to mount hierarchy as |
69 | * @uid: if %V9FS_ACCESS_SINGLE, the numeric uid which mounted the hierarchy | 72 | * @uid: if %V9FS_ACCESS_SINGLE, the numeric uid which mounted the hierarchy |
70 | * @clnt: reference to 9P network client instantiated for this session | 73 | * @clnt: reference to 9P network client instantiated for this session |
71 | * @debugfs_dir: reference to debugfs_dir which can be used for add'l debug | 74 | * @slist: reference to list of registered 9p sessions |
72 | * | 75 | * |
73 | * This structure holds state for each session instance established during | 76 | * This structure holds state for each session instance established during |
74 | * a sys_mount() . | 77 | * a sys_mount() . |
@@ -84,6 +87,10 @@ struct v9fs_session_info { | |||
84 | unsigned short debug; | 87 | unsigned short debug; |
85 | unsigned int afid; | 88 | unsigned int afid; |
86 | unsigned int cache; | 89 | unsigned int cache; |
90 | #ifdef CONFIG_9P_FSCACHE | ||
91 | char *cachetag; | ||
92 | struct fscache_cookie *fscache; | ||
93 | #endif | ||
87 | 94 | ||
88 | char *uname; /* user name to mount as */ | 95 | char *uname; /* user name to mount as */ |
89 | char *aname; /* name of remote hierarchy being mounted */ | 96 | char *aname; /* name of remote hierarchy being mounted */ |
@@ -92,11 +99,9 @@ struct v9fs_session_info { | |||
92 | unsigned int dfltgid; /* default gid for legacy support */ | 99 | unsigned int dfltgid; /* default gid for legacy support */ |
93 | u32 uid; /* if ACCESS_SINGLE, the uid that has access */ | 100 | u32 uid; /* if ACCESS_SINGLE, the uid that has access */ |
94 | struct p9_client *clnt; /* 9p client */ | 101 | struct p9_client *clnt; /* 9p client */ |
95 | struct dentry *debugfs_dir; | 102 | struct list_head slist; /* list of sessions registered with v9fs */ |
96 | }; | 103 | }; |
97 | 104 | ||
98 | extern struct dentry *v9fs_debugfs_root; | ||
99 | |||
100 | struct p9_fid *v9fs_session_init(struct v9fs_session_info *, const char *, | 105 | struct p9_fid *v9fs_session_init(struct v9fs_session_info *, const char *, |
101 | char *); | 106 | char *); |
102 | void v9fs_session_close(struct v9fs_session_info *v9ses); | 107 | void v9fs_session_close(struct v9fs_session_info *v9ses); |