[experimental-ims] 94c870b We always allocate an object entirely inside one stevedore now.

Geoff Simmons geoff at varnish-cache.org
Wed Aug 31 16:00:59 CEST 2011


commit 94c870bf1c6eeb78b1a25866dcb0ab541afc453e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Aug 15 07:29:37 2011 +0000

    We always allocate an object entirely inside one stevedore now.

diff --git a/bin/varnishd/stevedore.c b/bin/varnishd/stevedore.c
index 9a0b671..533874e 100644
--- a/bin/varnishd/stevedore.c
+++ b/bin/varnishd/stevedore.c
@@ -151,20 +151,15 @@ static struct storage *
 stv_alloc(const struct sess *sp, size_t size)
 {
 	struct storage *st;
-	struct stevedore *stv = NULL;
+	struct stevedore *stv;
 	unsigned fail = 0;
 
 	/*
-	 * Always try the stevedore which allocated the object in order to
-	 * not needlessly split an object across multiple stevedores.
+	 * Always use the stevedore which allocated the object in order to
+	 * keep an object inside the same stevedore.
 	 */
-	if (sp->obj != NULL) {
-		CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
-		stv = sp->obj->objstore->stevedore;
-	} else {
-		INCOMPL();
-		stv = stv_transient;
-	}
+	CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
+	stv = sp->obj->objstore->stevedore;
 	CHECK_OBJ_NOTNULL(stv, STEVEDORE_MAGIC);
 
 	if (size > (size_t)(params->fetch_maxchunksize) << 10)



More information about the varnish-commit mailing list