[master] 9cb08c1d8 merge HSH_EXP and HSH_EXPBUSY into HSH_GRACE

Nils Goroll nils.goroll at uplex.de
Mon Dec 3 20:18:07 UTC 2018


commit 9cb08c1d8f51bad69f3fe78951d606f1db11137e
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Dec 3 21:17:05 2018 +0100

    merge HSH_EXP and HSH_EXPBUSY into HSH_GRACE
    
    they are the same case

diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 5e1cff9e3..1d615d28b 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -496,7 +496,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
 			} else {
 				if (exp_oc->hits < LONG_MAX)
 					exp_oc->hits++;
-				retval = HSH_EXPBUSY;
+				retval = HSH_GRACE;
 			}
 		} else {
 			Lck_Unlock(&oh->mtx);
@@ -518,7 +518,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
 		assert(HSH_DerefObjHead(wrk, &oh));
 		if (exp_oc->hits < LONG_MAX)
 			exp_oc->hits++;
-		return (HSH_EXP);
+		return (HSH_GRACE);
 	}
 
 	/* There are one or more busy objects, wait for them */
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index c1bae241a..33010aba9 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -543,7 +543,7 @@ cnt_lookup(struct worker *wrk, struct req *req)
 		}
 		wrk->stats->cache_hit++;
 		req->is_hit = 1;
-		if (lr == HSH_EXP || lr == HSH_EXPBUSY)
+		if (lr == HSH_GRACE)
 			wrk->stats->cache_hit_grace++;
 		req->req_step = R_STP_DELIVER;
 		return (REQ_FSM_MORE);
diff --git a/bin/varnishd/hash/hash_slinger.h b/bin/varnishd/hash/hash_slinger.h
index d6cad78ae..aa4f284f4 100644
--- a/bin/varnishd/hash/hash_slinger.h
+++ b/bin/varnishd/hash/hash_slinger.h
@@ -53,8 +53,7 @@ enum lookup_e {
 	HSH_MISS,
 	HSH_BUSY,
 	HSH_HIT,
-	HSH_EXP,
-	HSH_EXPBUSY
+	HSH_GRACE
 };
 
 /* mgt_hash.c */


More information about the varnish-commit mailing list