diff --git a/lib/libgeom/geom_ctl.c b/lib/libgeom/geom_ctl.c index c3d9ee561fdb..d308849e80a1 100644 --- a/lib/libgeom/geom_ctl.c +++ b/lib/libgeom/geom_ctl.c @@ -45,8 +45,6 @@ #define GCTL_TABLE 1 #include -#include - void gctl_dump(struct gctl_req *req, FILE *f) { @@ -58,14 +56,14 @@ gctl_dump(struct gctl_req *req, FILE *f) fprintf(f, "Dump of gctl request at NULL\n"); return; } - fprintf(f, "Dump of gctl %s request at %p:\n", req->reqt->name, req); + fprintf(f, "Dump of gctl request at %p:\n", req); if (req->error != NULL) fprintf(f, " error:\t\"%s\"\n", req->error); else fprintf(f, " error:\tNULL\n"); for (i = 0; i < req->narg; i++) { ap = &req->arg[i]; - fprintf(f, " param:\t\"%s\"", ap->name); + fprintf(f, " param:\t\"%s\" (%d)", ap->name, ap->nlen); fprintf(f, " [%s%s", ap->flag & GCTL_PARAM_RD ? "R" : "", ap->flag & GCTL_PARAM_WR ? "W" : ""); @@ -119,22 +117,11 @@ gctl_check_alloc(struct gctl_req *req, void *ptr) * XXX: Why bother checking the type ? */ struct gctl_req * -gctl_get_handle(enum gctl_request req) +gctl_get_handle(void) { - struct gctl_req_table *gtp; struct gctl_req *rp; rp = calloc(1, sizeof *rp); - if (rp == NULL) - return (NULL); - for (gtp = gcrt; gtp->request != req; gtp++) - if (gtp->request == GCTL_INVALID_REQUEST) - break; - - rp->request = req; - rp->reqt = gtp; - if (rp->reqt->request == GCTL_INVALID_REQUEST) - gctl_set_error(rp, "Invalid request"); return (rp); } diff --git a/lib/libgeom/libgeom.h b/lib/libgeom/libgeom.h index 83082e784a47..581d47714ec3 100644 --- a/lib/libgeom/libgeom.h +++ b/lib/libgeom/libgeom.h @@ -135,7 +135,7 @@ struct gctl_req; void gctl_dump(struct gctl_req *req, FILE *f); #endif void gctl_free(struct gctl_req *req); -struct gctl_req *gctl_get_handle(enum gctl_request req); +struct gctl_req *gctl_get_handle(void); const char *gctl_issue(struct gctl_req *req); void gctl_ro_param(struct gctl_req *req, const char *name, int len, const void* val); void gctl_rw_param(struct gctl_req *req, const char *name, int len, void* val);