r5560 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Sat Nov 20 22:59:43 CET 2010


Author: phk
Date: 2010-11-20 22:59:43 +0100 (Sat, 20 Nov 2010)
New Revision: 5560

Modified:
   trunk/varnish-cache/bin/varnishd/storage_persistent.c
Log:
Give -spersistent its own ->allocobj() method, which is just a clone
of the default method for now.



Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_persistent.c	2010-11-20 21:59:05 UTC (rev 5559)
+++ trunk/varnish-cache/bin/varnishd/storage_persistent.c	2010-11-20 21:59:43 UTC (rev 5560)
@@ -69,6 +69,9 @@
 
 #define OC_F_NEEDFIXUP OC_F_PRIV
 
+static struct storage *smp_alloc(struct stevedore *st, size_t size,
+    struct objcore *oc);
+
 /*
  * Context for a signature.
  *
@@ -1286,6 +1289,28 @@
 }
 
 /*--------------------------------------------------------------------
+ * Allocate an object
+ */
+
+static struct object *
+smp_allocobj(struct stevedore *stv, struct sess *sp, unsigned ltot,
+    struct stv_objsecrets *soc)
+{
+	struct object *o;
+	struct storage *st;
+
+	st = smp_alloc(stv, ltot, sp->objcore);
+	XXXAN(st);
+	xxxassert(st->space >= ltot);
+	ltot = st->len = st->space;
+	o = STV_MkObject(sp, st->ptr, ltot, soc);
+	CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
+	o->objstore = st;
+	return (o);
+}
+
+
+/*--------------------------------------------------------------------
  * Designate object
  */
 
@@ -1503,6 +1528,7 @@
 	.open	=	smp_open,
 	.close	=	smp_close,
 	.alloc	=	smp_alloc,
+	.allocobj =	smp_allocobj,
 	.object	=	smp_object,
 	.free	=	smp_free,
 	.trim	=	smp_trim,




More information about the varnish-commit mailing list