[master] 6718050 Pass a dstat arg to oc->updatemeta()

Poul-Henning Kamp phk at FreeBSD.org
Wed Aug 13 14:56:03 CEST 2014


commit 67180503c2d9297da7f5618f94bbb47f0bc323f8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Aug 13 12:55:46 2014 +0000

    Pass a dstat arg to oc->updatemeta()

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 0b6ebd3..9ff55f6 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -373,7 +373,7 @@ struct storage {
  */
 
 typedef struct object *getobj_f(struct dstat *ds, struct objcore *oc);
-typedef void updatemeta_f(struct objcore *oc);
+typedef void updatemeta_f(struct objcore *oc, struct dstat *);
 typedef void freeobj_f(struct dstat *ds, struct objcore *oc);
 typedef struct lru *getlru_f(const struct objcore *oc);
 
@@ -1066,7 +1066,7 @@ void ObjTrimStore(struct objcore *, struct dstat *);
 unsigned ObjGetXID(struct objcore *, struct dstat *);
 uint64_t ObjGetLen(struct objcore *oc, struct dstat *ds);
 struct object *ObjGetObj(struct objcore *, struct dstat *);
-void ObjUpdateMeta(struct objcore *);
+void ObjUpdateMeta(struct objcore *, struct dstat *);
 void ObjFreeObj(struct objcore *, struct dstat *);
 struct lru *ObjGetLRU(const struct objcore *);
 void *ObjGetattr(struct objcore *oc, struct dstat *ds, enum obj_attr attr,
diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index fdd0443..73992bc 100644
--- a/bin/varnishd/cache/cache_ban.c
+++ b/bin/varnishd/cache/cache_ban.c
@@ -963,7 +963,7 @@ BAN_CheckObject(struct worker *wrk, struct objcore *oc, struct req *req)
 
 	if (b == oc->ban) {	/* not banned */
 		oc->ban = b0;
-		ObjUpdateMeta(oc);
+		ObjUpdateMeta(oc, &wrk->stats);
 		return (0);
 	} else {
 		oc->ban = NULL;
diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index 2afb254..ca82aaa 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -397,7 +397,7 @@ exp_inbox(struct exp_priv *ep, struct objcore *oc, double now)
 		o = ObjGetObj(oc, &ep->wrk->stats);
 		CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
 		oc->timer_when = EXP_When(&oc->exp);
-		ObjUpdateMeta(oc);
+		ObjUpdateMeta(oc, &ep->wrk->stats);
 	}
 
 	VSLb(&ep->vsl, SLT_ExpKill, "EXP_When p=%p e=%.9f f=0x%x", oc,
diff --git a/bin/varnishd/cache/cache_obj.c b/bin/varnishd/cache/cache_obj.c
index 94dfb17..6d4f593 100644
--- a/bin/varnishd/cache/cache_obj.c
+++ b/bin/varnishd/cache/cache_obj.c
@@ -184,12 +184,12 @@ ObjGetObj(struct objcore *oc, struct dstat *ds)
 }
 
 void
-ObjUpdateMeta(struct objcore *oc)
+ObjUpdateMeta(struct objcore *oc, struct dstat *ds)
 {
 	const struct objcore_methods *m = obj_getmethods(oc);
 
 	if (m->updatemeta != NULL)
-		m->updatemeta(oc);
+		m->updatemeta(oc, ds);
 }
 
 void
diff --git a/bin/varnishd/storage/storage_persistent_silo.c b/bin/varnishd/storage/storage_persistent_silo.c
index 103c0bc..472453f 100644
--- a/bin/varnishd/storage/storage_persistent_silo.c
+++ b/bin/varnishd/storage/storage_persistent_silo.c
@@ -450,14 +450,14 @@ smp_oc_getobj(struct dstat *ds, struct objcore *oc)
 }
 
 static void
-smp_oc_updatemeta(struct objcore *oc)
+smp_oc_updatemeta(struct objcore *oc, struct dstat *ds)
 {
 	struct object *o;
 	struct smp_seg *sg;
 	struct smp_object *so;
 
 	CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
-	o = smp_oc_getobj(NULL, oc);
+	o = smp_oc_getobj(ds, oc);
 	AN(o);
 
 	CAST_OBJ_NOTNULL(sg, oc->priv, SMP_SEG_MAGIC);



More information about the varnish-commit mailing list