Merge tag 'nfs-for-4.11-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
[linux-2.6-microblaze.git] / include / linux / sunrpc / cache.h
index 8a511c0..270bad0 100644 (file)
@@ -63,15 +63,6 @@ struct cache_head {
 
 #define        CACHE_NEW_EXPIRY 120    /* keep new things pending confirmation for 120 seconds */
 
-struct cache_detail_procfs {
-       struct proc_dir_entry   *proc_ent;
-       struct proc_dir_entry   *flush_ent, *channel_ent, *content_ent;
-};
-
-struct cache_detail_pipefs {
-       struct dentry *dir;
-};
-
 struct cache_detail {
        struct module *         owner;
        int                     hash_size;
@@ -123,9 +114,9 @@ struct cache_detail {
        time_t                  last_warn;              /* when we last warned about no readers */
 
        union {
-               struct cache_detail_procfs procfs;
-               struct cache_detail_pipefs pipefs;
-       } u;
+               struct proc_dir_entry   *procfs;
+               struct dentry           *pipefs;
+       };
        struct net              *net;
 };
 
@@ -204,8 +195,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);
 }
@@ -227,6 +221,7 @@ extern void sunrpc_destroy_cache_detail(struct cache_detail *cd);
 extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *,
                                        umode_t, struct cache_detail *);
 extern void sunrpc_cache_unregister_pipefs(struct cache_detail *);
+extern void sunrpc_cache_unhash(struct cache_detail *, struct cache_head *);
 
 /* Must store cache_detail in seq_file->private if using next three functions */
 extern void *cache_seq_start(struct seq_file *file, loff_t *pos);