]> err.no Git - linux-2.6/blobdiff - include/linux/sunrpc/cache.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6
[linux-2.6] / include / linux / sunrpc / cache.h
index ad3f5cbdb7704a39730c116ba47c9dafd070f3af..3699dff7db8fd3c129488745f9e851d7abbf56e1 100644 (file)
@@ -163,7 +163,17 @@ static inline void cache_put(struct cache_head *h, struct cache_detail *cd)
        kref_put(&h->ref, cd->cache_put);
 }
 
-extern void cache_init(struct cache_head *h);
+static inline int cache_valid(struct cache_head *h)
+{
+       /* If an item has been unhashed pending removal when
+        * the refcount drops to 0, the expiry_time will be
+        * set to 0.  We don't want to consider such items
+        * valid in this context even though CACHE_VALID is
+        * set.
+        */
+       return (h->expiry_time != 0 && test_bit(CACHE_VALID, &h->flags));
+}
+
 extern int cache_check(struct cache_detail *detail,
                       struct cache_head *h, struct cache_req *rqstp);
 extern void cache_flush(void);