aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-09-09 02:32:54 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-09-18 17:01:12 -0400
commitcd68c374ea9ce202ae7c6346777d10078e243d49 (patch)
tree0aa206d2605c57c6944f7461c6eb1576a9d1f987 /net
parent67e7328f1577230ef3a1430c1a7e5c07978c6e51 (diff)
sunrpc/cache: avoid variable over-loading in cache_defer_req
In cache_defer_req, 'dreq' is used for two significantly different values that happen to be of the same type. This is both confusing, and makes it hard to extend the range of one of the values as we will in the next patch. So introduce 'discard' to take one of the values. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/cache.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 4a32a30a03eb..d6eee291a0e2 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -500,7 +500,7 @@ static int cache_defer_cnt;
500 500
501static int cache_defer_req(struct cache_req *req, struct cache_head *item) 501static int cache_defer_req(struct cache_req *req, struct cache_head *item)
502{ 502{
503 struct cache_deferred_req *dreq; 503 struct cache_deferred_req *dreq, *discard;
504 int hash = DFR_HASH(item); 504 int hash = DFR_HASH(item);
505 505
506 if (cache_defer_cnt >= DFR_MAX) { 506 if (cache_defer_cnt >= DFR_MAX) {
@@ -525,20 +525,20 @@ static int cache_defer_req(struct cache_req *req, struct cache_head *item)
525 list_add(&dreq->hash, &cache_defer_hash[hash]); 525 list_add(&dreq->hash, &cache_defer_hash[hash]);
526 526
527 /* it is in, now maybe clean up */ 527 /* it is in, now maybe clean up */
528 dreq = NULL; 528 discard = NULL;
529 if (++cache_defer_cnt > DFR_MAX) { 529 if (++cache_defer_cnt > DFR_MAX) {
530 dreq = list_entry(cache_defer_list.prev, 530 discard = list_entry(cache_defer_list.prev,
531 struct cache_deferred_req, recent); 531 struct cache_deferred_req, recent);
532 list_del_init(&dreq->recent); 532 list_del_init(&discard->recent);
533 list_del_init(&dreq->hash); 533 list_del_init(&discard->hash);
534 cache_defer_cnt--; 534 cache_defer_cnt--;
535 } 535 }
536 spin_unlock(&cache_defer_lock); 536 spin_unlock(&cache_defer_lock);
537 537
538 if (dreq) { 538 if (discard)
539 /* there was one too many */ 539 /* there was one too many */
540 dreq->revisit(dreq, 1); 540 discard->revisit(discard, 1);
541 } 541
542 if (!test_bit(CACHE_PENDING, &item->flags)) { 542 if (!test_bit(CACHE_PENDING, &item->flags)) {
543 /* must have just been validated... */ 543 /* must have just been validated... */
544 cache_revisit_request(item); 544 cache_revisit_request(item);