diff options
author | NeilBrown <neilb@suse.de> | 2006-03-27 04:15:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:41 -0500 |
commit | 15a5f6bd23eddd5b3be80366f364be04fb1c1c99 (patch) | |
tree | e3c4fa8eb9e8b21ebca33370b7a93eab11662a5d /include/linux | |
parent | 7d317f2c9f1e9dcf4f632fa98f91d1d4a36c4cae (diff) |
[PATCH] knfsd: Create cache_lookup function instead of using a macro to declare one
The C++-like 'template' approach proves to be too ugly and hard to work with.
The old 'template' won't go away until all users are updated.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-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;}) ; \ |