[master] 499939c57 boc: Rename len_so_far to fetched_so_far
Nils Goroll
nils.goroll at uplex.de
Mon Nov 7 14:57:05 UTC 2022
commit 499939c57355942db6facd775123728aa5b98ebe
Author: Alf-André Walla <fwsgonzo at hotmail.com>
Date: Tue Dec 7 11:24:20 2021 +0100
boc: Rename len_so_far to fetched_so_far
This clarifies which length this field is about.
Better diff with the --word-diff --word-diff-regex='\w+' options.
Signed-off-by: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index de022c726..c46ef68b9 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -295,7 +295,7 @@ struct boc {
void *stevedore_priv;
enum boc_state_e state;
uint8_t *vary;
- uint64_t len_so_far;
+ uint64_t fetched_so_far;
};
/* Object core structure ---------------------------------------------
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 95bbc27f0..bc46e280c 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -670,7 +670,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
if (oc->flags & OC_F_PRIVATE)
AN(bo->uncacheable);
- oc->boc->len_so_far = 0;
+ oc->boc->fetched_so_far = 0;
INIT_OBJ(ctx, VRT_CTX_MAGIC);
VCL_Bo2Ctx(ctx, bo);
@@ -738,7 +738,7 @@ vbf_stp_fetchend(struct worker *wrk, struct busyobj *bo)
give predictable backend reuse behavior for varnishtest */
vbf_cleanup(bo);
- AZ(ObjSetU64(wrk, oc, OA_LEN, oc->boc->len_so_far));
+ AZ(ObjSetU64(wrk, oc, OA_LEN, oc->boc->fetched_so_far));
if (bo->do_stream)
assert(oc->boc->state == BOS_STREAM);
@@ -898,7 +898,7 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
VSLb_ts_busyobj(bo, "Error", now);
if (oc->stobj->stevedore != NULL) {
- oc->boc->len_so_far = 0;
+ oc->boc->fetched_so_far = 0;
ObjFreeObj(bo->wrk, oc);
}
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 337727c99..4a77e7ffd 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -520,7 +520,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp)
return (HSH_HITMISS);
}
oc->hits++;
- boc_progress = oc->boc == NULL ? -1 : oc->boc->len_so_far;
+ boc_progress = oc->boc == NULL ? -1 : oc->boc->fetched_so_far;
AN(hsh_deref_objhead_unlock(wrk, &oh, HSH_RUSH_POLICY));
Req_LogHit(wrk, req, oc, boc_progress);
return (HSH_HIT);
@@ -543,7 +543,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp)
}
if (exp_oc != NULL && exp_oc->boc != NULL)
- boc_progress = exp_oc->boc->len_so_far;
+ boc_progress = exp_oc->boc->fetched_so_far;
else
boc_progress = -1;
diff --git a/bin/varnishd/cache/cache_obj.c b/bin/varnishd/cache/cache_obj.c
index 24785b567..781c5c2a0 100644
--- a/bin/varnishd/cache/cache_obj.c
+++ b/bin/varnishd/cache/cache_obj.c
@@ -230,7 +230,7 @@ ObjExtend(struct worker *wrk, struct objcore *oc, ssize_t l, int final)
AN(om->objextend);
if (l > 0) {
om->objextend(wrk, oc, l);
- oc->boc->len_so_far += l;
+ oc->boc->fetched_so_far += l;
AZ(pthread_cond_broadcast(&oc->boc->cond));
}
Lck_Unlock(&oc->boc->mtx);
@@ -253,13 +253,13 @@ ObjWaitExtend(const struct worker *wrk, const struct objcore *oc, uint64_t l)
CHECK_OBJ_NOTNULL(oc->boc, BOC_MAGIC);
Lck_Lock(&oc->boc->mtx);
while (1) {
- rv = oc->boc->len_so_far;
+ rv = oc->boc->fetched_so_far;
assert(l <= rv || oc->boc->state == BOS_FAILED);
if (rv > l || oc->boc->state >= BOS_FINISHED)
break;
(void)Lck_CondWait(&oc->boc->cond, &oc->boc->mtx);
}
- rv = oc->boc->len_so_far;
+ rv = oc->boc->fetched_so_far;
Lck_Unlock(&oc->boc->mtx);
return (rv);
}
diff --git a/bin/varnishd/storage/storage_simple.c b/bin/varnishd/storage/storage_simple.c
index 429ef4f96..5735eed7e 100644
--- a/bin/varnishd/storage/storage_simple.c
+++ b/bin/varnishd/storage/storage_simple.c
@@ -324,7 +324,7 @@ sml_iterator(struct worker *wrk, struct objcore *oc,
l = 0;
u = 0;
- if (boc->len_so_far == 0) {
+ if (boc->fetched_so_far == 0) {
ret = func(priv, OBJ_ITER_FLUSH, NULL, 0);
if (ret)
return (ret);
More information about the varnish-commit
mailing list