aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/geom_ctl.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2002-10-20 08:42:18 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2002-10-20 08:42:18 +0000
commit9b232f1493a596de6ff8bfec7a0d1da8f2d10298 (patch)
tree0b352804b1db0151e4d3ca35e99989392238bd32 /sys/geom/geom_ctl.c
parentf9d186edc88163ed0b54b8f5afca9e8a2b531f12 (diff)
downloadsrc-9b232f1493a596de6ff8bfec7a0d1da8f2d10298.tar.gz
src-9b232f1493a596de6ff8bfec7a0d1da8f2d10298.zip
Make it possible to specify also via geom_t ID in the geom.ctl config ioctl.
Sponsored by: DARPA & NAI Labs.
Notes
Notes: svn path=/head/; revision=105504
Diffstat (limited to 'sys/geom/geom_ctl.c')
-rw-r--r--sys/geom/geom_ctl.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/geom/geom_ctl.c b/sys/geom/geom_ctl.c
index 8e1ce84ec09c..3d242960a2e1 100644
--- a/sys/geom/geom_ctl.c
+++ b/sys/geom/geom_ctl.c
@@ -179,15 +179,15 @@ g_ctl_ioctl_configgeom(dev_t dev, u_long cmd, caddr_t data, int fflag, struct th
int error;
error = 0;
+ bzero(&ga, sizeof ga);
gcp = (struct geomconfiggeom *)data;
ga.class = g_idclass(&gcp->class);
if (ga.class == NULL)
return (EINVAL);
if (ga.class->create_geom == NULL)
return (EOPNOTSUPP);
+ ga.geom = g_idgeom(&gcp->geom);
ga.provider = g_idprovider(&gcp->provider);
- if (ga.provider == NULL)
- return (EINVAL);
ga.len = gcp->len;
if (gcp->len > 64 * 1024)
return (EINVAL);
@@ -197,8 +197,14 @@ g_ctl_ioctl_configgeom(dev_t dev, u_long cmd, caddr_t data, int fflag, struct th
ga.ptr = g_malloc(gcp->len, M_WAITOK);
copyin(gcp->ptr, ga.ptr, gcp->len);
}
+ ga.flag = gcp->flag;
error = ga.class->create_geom(&ga);
- gcp->geom = (uintptr_t)ga.geom;
+ gcp->class.u.id = (uintptr_t)ga.class;
+ gcp->class.len = 0;
+ gcp->geom.u.id = (uintptr_t)ga.geom;
+ gcp->geom.len = 0;
+ gcp->provider.u.id = (uintptr_t)ga.provider;
+ gcp->provider.len = 0;
return(error);
}