don't call sbuf_clear() right after sbuf_new(), it is not necessary.
This commit is contained in:
parent
af9b407414
commit
99cf2f941c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125651
@ -772,7 +772,6 @@ g_ccd_create(struct gctl_req *req, struct g_class *mp)
|
||||
g_error_provider(pp, 0);
|
||||
|
||||
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
|
||||
sbuf_clear(sb);
|
||||
sbuf_printf(sb, "ccd%d: %d components ", sc->sc_unit, *nprovider);
|
||||
for (i = 0; i < *nprovider; i++) {
|
||||
sbuf_printf(sb, "%s%s",
|
||||
@ -823,7 +822,6 @@ g_ccd_list(struct gctl_req *req, struct g_class *mp)
|
||||
up = gctl_get_paraml(req, "unit", sizeof (int));
|
||||
unit = *up;
|
||||
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
|
||||
sbuf_clear(sb);
|
||||
LIST_FOREACH(gp, &mp->geom, geom) {
|
||||
cs = gp->softc;
|
||||
if (cs == NULL || (unit >= 0 && unit != cs->sc_unit))
|
||||
|
@ -423,7 +423,6 @@ sysctl_disks(SYSCTL_HANDLER_ARGS)
|
||||
struct sbuf *sb;
|
||||
|
||||
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
|
||||
sbuf_clear(sb);
|
||||
g_waitfor_event(g_kern_disks, sb, M_WAITOK, NULL);
|
||||
error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
|
||||
sbuf_delete(sb);
|
||||
|
@ -174,7 +174,6 @@ sysctl_kern_geom_conftxt(SYSCTL_HANDLER_ARGS)
|
||||
struct sbuf *sb;
|
||||
|
||||
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
|
||||
sbuf_clear(sb);
|
||||
g_waitfor_event(g_conftxt, sb, M_WAITOK, NULL);
|
||||
error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
|
||||
sbuf_delete(sb);
|
||||
@ -188,7 +187,6 @@ sysctl_kern_geom_confdot(SYSCTL_HANDLER_ARGS)
|
||||
struct sbuf *sb;
|
||||
|
||||
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
|
||||
sbuf_clear(sb);
|
||||
g_waitfor_event(g_confdot, sb, M_WAITOK, NULL);
|
||||
error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
|
||||
sbuf_delete(sb);
|
||||
@ -202,7 +200,6 @@ sysctl_kern_geom_confxml(SYSCTL_HANDLER_ARGS)
|
||||
struct sbuf *sb;
|
||||
|
||||
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
|
||||
sbuf_clear(sb);
|
||||
g_waitfor_event(g_confxml, sb, M_WAITOK, NULL);
|
||||
error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
|
||||
sbuf_delete(sb);
|
||||
|
Loading…
Reference in New Issue
Block a user