aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-08-12 02:55:22 -0400
committerJ. Bruce Fields <bfields@redhat.com>2010-09-07 19:21:19 -0400
commit17cebf658e088935d4bdebfc7ad9800e9fc4a0b2 (patch)
tree7bc6c1d8de35bce17da188cba13688671d517907 /include/linux/sunrpc
parent1132b26029918aa8fb5ba24a81b5c234e61f356c (diff)
sunrpc: extract some common sunrpc_cache code from nfsd
Rather can duplicating this idiom twice, put it in an inline function. This reduces the usage of 'expiry_time' out side the sunrpc/cache.c code and thus the impact of a change that is about to be made to that field. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/cache.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 7bf3e84b92f4..0e1febf4e5bc 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -228,4 +228,10 @@ static inline time_t get_expiry(char **bpp)
228 return rv; 228 return rv;
229} 229}
230 230
231static inline void sunrpc_invalidate(struct cache_head *h,
232 struct cache_detail *detail)
233{
234 h->expiry_time = get_seconds() - 1;
235 detail->nextcheck = get_seconds();
236}
231#endif /* _LINUX_SUNRPC_CACHE_H_ */ 237#endif /* _LINUX_SUNRPC_CACHE_H_ */