From b76f327de7836a854f204d28e61de52bc03011b1 Mon Sep 17 00:00:00 2001 From: Liang Zhen Date: Sun, 27 May 2012 09:15:31 +0800 Subject: [PATCH] LU-56 libcfs: export a few symbols from libcfs Export cfs_trace_copyin_string and cfs_strncasecmp from libcfs, These symbols will be used by LNet patches soon. Signed-off-by: Liang Zhen Change-Id: I8722adec822f9d90322a59ff71afff87a9062efd Reviewed-on: http://review.whamcloud.com/2920 Tested-by: Hudson Reviewed-by: Bobi Jam Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- libcfs/include/libcfs/libcfs_debug.h | 7 ++++--- libcfs/include/libcfs/libcfs_string.h | 2 ++ libcfs/libcfs/libcfs_string.c | 3 ++- libcfs/libcfs/tracefile.c | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libcfs/include/libcfs/libcfs_debug.h b/libcfs/include/libcfs/libcfs_debug.h index ebc8913..3167231 100644 --- a/libcfs/include/libcfs/libcfs_debug.h +++ b/libcfs/include/libcfs/libcfs_debug.h @@ -341,10 +341,11 @@ extern int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata, va_list args, const char *format2, ...) __attribute__ ((format (printf, 4, 5))); -/* one more external symbol that tracefile provides: */ +/* other external symbols that tracefile provides: */ +extern int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob, + const char *usr_buffer, int usr_buffer_nob); extern int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob, - const char *knl_buffer, char *append); - + const char *knl_buffer, char *append); #if defined(HAVE_BGL_SUPPORT) #define LIBCFS_DEBUG_FILE_PATH_DEFAULT "/bgl/ion/tmp/lustre-log" diff --git a/libcfs/include/libcfs/libcfs_string.h b/libcfs/include/libcfs/libcfs_string.h index 1f8771d..76b7bec 100644 --- a/libcfs/include/libcfs/libcfs_string.h +++ b/libcfs/include/libcfs/libcfs_string.h @@ -44,6 +44,8 @@ #define __LIBCFS_STRING_H__ /* libcfs_string.c */ +/* string comparison ignoring case */ +int cfs_strncasecmp(const char *s1, const char *s2, size_t n); /* Convert a text string to a bitmask */ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit), int *oldmask, int minmask, int allmask); diff --git a/libcfs/libcfs/libcfs_string.c b/libcfs/libcfs/libcfs_string.c index cd7ef49..ba5e7e1 100644 --- a/libcfs/libcfs/libcfs_string.c +++ b/libcfs/libcfs/libcfs_string.c @@ -43,7 +43,7 @@ #include /* non-0 = don't match */ -static int cfs_strncasecmp(const char *s1, const char *s2, size_t n) +int cfs_strncasecmp(const char *s1, const char *s2, size_t n) { if (s1 == NULL || s2 == NULL) return 1; @@ -60,6 +60,7 @@ static int cfs_strncasecmp(const char *s1, const char *s2, size_t n) return tolower(*(unsigned char *)s1) - tolower(*(unsigned char *)s2); } +EXPORT_SYMBOL(cfs_strncasecmp); /* Convert a text string to a bitmask */ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit), diff --git a/libcfs/libcfs/tracefile.c b/libcfs/libcfs/tracefile.c index 0c974ed..115a70a 100644 --- a/libcfs/libcfs/tracefile.c +++ b/libcfs/libcfs/tracefile.c @@ -793,6 +793,7 @@ int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob, knl_buffer[nob + 1] = 0; /* terminate */ return 0; } +EXPORT_SYMBOL(cfs_trace_copyin_string); int cfs_trace_copyout_string(char *usr_buffer, int usr_buffer_nob, const char *knl_buffer, char *append) -- 1.8.3.1