One day we should also constify getprio(), but that requires touching all prioritizers. Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> --- libmultipath/prio.c | 8 ++++---- libmultipath/prio.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libmultipath/prio.c b/libmultipath/prio.c index 7fce9215..17acfd05 100644 --- a/libmultipath/prio.c +++ b/libmultipath/prio.c @@ -81,7 +81,7 @@ static struct prio * prio_lookup (char * name) return NULL; } -int prio_set_args (struct prio * p, char * args) +int prio_set_args (struct prio * p, const char * args) { return snprintf(p->args, PRIO_ARGS_LEN, "%s", args); } @@ -130,19 +130,19 @@ int prio_getprio (struct prio * p, struct path * pp, unsigned int timeout) return p->getprio(pp, p->args, timeout); } -int prio_selected (struct prio * p) +int prio_selected (const struct prio * p) { if (!p) return 0; return (p->getprio) ? 1 : 0; } -char * prio_name (struct prio * p) +const char * prio_name (const struct prio * p) { return p->name; } -char * prio_args (struct prio * p) +const char * prio_args (const struct prio * p) { return p->args; } diff --git a/libmultipath/prio.h b/libmultipath/prio.h index c97fe397..aa587ccd 100644 --- a/libmultipath/prio.h +++ b/libmultipath/prio.h @@ -60,10 +60,10 @@ struct prio * add_prio (char *, char *); int prio_getprio (struct prio *, struct path *, unsigned int); void prio_get (char *, struct prio *, char *, char *); void prio_put (struct prio *); -int prio_selected (struct prio *); -char * prio_name (struct prio *); -char * prio_args (struct prio *); -int prio_set_args (struct prio *, char *); +int prio_selected (const struct prio *); +const char * prio_name (const struct prio *); +const char * prio_args (const struct prio *); +int prio_set_args (struct prio *, const char *); /* The only function exported by prioritizer dynamic libraries (.so) */ int getprio(struct path *, char *, unsigned int); -- 2.17.0 -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel