Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231156
b: refs/heads/master
c: fdef7aa
h: refs/heads/master
v: v3
  • Loading branch information
J. Bruce Fields committed Jan 4, 2011
1 parent fec760c commit 3ece4ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6bab93f87ec703bf6650875881b11f9f27d7da56
refs/heads/master: fdef7aa5d4020fd94ffcbf0078d6bd9e5a111e19
11 changes: 10 additions & 1 deletion trunk/net/sunrpc/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ static void cache_fresh_locked(struct cache_head *head, time_t expiry)
{
head->expiry_time = expiry;
head->last_refresh = seconds_since_boot();
smp_wmb(); /* paired with smp_rmb() in cache_is_valid() */
set_bit(CACHE_VALID, &head->flags);
}

Expand Down Expand Up @@ -208,8 +209,16 @@ static inline int cache_is_valid(struct cache_detail *detail, struct cache_head
/* entry is valid */
if (test_bit(CACHE_NEGATIVE, &h->flags))
return -ENOENT;
else
else {
/*
* In combination with write barrier in
* sunrpc_cache_update, ensures that anyone
* using the cache entry after this sees the
* updated contents:
*/
smp_rmb();
return 0;
}
}
}

Expand Down

0 comments on commit 3ece4ca

Please sign in to comment.