diff options
author | des <des@FreeBSD.org> | 2008-08-09 11:14:05 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2008-08-09 11:14:05 +0000 |
commit | c2c1c946ae25855c779b03f9b612cfa2750a94aa (patch) | |
tree | a49f25cd0b20b9dc2d2e2f419d89d33aad927f68 /sys/geom/part | |
parent | 50ef01bba12b948cfb2dc282f8c080a15957acc6 (diff) | |
download | FreeBSD-src-c2c1c946ae25855c779b03f9b612cfa2750a94aa.zip FreeBSD-src-c2c1c946ae25855c779b03f9b612cfa2750a94aa.tar.gz |
Add sbuf_new_auto as a shortcut for the very common case of creating a
completely dynamic sbuf.
Obtained from: Varnish
MFC after: 2 weeks
Diffstat (limited to 'sys/geom/part')
-rw-r--r-- | sys/geom/part/g_part.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index 4650b4a..e12c0fa 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -506,7 +506,7 @@ g_part_ctl_add(struct gctl_req *req, struct g_part_parms *gpp) /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s added\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf))); sbuf_finish(sb); @@ -545,7 +545,7 @@ g_part_ctl_bootcode(struct gctl_req *req, struct g_part_parms *gpp) /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s has bootcode\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); @@ -749,7 +749,7 @@ g_part_ctl_create(struct gctl_req *req, struct g_part_parms *gpp) /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s created\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); @@ -821,7 +821,7 @@ g_part_ctl_delete(struct gctl_req *req, struct g_part_parms *gpp) /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s deleted\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf))); sbuf_finish(sb); @@ -877,7 +877,7 @@ g_part_ctl_destroy(struct gctl_req *req, struct g_part_parms *gpp) /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s destroyed\n", gp->name); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); @@ -924,7 +924,7 @@ g_part_ctl_modify(struct gctl_req *req, struct g_part_parms *gpp) /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s modified\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf))); sbuf_finish(sb); @@ -991,7 +991,7 @@ g_part_ctl_setunset(struct gctl_req *req, struct g_part_parms *gpp, /* Provide feedback if so requested. */ if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { - sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + sb = sbuf_new_auto(); sbuf_printf(sb, "%s%s has %s %sset\n", gp->name, G_PART_NAME(table, entry, buf, sizeof(buf)), gpp->gpp_attrib, (set) ? "" : "un"); |