Whamcloud - gitweb
b=6866
[fs/lustre-release.git] / lustre / kernel_patches / patches / linux-2.6.10-fc3-sunrpc_cacheput.patch
1 --- linux-2.6.10/include/linux/sunrpc/cache.h.orig      2005-06-01 15:05:58.000000000 -0600
2 +++ linux-2.6.10/include/linux/sunrpc/cache.h   2005-06-01 15:12:06.000000000 -0600
3 @@ -264,13 +264,12 @@ static inline struct cache_head  *cache_
4  
5  static inline int cache_put(struct cache_head *h, struct cache_detail *cd)
6  {
7 -       atomic_dec(&h->refcnt);
8 -       if (!atomic_read(&h->refcnt) &&
9 -           h->expiry_time < cd->nextcheck)
10 -               cd->nextcheck = h->expiry_time;
11 -       if (!test_bit(CACHE_HASHED, &h->flags) &&
12 -           !atomic_read(&h->refcnt))
13 -               return 1;
14 +       if (atomic_dec_and_test(&h->refcnt)) {
15 +               if (h->expiry_time < cd->nextcheck)
16 +                       cd->nextcheck = h->expiry_time;
17 +               if (!test_bit(CACHE_HASHED, &h->flags))
18 +                       return 1;
19 +       }
20  
21         return 0;
22  }