Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192349
b: refs/heads/master
c: 3af4974
h: refs/heads/master
i:
  192347: 4f62495
v: v3
  • Loading branch information
NeilBrown authored and J. Bruce Fields committed Mar 14, 2010
1 parent 6bae824 commit 61375ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 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: e739cf1da48e841bc5d744a99764c1a668b4bdd2
refs/heads/master: 3af4974eb2c7867d6e160977195dfde586d0e564
13 changes: 5 additions & 8 deletions trunk/net/sunrpc/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(&current_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);
}
Expand Down

0 comments on commit 61375ee

Please sign in to comment.