aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/part
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2019-06-19 15:36:02 +0000
committerAlexander Motin <mav@FreeBSD.org>2019-06-19 15:36:02 +0000
commit49ee0fcea52c43f055ce8d63bc6f72dbb91c509d (patch)
tree05117a7ce6644f560a9dfd9813e3b1f3580dd745 /sys/geom/part
parent5e02b277a4fac9fa5046d81e7cb9a5df54e25895 (diff)
downloadsrc-49ee0fcea52c43f055ce8d63bc6f72dbb91c509d.tar.gz
src-49ee0fcea52c43f055ce8d63bc6f72dbb91c509d.zip
Use sbuf_cat() in GEOM confxml generation.
When it comes to megabytes of text, difference between sbuf_printf() and sbuf_cat() becomes substantial. MFC after: 2 weeks Sponsored by: iXsystems, Inc.
Notes
Notes: svn path=/head/; revision=349195
Diffstat (limited to 'sys/geom/part')
-rw-r--r--sys/geom/part/g_part_apm.c8
-rw-r--r--sys/geom/part/g_part_bsd64.c10
-rw-r--r--sys/geom/part/g_part_gpt.c10
-rw-r--r--sys/geom/part/g_part_mbr.c2
4 files changed, 15 insertions, 15 deletions
diff --git a/sys/geom/part/g_part_apm.c b/sys/geom/part/g_part_apm.c
index 250983ef7fe3..92019c7e4f16 100644
--- a/sys/geom/part/g_part_apm.c
+++ b/sys/geom/part/g_part_apm.c
@@ -310,13 +310,13 @@ g_part_apm_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry,
strncpy(u.name, entry->ent.ent_name, APM_ENT_NAMELEN);
u.name[APM_ENT_NAMELEN] = '\0';
sbuf_printf(sb, "%s<label>", indent);
- g_conf_printf_escaped(sb, "%s", u.name);
- sbuf_printf(sb, "</label>\n");
+ g_conf_cat_escaped(sb, u.name);
+ sbuf_cat(sb, "</label>\n");
strncpy(u.type, entry->ent.ent_type, APM_ENT_TYPELEN);
u.type[APM_ENT_TYPELEN] = '\0';
sbuf_printf(sb, "%s<rawtype>", indent);
- g_conf_printf_escaped(sb, "%s", u.type);
- sbuf_printf(sb, "</rawtype>\n");
+ g_conf_cat_escaped(sb, u.type);
+ sbuf_cat(sb, "</rawtype>\n");
} else {
/* confxml: scheme information */
}
diff --git a/sys/geom/part/g_part_bsd64.c b/sys/geom/part/g_part_bsd64.c
index 6332a38096fd..4f73957ba1b3 100644
--- a/sys/geom/part/g_part_bsd64.c
+++ b/sys/geom/part/g_part_bsd64.c
@@ -386,11 +386,11 @@ g_part_bsd64_dumpconf(struct g_part_table *basetable,
if (!EQUUID(&bsd64_uuid_unused, &entry->type_uuid)) {
sbuf_printf(sb, "%s<type_uuid>", indent);
sbuf_printf_uuid(sb, &entry->type_uuid);
- sbuf_printf(sb, "</type_uuid>\n");
+ sbuf_cat(sb, "</type_uuid>\n");
}
sbuf_printf(sb, "%s<stor_uuid>", indent);
sbuf_printf_uuid(sb, &entry->stor_uuid);
- sbuf_printf(sb, "</stor_uuid>\n");
+ sbuf_cat(sb, "</stor_uuid>\n");
} else {
/* confxml: scheme information */
table = (struct g_part_bsd64_table *)basetable;
@@ -401,12 +401,12 @@ g_part_bsd64_dumpconf(struct g_part_table *basetable,
indent, (uintmax_t)table->d_abase);
sbuf_printf(sb, "%s<stor_uuid>", indent);
sbuf_printf_uuid(sb, &table->d_stor_uuid);
- sbuf_printf(sb, "</stor_uuid>\n");
+ sbuf_cat(sb, "</stor_uuid>\n");
sbuf_printf(sb, "%s<label>", indent);
strncpy(buf, table->d_packname, sizeof(buf) - 1);
buf[sizeof(buf) - 1] = '\0';
- g_conf_printf_escaped(sb, "%s", buf);
- sbuf_printf(sb, "</label>\n");
+ g_conf_cat_escaped(sb, buf);
+ sbuf_cat(sb, "</label>\n");
}
}
diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c
index dca10c9534cb..f69cd84efab4 100644
--- a/sys/geom/part/g_part_gpt.c
+++ b/sys/geom/part/g_part_gpt.c
@@ -713,14 +713,14 @@ g_part_gpt_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry,
entry = (struct g_part_gpt_entry *)baseentry;
if (indent == NULL) {
/* conftxt: libdisk compatibility */
- sbuf_printf(sb, " xs GPT xt ");
+ sbuf_cat(sb, " xs GPT xt ");
sbuf_printf_uuid(sb, &entry->ent.ent_type);
} else if (entry != NULL) {
/* confxml: partition entry information */
sbuf_printf(sb, "%s<label>", indent);
g_gpt_printf_utf16(sb, entry->ent.ent_name,
sizeof(entry->ent.ent_name) >> 1);
- sbuf_printf(sb, "</label>\n");
+ sbuf_cat(sb, "</label>\n");
if (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTME)
sbuf_printf(sb, "%s<attrib>bootme</attrib>\n", indent);
if (entry->ent.ent_attr & GPT_ENT_ATTR_BOOTONCE) {
@@ -733,16 +733,16 @@ g_part_gpt_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry,
}
sbuf_printf(sb, "%s<rawtype>", indent);
sbuf_printf_uuid(sb, &entry->ent.ent_type);
- sbuf_printf(sb, "</rawtype>\n");
+ sbuf_cat(sb, "</rawtype>\n");
sbuf_printf(sb, "%s<rawuuid>", indent);
sbuf_printf_uuid(sb, &entry->ent.ent_uuid);
- sbuf_printf(sb, "</rawuuid>\n");
+ sbuf_cat(sb, "</rawuuid>\n");
sbuf_printf(sb, "%s<efimedia>", indent);
sbuf_printf(sb, "HD(%d,GPT,", entry->base.gpe_index);
sbuf_printf_uuid(sb, &entry->ent.ent_uuid);
sbuf_printf(sb, ",%#jx,%#jx)", (intmax_t)entry->base.gpe_start,
(intmax_t)(entry->base.gpe_end - entry->base.gpe_start + 1));
- sbuf_printf(sb, "</efimedia>\n");
+ sbuf_cat(sb, "</efimedia>\n");
} else {
/* confxml: scheme information */
}
diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c
index a442e25c94d0..013b2a934ccc 100644
--- a/sys/geom/part/g_part_mbr.c
+++ b/sys/geom/part/g_part_mbr.c
@@ -330,7 +330,7 @@ g_part_mbr_dumpconf(struct g_part_table *basetable, struct g_part_entry *baseent
sbuf_printf(sb, "%s<efimedia>HD(%d,MBR,%#08x,%#jx,%#jx)", indent,
entry->base.gpe_index, dsn, (intmax_t)entry->base.gpe_start,
(intmax_t)(entry->base.gpe_end - entry->base.gpe_start + 1));
- sbuf_printf(sb, "</efimedia>\n");
+ sbuf_cat(sb, "</efimedia>\n");
} else {
/* confxml: scheme information */
}