diff options
author | marcel <marcel@FreeBSD.org> | 2009-02-01 01:50:09 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2009-02-01 01:50:09 +0000 |
commit | 41ccd088c601ccdc3af29608e22e81b78a708b95 (patch) | |
tree | 1f2a01ba12a863c7bbda0c9ec3787b0e50ffd8bf /sys/geom | |
parent | c3045042619629c24f9994b20fb8aa21d4ddf677 (diff) | |
download | FreeBSD-src-41ccd088c601ccdc3af29608e22e81b78a708b95.zip FreeBSD-src-41ccd088c601ccdc3af29608e22e81b78a708b95.tar.gz |
Constify val in g_handleattr() and str in g_handleattr_str().
This allows passing string constants to g_handleattr_str().
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom.h | 5 | ||||
-rw-r--r-- | sys/geom/geom_subr.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/geom/geom.h b/sys/geom/geom.h index 8bf9439..a916ec5 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -227,10 +227,11 @@ void g_error_provider(struct g_provider *pp, int error); struct g_provider *g_provider_by_name(char const *arg); int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len); #define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof *(v)) -int g_handleattr(struct bio *bp, const char *attribute, void *val, int len); +int g_handleattr(struct bio *bp, const char *attribute, const void *val, + int len); int g_handleattr_int(struct bio *bp, const char *attribute, int val); int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val); -int g_handleattr_str(struct bio *bp, const char *attribute, char *str); +int g_handleattr_str(struct bio *bp, const char *attribute, const char *str); struct g_consumer * g_new_consumer(struct g_geom *gp); struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...); struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...); diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 21509aa6a..b9c9d24 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -858,14 +858,14 @@ g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val) } int -g_handleattr_str(struct bio *bp, const char *attribute, char *str) +g_handleattr_str(struct bio *bp, const char *attribute, const char *str) { return (g_handleattr(bp, attribute, str, 0)); } int -g_handleattr(struct bio *bp, const char *attribute, void *val, int len) +g_handleattr(struct bio *bp, const char *attribute, const void *val, int len) { int error = 0; |