Collapse meta arguments into regular arguments, the distinction is
more trouble than it is worth.
This commit is contained in:
parent
64a5766ef7
commit
70b4ddbb09
@ -151,13 +151,8 @@ gctl_copyin(struct gctl_req *req)
|
||||
!useracc(ap[i].value, ap[i].len,
|
||||
ap[i].flag & GCTL_PARAM_RW))
|
||||
error = gctl_error(req, "no access to param data");
|
||||
if (ap[i].name == NULL) {
|
||||
if (req->reqt->meta)
|
||||
continue;
|
||||
error = gctl_error(req,
|
||||
"request does not take metadata arguments");
|
||||
if (error)
|
||||
break;
|
||||
}
|
||||
p = NULL;
|
||||
if (ap[i].nlen < 1 || ap[i].nlen > SPECNAMELEN) {
|
||||
error = gctl_error(req, "wrong param name length");
|
||||
@ -205,10 +200,7 @@ gctl_dump(struct gctl_req *req)
|
||||
}
|
||||
for (i = 0; i < req->narg; i++) {
|
||||
ap = &req->arg[i];
|
||||
if (ap->name != NULL)
|
||||
printf(" param:\t\"%s\"", ap->name);
|
||||
else
|
||||
printf(" meta:\t@%jd", (intmax_t)ap->offset);
|
||||
printf(" param:\t\"%s\"", ap->name);
|
||||
printf(" [%s%s%d] = ",
|
||||
ap->flag & GCTL_PARAM_RD ? "R" : "",
|
||||
ap->flag & GCTL_PARAM_WR ? "W" : "",
|
||||
|
@ -50,8 +50,6 @@ enum gctl_request {
|
||||
GCTL_DESTROY_PROVIDER,
|
||||
GCTL_INSERT_GEOM,
|
||||
GCTL_ELIMINATE_GEOM,
|
||||
GCTL_WRITE_META,
|
||||
GCTL_READ_META
|
||||
};
|
||||
|
||||
#ifdef GCTL_TABLE
|
||||
@ -61,24 +59,21 @@ struct gctl_req_table {
|
||||
int provider;
|
||||
int consumer;
|
||||
int params;
|
||||
int meta;
|
||||
char *name;
|
||||
enum gctl_request request;
|
||||
} gcrt[] = {
|
||||
/* Cl Ge Pr Co Pa Me Name Request */
|
||||
{ 1, 0, 1, 0, 1, 0, "create geom", GCTL_CREATE_GEOM },
|
||||
{ 0, 1, 0, 0, 1, 0, "destroy geom", GCTL_DESTROY_GEOM },
|
||||
{ 0, 1, 1, 0, 1, 0, "attach", GCTL_ATTACH },
|
||||
{ 0, 1, 1, 0, 1, 0, "detach", GCTL_DETACH },
|
||||
{ 0, 1, 0, 0, 1, 0, "create provider", GCTL_CREATE_PROVIDER },
|
||||
{ 0, 1, 1, 0, 1, 0, "destroy provider", GCTL_DESTROY_PROVIDER },
|
||||
{ 1, 1, 1, 0, 1, 0, "insert geom", GCTL_INSERT_GEOM },
|
||||
{ 0, 1, 0, 0, 1, 0, "eliminate geom", GCTL_ELIMINATE_GEOM },
|
||||
{ 0, 1, 0, 0, 1, 1, "write meta", GCTL_WRITE_META },
|
||||
{ 0, 1, 0, 0, 1, 1, "read meta", GCTL_READ_META },
|
||||
/* 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 },
|
||||
|
||||
/* Terminator entry */
|
||||
{ 1, 1, 1, 1, 1, 1, "*INVALID*", GCTL_INVALID_REQUEST }
|
||||
{ 1, 1, 1, 1, 1, "*INVALID*", GCTL_INVALID_REQUEST }
|
||||
};
|
||||
|
||||
#endif /* GCTL_TABLE */
|
||||
|
Loading…
Reference in New Issue
Block a user