diff options
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/cache.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 405ac14e509a..3e17a5ff1dea 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -81,6 +81,11 @@ struct cache_detail { | |||
81 | struct cache_detail *cd, | 81 | struct cache_detail *cd, |
82 | struct cache_head *h); | 82 | struct cache_head *h); |
83 | 83 | ||
84 | struct cache_head * (*alloc)(void); | ||
85 | int (*match)(struct cache_head *orig, struct cache_head *new); | ||
86 | void (*init)(struct cache_head *orig, struct cache_head *new); | ||
87 | void (*update)(struct cache_head *orig, struct cache_head *new); | ||
88 | |||
84 | /* fields below this comment are for internal use | 89 | /* fields below this comment are for internal use |
85 | * and should not be touched by cache owners | 90 | * and should not be touched by cache owners |
86 | */ | 91 | */ |
@@ -237,6 +242,13 @@ RTN *FNAME ARGS \ | |||
237 | & FUNC##_cache, FUNC##_hash(item), FUNC##_match(item, tmp), \ | 242 | & FUNC##_cache, FUNC##_hash(item), FUNC##_match(item, tmp), \ |
238 | STRUCT##_init(new, item), STRUCT##_update(tmp, item)) | 243 | STRUCT##_init(new, item), STRUCT##_update(tmp, item)) |
239 | 244 | ||
245 | extern struct cache_head * | ||
246 | sunrpc_cache_lookup(struct cache_detail *detail, | ||
247 | struct cache_head *key, int hash); | ||
248 | extern struct cache_head * | ||
249 | sunrpc_cache_update(struct cache_detail *detail, | ||
250 | struct cache_head *new, struct cache_head *old, int hash); | ||
251 | |||
240 | 252 | ||
241 | #define cache_for_each(pos, detail, index, member) \ | 253 | #define cache_for_each(pos, detail, index, member) \ |
242 | for (({read_lock(&(detail)->hash_lock); index = (detail)->hash_size;}) ; \ | 254 | for (({read_lock(&(detail)->hash_lock); index = (detail)->hash_size;}) ; \ |