From 069191fcbf030ae2966ebec47a4080756e9cd7f2 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 1 Jun 2003 13:47:51 +0000 Subject: Simplify the GEOM OAM api: Drop the request type, and let everything hinge on the "verb" parameter which the class gets to interpret as it sees fit. Move the entire request into the kernel and move changed parameters back when done. --- sbin/sunlabel/sunlabel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sbin/sunlabel') diff --git a/sbin/sunlabel/sunlabel.c b/sbin/sunlabel/sunlabel.c index 08e6745..1de2562 100644 --- a/sbin/sunlabel/sunlabel.c +++ b/sbin/sunlabel/sunlabel.c @@ -352,20 +352,20 @@ write_label(struct sun_disklabel *sl, const char *disk, const char *bootpath) snprintf(path, sizeof(path), "%s%s", _PATH_DEV, disk); fd = open(path, O_RDWR); if (fd < 0) { - grq = gctl_get_handle(GCTL_CONFIG_GEOM); + grq = gctl_get_handle(); + gctl_ro_param(grq, "verb", -1, "write label"); gctl_ro_param(grq, "class", -1, "SUN"); gctl_ro_param(grq, "geom", -1, disk); - gctl_ro_param(grq, "verb", -1, "write label"); gctl_ro_param(grq, "label", sizeof buf, buf); errstr = gctl_issue(grq); if (errstr != NULL) errx(1, "%s", errstr); gctl_free(grq); if (Bflag) { - grq = gctl_get_handle(GCTL_CONFIG_GEOM); + grq = gctl_get_handle(); + gctl_ro_param(grq, "verb", -1, "write bootcode"); gctl_ro_param(grq, "class", -1, "SUN"); gctl_ro_param(grq, "geom", -1, disk); - gctl_ro_param(grq, "verb", -1, "write bootcode"); gctl_ro_param(grq, "bootcode", sizeof boot, boot); errstr = gctl_issue(grq); if (errstr != NULL) -- cgit v1.1