From 61375ee8afc57792f476fe03e3444bdfce468828 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 3 Feb 2010 17:31:31 +1100 Subject: [PATCH] --- yaml --- r: 192349 b: refs/heads/master c: 3af4974eb2c7867d6e160977195dfde586d0e564 h: refs/heads/master i: 192347: 4f6249571e63792f660ae174bb46808f234a50f9 v: v3 --- [refs] | 2 +- trunk/net/sunrpc/cache.c | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 92cf5364f4b6..b32d7f6172df 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e739cf1da48e841bc5d744a99764c1a668b4bdd2 +refs/heads/master: 3af4974eb2c7867d6e160977195dfde586d0e564 diff --git a/trunk/net/sunrpc/cache.c b/trunk/net/sunrpc/cache.c index 39bddba53ba1..83592e012585 100644 --- a/trunk/net/sunrpc/cache.c +++ b/trunk/net/sunrpc/cache.c @@ -397,31 +397,28 @@ static int cache_clean(void) /* Ok, now to clean this strand */ cp = & current_detail->hash_table[current_index]; - ch = *cp; - for (; ch; cp= & ch->next, ch= *cp) { + for (ch = *cp ; ch ; cp = & ch->next, ch = *cp) { if (current_detail->nextcheck > ch->expiry_time) current_detail->nextcheck = ch->expiry_time+1; if (ch->expiry_time >= get_seconds() && ch->last_refresh >= current_detail->flush_time) 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; ch->next = NULL; current_detail->entries--; rv = 1; + break; } + write_unlock(¤t_detail->hash_lock); d = current_detail; if (!ch) current_index ++; spin_unlock(&cache_list_lock); if (ch) { + if (test_and_clear_bit(CACHE_PENDING, &ch->flags)) + cache_dequeue(current_detail, ch); cache_revisit_request(ch); cache_put(ch, d); }