[master] 37916dc Tag objcore with the stevedore which manages its storage

Poul-Henning Kamp phk at FreeBSD.org
Mon Jun 30 08:17:16 CEST 2014


commit 37916dcc9c8a1fb60b44a0f46daf5efa10123132
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jun 30 06:17:02 2014 +0000

    Tag objcore with the stevedore which manages its storage

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 554dc8f..c4c20a1 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -418,6 +418,7 @@ struct objcore {
 	unsigned		magic;
 #define OBJCORE_MAGIC		0x4d301302
 	int			refcnt;
+	struct stevedore	*stevedore;
 	struct objcore_methods	*methods;
 	void			*priv;
 	uintptr_t		priv2;
diff --git a/bin/varnishd/storage/stevedore.c b/bin/varnishd/storage/stevedore.c
index 413f228..35f362a 100644
--- a/bin/varnishd/storage/stevedore.c
+++ b/bin/varnishd/storage/stevedore.c
@@ -290,6 +290,7 @@ STV_MkObject(struct stevedore *stv, struct busyobj *bo,
 
 	o->objcore = bo->fetch_objcore;
 
+	o->objcore->stevedore = stv;
 	o->objcore->methods = &default_oc_methods;
 	o->objcore->priv = o;
 	o->objcore->priv2 = (uintptr_t)stv;
@@ -382,6 +383,8 @@ STV_NewObject(struct busyobj *bo, const char *hint,
 
 	CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
 	CHECK_OBJ_NOTNULL(o->objstore, STORAGE_MAGIC);
+	CHECK_OBJ_NOTNULL(o->objcore, OBJCORE_MAGIC);
+	assert(o->objcore->stevedore == stv);
 	return (o);
 }
 



More information about the varnish-commit mailing list