Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24272
b: refs/heads/master
c: 4013ede
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Mar 27, 2006
1 parent c0f628c commit f21998f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 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: f9ecc921b5b5e135050e7f22fef873c249aee3fc
refs/heads/master: 4013edea9a0b6cdcb1fdf5d4011e47e068fd6efb
14 changes: 8 additions & 6 deletions trunk/net/sunrpc/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ int cache_check(struct cache_detail *detail,
if (rv == -EAGAIN)
cache_defer_req(rqstp, h);

if (rv && h)
if (rv)
detail->cache_put(h, detail);
return rv;
}
Expand All @@ -223,8 +223,10 @@ void cache_fresh(struct cache_detail *detail,
head->last_refresh = get_seconds();
if (!test_and_set_bit(CACHE_VALID, &head->flags))
cache_revisit_request(head);
if (test_and_clear_bit(CACHE_PENDING, &head->flags))
if (test_and_clear_bit(CACHE_PENDING, &head->flags)) {
cache_revisit_request(head);
queue_loose(detail, head);
}
}

/*
Expand Down Expand Up @@ -551,7 +553,7 @@ static void cache_defer_req(struct cache_req *req, struct cache_head *item)
/* there was one too many */
dreq->revisit(dreq, 1);
}
if (test_bit(CACHE_VALID, &item->flags)) {
if (!test_bit(CACHE_PENDING, &item->flags)) {
/* must have just been validated... */
cache_revisit_request(item);
}
Expand Down Expand Up @@ -892,7 +894,7 @@ static void queue_loose(struct cache_detail *detail, struct cache_head *ch)
if (cr->item != ch)
continue;
if (cr->readers != 0)
break;
continue;
list_del(&cr->q.list);
spin_unlock(&queue_lock);
detail->cache_put(cr->item, detail);
Expand Down Expand Up @@ -1180,8 +1182,8 @@ static int c_show(struct seq_file *m, void *p)
return cd->cache_show(m, cd, NULL);

ifdebug(CACHE)
seq_printf(m, "# expiry=%ld refcnt=%d\n",
cp->expiry_time, atomic_read(&cp->refcnt));
seq_printf(m, "# expiry=%ld refcnt=%d flags=%lx\n",
cp->expiry_time, atomic_read(&cp->refcnt), cp->flags);
cache_get(cp);
if (cache_check(cd, cp, NULL))
/* cache_check does a cache_put on failure */
Expand Down

0 comments on commit f21998f

Please sign in to comment.