From 8264927b92b82e5ec6d223523db8680ee8df1da4 Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Fri, 20 Jun 2014 11:58:50 -0500 Subject: [PATCH] LU-5252 hsm: make path argument to fifo event a const MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Neither llapi_hsm_register_event_fifo() nor llapi_hsm_unregister_event_fifo() take a const as their argument. This leads to the following compilation warning when a caller is using a const char *: ... warning: passing argument 1 of ‘llapi_hsm_register_event_fifo’ discards ‘const’ qualifier from pointer target type [enabled by default] rc = llapi_hsm_register_event_fifo(lustre_fifo_event); ^ ... note: expected ‘char *’ but argument is of type ‘const char *’ extern int llapi_hsm_register_event_fifo(char *path); Making path a const fixes this warning. Change-Id: Ia2544cafefef8d5d1e4cf4cfc6408aac373c447b Signed-off-by: frank zago Reviewed-on: http://review.whamcloud.com/10807 Reviewed-by: John L. Hammond Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Nunez Reviewed-by: Oleg Drokin --- lustre/include/lustre/lustreapi.h | 4 ++-- lustre/utils/liblustreapi_hsm.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lustre/include/lustre/lustreapi.h b/lustre/include/lustre/lustreapi.h index 38244a2..6362797 100644 --- a/lustre/include/lustre/lustreapi.h +++ b/lustre/include/lustre/lustreapi.h @@ -282,8 +282,8 @@ extern int llapi_hsm_state_set_fd(int fd, __u64 setmask, __u64 clearmask, __u32 archive_id); extern int llapi_hsm_state_set(const char *path, __u64 setmask, __u64 clearmask, __u32 archive_id); -extern int llapi_hsm_register_event_fifo(char *path); -extern int llapi_hsm_unregister_event_fifo(char *path); +extern int llapi_hsm_register_event_fifo(const char *path); +extern int llapi_hsm_unregister_event_fifo(const char *path); extern void llapi_hsm_log_error(enum llapi_message_level level, int _rc, const char *fmt, va_list args); diff --git a/lustre/utils/liblustreapi_hsm.c b/lustre/utils/liblustreapi_hsm.c index e47a7d9..f1de299 100644 --- a/lustre/utils/liblustreapi_hsm.c +++ b/lustre/utils/liblustreapi_hsm.c @@ -459,7 +459,7 @@ out_free: * \retval 0 on success. * \retval -errno on error. */ -int llapi_hsm_register_event_fifo(char *path) +int llapi_hsm_register_event_fifo(const char *path) { int read_fd; struct stat statbuf; @@ -520,7 +520,7 @@ int llapi_hsm_register_event_fifo(char *path) * \retval 0 on success. * \retval -errno on error. */ -int llapi_hsm_unregister_event_fifo(char *path) +int llapi_hsm_unregister_event_fifo(const char *path) { /* Noop unless the event fd was initialized */ if (llapi_hsm_event_fd < 0) -- 1.8.3.1