Merge tag 'v4.4-rc1'
[firefly-linux-kernel-4.4.55.git] / include / linux / sunrpc / cache.h
index 03d3b4c92d9f1171134e4dcea78080d4f42ccafe..ed03c9f7f908d7a477ef5349f35439b30b014b85 100644 (file)
 struct cache_head {
        struct hlist_node       cache_list;
        time_t          expiry_time;    /* After time time, don't use the data */
-       time_t          last_refresh;   /* If CACHE_PENDING, this is when upcall 
-                                        * was sent, else this is when update was received
+       time_t          last_refresh;   /* If CACHE_PENDING, this is when upcall was
+                                        * sent, else this is when update was
+                                        * received, though it is alway set to
+                                        * be *after* ->flush_time.
                                         */
        struct kref     ref;
        unsigned long   flags;
@@ -105,8 +107,12 @@ struct cache_detail {
        /* fields below this comment are for internal use
         * and should not be touched by cache owners
         */
-       time_t                  flush_time;             /* flush all cache items with last_refresh
-                                                        * earlier than this */
+       time_t                  flush_time;             /* flush all cache items with
+                                                        * last_refresh at or earlier
+                                                        * than this.  last_refresh
+                                                        * is never set at or earlier
+                                                        * than this.
+                                                        */
        struct list_head        others;
        time_t                  nextcheck;
        int                     entries;
@@ -203,7 +209,7 @@ static inline void cache_put(struct cache_head *h, struct cache_detail *cd)
 static inline int cache_is_expired(struct cache_detail *detail, struct cache_head *h)
 {
        return  (h->expiry_time < seconds_since_boot()) ||
-               (detail->flush_time > h->last_refresh);
+               (detail->flush_time >= h->last_refresh);
 }
 
 extern int cache_check(struct cache_detail *detail,