Message ID | aed565ba-9eaf-23e4-6746-87b652a04685@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 62a60ee..782024e 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -204,8 +204,11 @@ static inline void cache_put(struct cache_head *h, struct cache_detail *cd) kref_put(&h->ref, cd->cache_put); } -static inline int cache_is_expired(struct cache_detail *detail, struct cache_head *h) +static inline bool cache_is_expired(struct cache_detail *detail, struct cache_head *h) { + if (!test_bit(CACHE_VALID, &h->flags)) + return false; + return (h->expiry_time < seconds_since_boot()) || (detail->flush_time >= h->last_refresh); }