[master] d24c996 Start wrecking VSM/VSC apis: Remove unnecessary VSM_fantom in VSC_section{}

Poul-Henning Kamp phk at FreeBSD.org
Mon May 8 00:44:05 CEST 2017


commit d24c9962aba76a675b893740b9377fd9a6fbba74
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun May 7 22:25:08 2017 +0000

    Start wrecking VSM/VSC apis:  Remove unnecessary VSM_fantom in VSC_section{}

diff --git a/bin/varnishstat/varnishstat.c b/bin/varnishstat/varnishstat.c
index c1f152e..5065d84 100644
--- a/bin/varnishstat/varnishstat.c
+++ b/bin/varnishstat/varnishstat.c
@@ -68,10 +68,10 @@ do_xml_cb(void *priv, const struct VSC_point * const pt)
 	sec = pt->section;
 
 	printf("\t<stat>\n");
-	if (strcmp(sec->fantom->type, ""))
-		printf("\t\t<type>%s</type>\n", sec->fantom->type);
-	if (strcmp(sec->fantom->ident, ""))
-		printf("\t\t<ident>%s</ident>\n", sec->fantom->ident);
+	if (strcmp(sec->type, ""))
+		printf("\t\t<type>%s</type>\n", sec->type);
+	if (strcmp(sec->ident, ""))
+		printf("\t\t<ident>%s</ident>\n", sec->ident);
 	printf("\t\t<name>%s</name>\n", pt->desc->name);
 	printf("\t\t<value>%ju</value>\n", (uintmax_t)val);
 	printf("\t\t<flag>%c</flag>\n", pt->desc->semantics);
@@ -120,17 +120,17 @@ do_json_cb(void *priv, const struct VSC_point * const pt)
 
 	printf("  \"");
 	/* build the JSON key name.  */
-	if (sec->fantom->type[0])
-		printf("%s.", sec->fantom->type);
-	if (sec->fantom->ident[0])
-		printf("%s.", sec->fantom->ident);
+	if (sec->type[0])
+		printf("%s.", sec->type);
+	if (sec->ident[0])
+		printf("%s.", sec->ident);
 	printf("%s\": {\n", pt->desc->name);
 	printf("    \"description\": \"%s\",\n", pt->desc->sdesc);
 
-	if (strcmp(sec->fantom->type, ""))
-		printf("    \"type\": \"%s\", ", sec->fantom->type);
-	if (strcmp(sec->fantom->ident, ""))
-		printf("\"ident\": \"%s\", ", sec->fantom->ident);
+	if (strcmp(sec->type, ""))
+		printf("    \"type\": \"%s\", ", sec->type);
+	if (strcmp(sec->ident, ""))
+		printf("\"ident\": \"%s\", ", sec->ident);
 	printf("\"flag\": \"%c\", ", pt->desc->semantics);
 	printf("\"format\": \"%c\",\n", pt->desc->format);
 	printf("    \"value\": %ju", (uintmax_t)val);
@@ -182,10 +182,10 @@ do_once_cb(void *priv, const struct VSC_point * const pt)
 	val = *(const volatile uint64_t*)pt->ptr;
 	sec = pt->section;
 	i = 0;
-	if (strcmp(sec->fantom->type, ""))
-		i += printf("%s.", sec->fantom->type);
-	if (strcmp(sec->fantom->ident, ""))
-		i += printf("%s.", sec->fantom->ident);
+	if (strcmp(sec->type, ""))
+		i += printf("%s.", sec->type);
+	if (strcmp(sec->ident, ""))
+		i += printf("%s.", sec->ident);
 	i += printf("%s", pt->desc->name);
 	if (i >= op->pad)
 		op->pad = i + 1;
@@ -227,10 +227,10 @@ do_list_cb(void *priv, const struct VSC_point * const pt)
 
 	sec = pt->section;
 	i = 0;
-	if (strcmp(sec->fantom->type, ""))
-		i += printf("%s.", sec->fantom->type);
-	if (strcmp(sec->fantom->ident, ""))
-		i += printf("%s.", sec->fantom->ident);
+	if (strcmp(sec->type, ""))
+		i += printf("%s.", sec->type);
+	if (strcmp(sec->ident, ""))
+		i += printf("%s.", sec->ident);
 	i += printf("%s", pt->desc->name);
 	if (i < 30)
 		printf("%*s", i - 30, "");
diff --git a/include/vapi/vsc.h b/include/vapi/vsc.h
index bf1b1f5..ebd003e 100644
--- a/include/vapi/vsc.h
+++ b/include/vapi/vsc.h
@@ -117,7 +117,6 @@ struct VSC_section {
 	const char *type;
 	const char *ident;
 	const struct VSC_type_desc *desc;
-	struct VSM_fantom *fantom;
 };
 
 /* See include/tbl/vsc_fields.h for descriptions */
diff --git a/lib/libvarnishapi/vsc.c b/lib/libvarnishapi/vsc.c
index 3431dbf..9f0a4ff 100644
--- a/lib/libvarnishapi/vsc.c
+++ b/lib/libvarnishapi/vsc.c
@@ -256,7 +256,6 @@ vsc_add_vf(struct vsc *vsc, const struct VSM_fantom *fantom,
 	vf->section.type = vf->fantom.type;
 	vf->section.ident = vf->fantom.ident;
 	vf->section.desc = desc;
-	vf->section.fantom = &vf->fantom;
 	vf->order = order;
 
 	VTAILQ_FOREACH(vf2, &vsc->vf_list, list) {



More information about the varnish-commit mailing list