summaryrefslogtreecommitdiffstats
path: root/sbin/bsdlabel
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-06-01 13:47:51 +0000
committerphk <phk@FreeBSD.org>2003-06-01 13:47:51 +0000
commit069191fcbf030ae2966ebec47a4080756e9cd7f2 (patch)
treeb5cc7f300d62bf1910b246c6ef717532135ce150 /sbin/bsdlabel
parent5a2388f470b87f347bd60da1d099299e1a3ed609 (diff)
downloadFreeBSD-src-069191fcbf030ae2966ebec47a4080756e9cd7f2.zip
FreeBSD-src-069191fcbf030ae2966ebec47a4080756e9cd7f2.tar.gz
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.
Diffstat (limited to 'sbin/bsdlabel')
-rw-r--r--sbin/bsdlabel/bsdlabel.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index a0e3cdb..31e57b7 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -359,10 +359,10 @@ writelabel(void)
fd = open(specname, 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, "BSD");
gctl_ro_param(grq, "geom", -1, dkname);
- gctl_ro_param(grq, "verb", -1, "write label");
gctl_ro_param(grq, "label", 148+16*8, bootarea + labeloffset);
errstr = gctl_issue(grq);
if (errstr != NULL) {
@@ -372,10 +372,10 @@ writelabel(void)
}
gctl_free(grq);
if (installboot) {
- 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, "BSD");
gctl_ro_param(grq, "geom", -1, dkname);
- gctl_ro_param(grq, "verb", -1, "write bootcode");
gctl_ro_param(grq, "bootcode", BBSIZE, bootarea);
errstr = gctl_issue(grq);
if (errstr != NULL) {
@@ -419,10 +419,10 @@ readlabel(int flag)
if (flag && error)
errx(1, "%s: no valid label found", specname);
- grq = gctl_get_handle(GCTL_CONFIG_GEOM);
+ grq = gctl_get_handle();
+ gctl_ro_param(grq, "verb", -1, "read mbroffset");
gctl_ro_param(grq, "class", -1, "BSD");
gctl_ro_param(grq, "geom", -1, dkname);
- gctl_ro_param(grq, "verb", -1, "read mbroffset");
gctl_rw_param(grq, "mbroffset", sizeof(mbroffset), &mbroffset);
errstr = gctl_issue(grq);
if (errstr != NULL) {
OpenPOWER on IntegriCloud