diff options
author | NeilBrown <neilb@suse.de> | 2013-06-13 02:53:42 (GMT) |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-07-01 21:53:28 (GMT) |
commit | 2a1c7f53fd31e46f51780b61eb99fffef4c3c5a6 (patch) | |
tree | 2c10acb62a365dfabd116c5c70e7c528a4f0e7e9 /net/sunrpc/addr.c | |
parent | f9e1aedc6c79f18bb56caa3735b94217c4ec1e0c (diff) | |
download | linux-2a1c7f53fd31e46f51780b61eb99fffef4c3c5a6.tar.xz |
sunrpc/cache: use cache_fresh_unlocked consistently and correctly.
cache_fresh_unlocked() is called when a cache entry
has been updated and ensures that if there were any
pending upcalls, they are cleared.
So every time we update a cache entry, we should call this,
and this should be the only way that we try to clear
pending calls (that sort of uniformity makes code sooo much
easier to read).
try_to_negate_entry() will (possibly) mark an entry as
negative. If it doesn't, it is because the entry already
is VALID.
So the entry will be valid on exit, so it is appropriate to
call cache_fresh_unlocked().
So tidy up try_to_negate_entry() to do that, and remove
partial open-coded cache_fresh_unlocked() from the one
call-site of try_to_negate_entry().
In the other branch of the 'switch(cache_make_upcall())',
we again have a partial open-coded version of cache_fresh_unlocked().
Replace that with a real call.
And again in cache_clean(), use a real call to cache_fresh_unlocked().
These call sites might previously have called
cache_revisit_request() if CACHE_PENDING wasn't set.
This is never necessary because cache_revisit_request() can
only do anything if the item is in the cache_defer_hash,
However any time that an item is added to the cache_defer_hash
(setup_deferral), the code immediately tests CACHE_PENDING,
and removes the entry again if it is clear. So all other
places we only need to 'cache_revisit_request' if we've
just cleared CACHE_PENDING.
Reported-by: Bodo Stroesser <bstroesser@ts.fujitsu.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/addr.c')
0 files changed, 0 insertions, 0 deletions