diff options
author | David Howells <dhowells@redhat.com> | 2009-04-03 11:42:37 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2009-04-03 11:42:37 -0400 |
commit | 0e04d4cefcf4d8fbbdb2c50e93ad541582933fd2 (patch) | |
tree | 97c4cda6a2c246660e6a5c718a9272375cdb259c /include/linux/fscache.h | |
parent | a6891645cf2ddd4778096848a864580e7258faba (diff) |
FS-Cache: Add cache tag handling
Implement two features of FS-Cache:
(1) The ability to request and release cache tags - names by which a cache may
be known to a netfs, and thus selected for use.
(2) An internal function by which a cache is selected by consulting the netfs,
if the netfs wishes to be consulted.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
Diffstat (limited to 'include/linux/fscache.h')
-rw-r--r-- | include/linux/fscache.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/fscache.h b/include/linux/fscache.h index feb3b0e0af4d..9584c094d69f 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h | |||
@@ -173,6 +173,8 @@ struct fscache_netfs { | |||
173 | * - these are undefined symbols when FS-Cache is not configured and the | 173 | * - these are undefined symbols when FS-Cache is not configured and the |
174 | * optimiser takes care of not using them | 174 | * optimiser takes care of not using them |
175 | */ | 175 | */ |
176 | extern struct fscache_cache_tag *__fscache_lookup_cache_tag(const char *); | ||
177 | extern void __fscache_release_cache_tag(struct fscache_cache_tag *); | ||
176 | 178 | ||
177 | /** | 179 | /** |
178 | * fscache_register_netfs - Register a filesystem as desiring caching services | 180 | * fscache_register_netfs - Register a filesystem as desiring caching services |
@@ -218,7 +220,10 @@ void fscache_unregister_netfs(struct fscache_netfs *netfs) | |||
218 | static inline | 220 | static inline |
219 | struct fscache_cache_tag *fscache_lookup_cache_tag(const char *name) | 221 | struct fscache_cache_tag *fscache_lookup_cache_tag(const char *name) |
220 | { | 222 | { |
221 | return NULL; | 223 | if (fscache_available()) |
224 | return __fscache_lookup_cache_tag(name); | ||
225 | else | ||
226 | return NULL; | ||
222 | } | 227 | } |
223 | 228 | ||
224 | /** | 229 | /** |
@@ -233,6 +238,8 @@ struct fscache_cache_tag *fscache_lookup_cache_tag(const char *name) | |||
233 | static inline | 238 | static inline |
234 | void fscache_release_cache_tag(struct fscache_cache_tag *tag) | 239 | void fscache_release_cache_tag(struct fscache_cache_tag *tag) |
235 | { | 240 | { |
241 | if (fscache_available()) | ||
242 | __fscache_release_cache_tag(tag); | ||
236 | } | 243 | } |
237 | 244 | ||
238 | /** | 245 | /** |