Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231151
b: refs/heads/master
c: d76d181
h: refs/heads/master
i:
  231149: 1249fc5
  231147: 77be474
  231143: 181122a
  231135: 415bec1
v: v3
  • Loading branch information
J. Bruce Fields committed Jan 4, 2011
1 parent 0e0a7f8 commit 10d3547
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 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: 3beb6cd1d448e7ded938bbd676493e6a08e9a6cd
refs/heads/master: d76d1815f3e72fb627ad7f95ef63120b0a557c9c
18 changes: 11 additions & 7 deletions trunk/net/sunrpc/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#define RPCDBG_FACILITY RPCDBG_CACHE

static void cache_defer_req(struct cache_req *req, struct cache_head *item);
static bool cache_defer_req(struct cache_req *req, struct cache_head *item);
static void cache_revisit_request(struct cache_head *item);

static void cache_init(struct cache_head *h)
Expand Down Expand Up @@ -268,9 +268,11 @@ int cache_check(struct cache_detail *detail,
}

if (rv == -EAGAIN) {
cache_defer_req(rqstp, h);
if (!test_bit(CACHE_PENDING, &h->flags)) {
/* Request is not deferred */
if (!cache_defer_req(rqstp, h)) {
/*
* Request was not deferred; handle it as best
* we can ourselves:
*/
rv = cache_is_valid(detail, h);
if (rv == -EAGAIN)
rv = -ETIMEDOUT;
Expand Down Expand Up @@ -618,18 +620,19 @@ static void cache_limit_defers(void)
discard->revisit(discard, 1);
}

static void cache_defer_req(struct cache_req *req, struct cache_head *item)
/* Return true if and only if a deferred request is queued. */
static bool cache_defer_req(struct cache_req *req, struct cache_head *item)
{
struct cache_deferred_req *dreq;

if (req->thread_wait) {
cache_wait_req(req, item);
if (!test_bit(CACHE_PENDING, &item->flags))
return;
return false;
}
dreq = req->defer(req);
if (dreq == NULL)
return;
return false;
setup_deferral(dreq, item, 1);
if (!test_bit(CACHE_PENDING, &item->flags))
/* Bit could have been cleared before we managed to
Expand All @@ -638,6 +641,7 @@ static void cache_defer_req(struct cache_req *req, struct cache_head *item)
cache_revisit_request(item);

cache_limit_defers();
return true;
}

static void cache_revisit_request(struct cache_head *item)
Expand Down

0 comments on commit 10d3547

Please sign in to comment.