mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 02:21:15 +00:00
sunrpc: don't keep expired entries in the auth caches.
currently expired entries remain in the auth caches as long as there is a reference. This was needed long ago when the auth_domain cache used the same cache infrastructure. But since that (being a very different sort of cache) was separated, this test is no longer needed. So remove the test on refcnt and tidy up the surrounding code. This allows the cache_dequeue call (which needed to be there to drop a potentially awkward reference) can be moved outside of the spinlock which is a better place for it. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
This commit is contained in:
parent
e739cf1da4
commit
3af4974eb2
1 changed files with 5 additions and 8 deletions
|
@ -397,31 +397,28 @@ static int cache_clean(void)
|
||||||
/* Ok, now to clean this strand */
|
/* Ok, now to clean this strand */
|
||||||
|
|
||||||
cp = & current_detail->hash_table[current_index];
|
cp = & current_detail->hash_table[current_index];
|
||||||
ch = *cp;
|
for (ch = *cp ; ch ; cp = & ch->next, ch = *cp) {
|
||||||
for (; ch; cp= & ch->next, ch= *cp) {
|
|
||||||
if (current_detail->nextcheck > ch->expiry_time)
|
if (current_detail->nextcheck > ch->expiry_time)
|
||||||
current_detail->nextcheck = ch->expiry_time+1;
|
current_detail->nextcheck = ch->expiry_time+1;
|
||||||
if (ch->expiry_time >= get_seconds() &&
|
if (ch->expiry_time >= get_seconds() &&
|
||||||
ch->last_refresh >= current_detail->flush_time)
|
ch->last_refresh >= current_detail->flush_time)
|
||||||
continue;
|
continue;
|
||||||
if (test_and_clear_bit(CACHE_PENDING, &ch->flags))
|
|
||||||
cache_dequeue(current_detail, ch);
|
|
||||||
|
|
||||||
if (atomic_read(&ch->ref.refcount) == 1)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (ch) {
|
|
||||||
*cp = ch->next;
|
*cp = ch->next;
|
||||||
ch->next = NULL;
|
ch->next = NULL;
|
||||||
current_detail->entries--;
|
current_detail->entries--;
|
||||||
rv = 1;
|
rv = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
write_unlock(¤t_detail->hash_lock);
|
write_unlock(¤t_detail->hash_lock);
|
||||||
d = current_detail;
|
d = current_detail;
|
||||||
if (!ch)
|
if (!ch)
|
||||||
current_index ++;
|
current_index ++;
|
||||||
spin_unlock(&cache_list_lock);
|
spin_unlock(&cache_list_lock);
|
||||||
if (ch) {
|
if (ch) {
|
||||||
|
if (test_and_clear_bit(CACHE_PENDING, &ch->flags))
|
||||||
|
cache_dequeue(current_detail, ch);
|
||||||
cache_revisit_request(ch);
|
cache_revisit_request(ch);
|
||||||
cache_put(ch, d);
|
cache_put(ch, d);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue