summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_ctl.h
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 /sys/geom/geom_ctl.h
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 'sys/geom/geom_ctl.h')
-rw-r--r--sys/geom/geom_ctl.h74
1 files changed, 34 insertions, 40 deletions
diff --git a/sys/geom/geom_ctl.h b/sys/geom/geom_ctl.h
index 3f7b3d5..fd68bda 100644
--- a/sys/geom/geom_ctl.h
+++ b/sys/geom/geom_ctl.h
@@ -32,57 +32,51 @@
#ifndef _GEOM_GEOM_CTL_H_
#define _GEOM_GEOM_CTL_H_
-/*
- * Version number. Used to check consistency between kernel and libgeom.
- */
-#define GCTL_VERSION 1
+#include <sys/ioccom.h>
/*
- * Primitives.
+ * Version number. Used to check consistency between kernel and libgeom.
*/
-enum gctl_request {
- GCTL_INVALID_REQUEST = 0,
+#define GCTL_VERSION 2
- GCTL_CREATE_GEOM,
- GCTL_DESTROY_GEOM,
+struct gctl_req_arg {
+ u_int nlen;
+ char *name;
+ off_t offset;
+ int flag;
+ int len;
+ void *value;
+ /* kernel only fields */
+ void *kvalue;
+};
- GCTL_ATTACH,
- GCTL_DETACH,
+#define GCTL_PARAM_RD 1 /* Must match VM_PROT_READ */
+#define GCTL_PARAM_WR 2 /* Must match VM_PROT_WRITE */
+#define GCTL_PARAM_RW (GCTL_PARAM_RD | GCTL_PARAM_WR)
+#define GCTL_PARAM_ASCII 4
- GCTL_CREATE_PROVIDER,
- GCTL_DESTROY_PROVIDER,
+/* These are used in the kernel only */
+#define GCTL_PARAM_NAMEKERNEL 8
+#define GCTL_PARAM_VALUEKERNEL 16
+#define GCTL_PARAM_CHANGED 32
- GCTL_INSERT_GEOM,
- GCTL_ELIMINATE_GEOM,
+struct gctl_req {
+ u_int version;
+ u_int serial;
+ u_int narg;
+ struct gctl_req_arg *arg;
+ u_int lerror;
+ char *error;
+ struct gctl_req_table *reqt;
- GCTL_CONFIG_GEOM,
+ /* kernel only fields */
+ int nerror;
+ struct sbuf *serror;
};
-#ifdef GCTL_TABLE
-struct gctl_req_table {
- int class;
- int geom;
- int provider;
- int consumer;
- int params;
- char *name;
- enum gctl_request request;
-} gcrt[] = {
-/* Cl Ge Pr Co Pa Name Request */
- { 1, 0, 1, 0, 1, "create geom", GCTL_CREATE_GEOM },
- { 0, 1, 0, 0, 1, "destroy geom", GCTL_DESTROY_GEOM },
- { 0, 1, 1, 0, 1, "attach", GCTL_ATTACH },
- { 0, 1, 1, 0, 1, "detach", GCTL_DETACH },
- { 0, 1, 0, 0, 1, "create provider", GCTL_CREATE_PROVIDER },
- { 0, 1, 1, 0, 1, "destroy provider", GCTL_DESTROY_PROVIDER },
- { 1, 1, 1, 0, 1, "insert geom", GCTL_INSERT_GEOM },
- { 0, 1, 0, 0, 1, "eliminate geom", GCTL_ELIMINATE_GEOM },
- { 0, 1, 0, 0, 1, "config geom", GCTL_CONFIG_GEOM },
+#define GEOM_CTL _IOW('G', GCTL_VERSION, struct gctl_req)
- /* Terminator entry */
- { 1, 1, 1, 1, 1, "*INVALID*", GCTL_INVALID_REQUEST }
-};
+#define PATH_GEOM_CTL "geom.ctl"
-#endif /* GCTL_TABLE */
#endif /* _GEOM_GEOM_CTL_H_ */
OpenPOWER on IntegriCloud