diff options
-rw-r--r-- | net/sunrpc/cache.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 39bddba53ba1..83592e012585 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
@@ -397,31 +397,28 @@ static int cache_clean(void) | |||
397 | /* Ok, now to clean this strand */ | 397 | /* Ok, now to clean this strand */ |
398 | 398 | ||
399 | cp = & current_detail->hash_table[current_index]; | 399 | cp = & current_detail->hash_table[current_index]; |
400 | ch = *cp; | 400 | for (ch = *cp ; ch ; cp = & ch->next, ch = *cp) { |
401 | for (; ch; cp= & ch->next, ch= *cp) { | ||
402 | if (current_detail->nextcheck > ch->expiry_time) | 401 | if (current_detail->nextcheck > ch->expiry_time) |
403 | current_detail->nextcheck = ch->expiry_time+1; | 402 | current_detail->nextcheck = ch->expiry_time+1; |
404 | if (ch->expiry_time >= get_seconds() && | 403 | if (ch->expiry_time >= get_seconds() && |
405 | ch->last_refresh >= current_detail->flush_time) | 404 | ch->last_refresh >= current_detail->flush_time) |
406 | continue; | 405 | continue; |
407 | if (test_and_clear_bit(CACHE_PENDING, &ch->flags)) | ||
408 | cache_dequeue(current_detail, ch); | ||
409 | 406 | ||
410 | if (atomic_read(&ch->ref.refcount) == 1) | ||
411 | break; | ||
412 | } | ||
413 | if (ch) { | ||
414 | *cp = ch->next; | 407 | *cp = ch->next; |
415 | ch->next = NULL; | 408 | ch->next = NULL; |
416 | current_detail->entries--; | 409 | current_detail->entries--; |
417 | rv = 1; | 410 | rv = 1; |
411 | break; | ||
418 | } | 412 | } |
413 | |||
419 | write_unlock(¤t_detail->hash_lock); | 414 | write_unlock(¤t_detail->hash_lock); |
420 | d = current_detail; | 415 | d = current_detail; |
421 | if (!ch) | 416 | if (!ch) |
422 | current_index ++; | 417 | current_index ++; |
423 | spin_unlock(&cache_list_lock); | 418 | spin_unlock(&cache_list_lock); |
424 | if (ch) { | 419 | if (ch) { |
420 | if (test_and_clear_bit(CACHE_PENDING, &ch->flags)) | ||
421 | cache_dequeue(current_detail, ch); | ||
425 | cache_revisit_request(ch); | 422 | cache_revisit_request(ch); |
426 | cache_put(ch, d); | 423 | cache_put(ch, d); |
427 | } | 424 | } |