[master] 658932a Rename the stevedore_simple methods to make it clear that they are.

Poul-Henning Kamp phk at FreeBSD.org
Fri Feb 5 23:24:41 CET 2016


commit 658932ab564d2e24bbb25bb6bd043c03d90f2f27
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Feb 5 21:38:58 2016 +0000

    Rename the stevedore_simple methods to make it clear that they are.

diff --git a/bin/varnishd/storage/mgt_stevedore.c b/bin/varnishd/storage/mgt_stevedore.c
index 9852ea6..0f4e2ec 100644
--- a/bin/varnishd/storage/mgt_stevedore.c
+++ b/bin/varnishd/storage/mgt_stevedore.c
@@ -182,7 +182,6 @@ STV_Config(const char *spec)
 	else if (ac != 0)
 		ARGV_ERR("(-s%s) too many arguments\n", stv->name);
 
-	AN(stv->alloc);
 	AN(stv->allocobj);
 	AN(stv->methods);
 
diff --git a/bin/varnishd/storage/storage.h b/bin/varnishd/storage/storage.h
index c3d697d..fee1206 100644
--- a/bin/varnishd/storage/storage.h
+++ b/bin/varnishd/storage/storage.h
@@ -84,8 +84,8 @@ struct stevedore {
 	unsigned		transient;
 	storage_init_f		*init;		/* called by mgt process */
 	storage_open_f		*open;		/* called by cache process */
-	storage_alloc_f		*alloc;		/* --//-- only if SML */
-	storage_free_f		*free;		/* --//-- only if SML */
+	storage_alloc_f		*sml_alloc;	/* --//-- only if SML */
+	storage_free_f		*sml_free;	/* --//-- only if SML */
 	storage_close_f		*close;		/* --//-- */
 	storage_allocobj_f	*allocobj;	/* --//-- */
 	storage_signal_close_f	*signal_close;	/* --//-- */
diff --git a/bin/varnishd/storage/storage_file.c b/bin/varnishd/storage/storage_file.c
index 5985f91..bcd5afa 100644
--- a/bin/varnishd/storage/storage_file.c
+++ b/bin/varnishd/storage/storage_file.c
@@ -475,8 +475,8 @@ const struct stevedore smf_stevedore = {
 	.name		=	"file",
 	.init		=	smf_init,
 	.open		=	smf_open,
-	.alloc		=	smf_alloc,
-	.free		=	smf_free,
+	.sml_alloc	=	smf_alloc,
+	.sml_free	=	smf_free,
 	.allocobj	=	SML_allocobj,
 	.methods	=	&SML_methods,
 };
diff --git a/bin/varnishd/storage/storage_malloc.c b/bin/varnishd/storage/storage_malloc.c
index 2aacd41..19a8ac4 100644
--- a/bin/varnishd/storage/storage_malloc.c
+++ b/bin/varnishd/storage/storage_malloc.c
@@ -220,8 +220,8 @@ const struct stevedore sma_stevedore = {
 	.name		=	"malloc",
 	.init		=	sma_init,
 	.open		=	sma_open,
-	.alloc		=	sma_alloc,
-	.free		=	sma_free,
+	.sml_alloc	=	sma_alloc,
+	.sml_free	=	sma_free,
 	.allocobj	=	SML_allocobj,
 	.methods	=	&SML_methods,
 	.var_free_space =	sma_free_space,
diff --git a/bin/varnishd/storage/storage_persistent.c b/bin/varnishd/storage/storage_persistent.c
index f405755..fed7243 100644
--- a/bin/varnishd/storage/storage_persistent.c
+++ b/bin/varnishd/storage/storage_persistent.c
@@ -537,7 +537,7 @@ smp_allocobj(struct worker *wrk, const struct stevedore *stv,
 		}
 		st = smp_allocx(stv, ltot, ltot, &so, &objidx, &sg);
 		if (st != NULL && st->space < ltot) {
-			stv->free(st);		// NOP
+			stv->sml_free(st);		// NOP
 			st = NULL;
 		}
 		if (st != NULL)
@@ -588,18 +588,18 @@ smp_alloc(const struct stevedore *st, size_t size)
 /*--------------------------------------------------------------------*/
 
 const struct stevedore smp_stevedore = {
-	.magic	=	STEVEDORE_MAGIC,
-	.name	=	"deprecated_persistent",
-	.init	=	smp_mgt_init,
-	.open	=	smp_open,
-	.close	=	smp_close,
-	.alloc	=	smp_alloc,
-	.allocobj =	smp_allocobj,
-	.free	=	NULL,
-	.signal_close = smp_signal_close,
-	.baninfo =	smp_baninfo,
-	.banexport =	smp_banexport,
-	.methods =	&smp_oc_realmethods,
+	.magic		= STEVEDORE_MAGIC,
+	.name		= "deprecated_persistent",
+	.init		= smp_mgt_init,
+	.open		= smp_open,
+	.close		= smp_close,
+	.sml_alloc	= smp_alloc,
+	.allocobj	= smp_allocobj,
+	.sml_free	= NULL,
+	.signal_close	= smp_signal_close,
+	.baninfo	= smp_baninfo,
+	.banexport	= smp_banexport,
+	.methods	= &smp_oc_realmethods,
 };
 
 /*--------------------------------------------------------------------
diff --git a/bin/varnishd/storage/storage_simple.c b/bin/varnishd/storage/storage_simple.c
index 3fdd242..b588798 100644
--- a/bin/varnishd/storage/storage_simple.c
+++ b/bin/varnishd/storage/storage_simple.c
@@ -55,8 +55,8 @@ sml_stv_alloc(const struct stevedore *stv, size_t size)
 
 	for (;;) {
 		/* try to allocate from it */
-		AN(stv->alloc);
-		st = stv->alloc(stv, size);
+		AN(stv->sml_alloc);
+		st = stv->sml_alloc(stv, size);
 		if (st != NULL)
 			break;
 
@@ -75,8 +75,8 @@ sml_stv_free(const struct stevedore *stv, struct storage *st)
 
 	CHECK_OBJ_NOTNULL(stv, STEVEDORE_MAGIC);
 	CHECK_OBJ_NOTNULL(st, STORAGE_MAGIC);
-	if (stv->free != NULL)
-		stv->free(st);
+	if (stv->sml_free != NULL)
+		stv->sml_free(st);
 }
 
 /*--------------------------------------------------------------------
@@ -132,9 +132,9 @@ SML_allocobj(struct worker *wrk, const struct stevedore *stv,
 				return (0);
 			really--;
 		}
-		st = stv->alloc(stv, ltot);
+		st = stv->sml_alloc(stv, ltot);
 		if (st != NULL && st->space < ltot) {
-			stv->free(st);
+			stv->sml_free(st);
 			st = NULL;
 		}
 		if (st != NULL)
@@ -323,7 +323,7 @@ objallocwithnuke(struct worker *wrk, const struct stevedore *stv, size_t size)
 
 	for (fail = 0; fail <= cache_param->nuke_limit; fail++) {
 		/* try to allocate from it */
-		AN(stv->alloc);
+		AN(stv->sml_alloc);
 		st = sml_stv_alloc(stv, size);
 		if (st != NULL)
 			break;
@@ -407,7 +407,7 @@ sml_trimstore(struct worker *wrk, struct objcore *oc)
 	stv = oc->stobj->stevedore;
 	CHECK_OBJ_NOTNULL(stv, STEVEDORE_MAGIC);
 
-	if (stv->free == NULL)
+	if (stv->sml_free == NULL)
 		return;
 
 	o = sml_getobj(wrk, oc);



More information about the varnish-commit mailing list