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>
This commit is contained in:
NeilBrown
2010-08-12 16:55:22 +10:00
committed by J. Bruce Fields
parent 1132b26029
commit 17cebf658e
2 changed files with 9 additions and 6 deletions

View File

@ -228,4 +228,10 @@ static inline time_t get_expiry(char **bpp)
return rv;
}
static inline void sunrpc_invalidate(struct cache_head *h,
struct cache_detail *detail)
{
h->expiry_time = get_seconds() - 1;
detail->nextcheck = get_seconds();
}
#endif /* _LINUX_SUNRPC_CACHE_H_ */