aboutsummaryrefslogtreecommitdiff
path: root/lib/libgeom
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2022-03-07 16:06:11 +0000
committerAlexander Motin <mav@FreeBSD.org>2022-03-07 16:12:25 +0000
commit2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc (patch)
tree12d5cf32f6cdd900fffc89b1b80fe1e7e8682767 /lib/libgeom
parent01b9c48b5dec8d4a1161e0592f04b3301c81a1f8 (diff)
downloadsrc-2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc.tar.gz
src-2117cdd4b4ebda7db0270c56f5a3cbdd37ec8cfc.zip
GEOM: Introduce gctl_add_param() API.
Make gctl_add_param() API public, allowing more precise control over parameter flags. Previously it was impossible to properly declare write-only ASCII parameters, used for result reporting, they were declared as read-write binary instead, that was not nice. MFC after: 1 month
Diffstat (limited to 'lib/libgeom')
-rw-r--r--lib/libgeom/geom_ctl.c8
-rw-r--r--lib/libgeom/libgeom.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/libgeom/geom_ctl.c b/lib/libgeom/geom_ctl.c
index 1d5c52fc3779..b60c4c297257 100644
--- a/lib/libgeom/geom_ctl.c
+++ b/lib/libgeom/geom_ctl.c
@@ -151,8 +151,8 @@ gctl_new_arg(struct gctl_req *req)
return (ap);
}
-static void
-gctl_param_add(struct gctl_req *req, const char *name, int len, void *value,
+void
+gctl_add_param(struct gctl_req *req, const char *name, int len, void *value,
int flag)
{
struct gctl_req_arg *ap;
@@ -181,14 +181,14 @@ void
gctl_ro_param(struct gctl_req *req, const char *name, int len, const void* value)
{
- gctl_param_add(req, name, len, __DECONST(void *, value), GCTL_PARAM_RD);
+ gctl_add_param(req, name, len, __DECONST(void *, value), GCTL_PARAM_RD);
}
void
gctl_rw_param(struct gctl_req *req, const char *name, int len, void *value)
{
- gctl_param_add(req, name, len, value, GCTL_PARAM_RW);
+ gctl_add_param(req, name, len, value, GCTL_PARAM_RW);
}
const char *
diff --git a/lib/libgeom/libgeom.h b/lib/libgeom/libgeom.h
index fc593b234302..9be27208a98c 100644
--- a/lib/libgeom/libgeom.h
+++ b/lib/libgeom/libgeom.h
@@ -149,6 +149,8 @@ void gctl_dump(struct gctl_req *, FILE *);
void gctl_free(struct gctl_req *);
struct gctl_req *gctl_get_handle(void);
const char *gctl_issue(struct gctl_req *);
+void gctl_add_param(struct gctl_req *req, const char *name, int len,
+ void *value, int flag);
void gctl_ro_param(struct gctl_req *, const char *, int, const void *);
void gctl_rw_param(struct gctl_req *, const char *, int, void *);