Whamcloud - gitweb
LU-56 libcfs: export a few symbols from libcfs
authorLiang Zhen <liang@whamcloud.com>
Sun, 27 May 2012 01:15:31 +0000 (09:15 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 30 May 2012 12:32:06 +0000 (08:32 -0400)
Export cfs_trace_copyin_string and cfs_strncasecmp from libcfs,
These symbols will be used by LNet patches soon.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I8722adec822f9d90322a59ff71afff87a9062efd
Reviewed-on: http://review.whamcloud.com/2920
Tested-by: Hudson
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/libcfs_debug.h
libcfs/include/libcfs/libcfs_string.h
libcfs/libcfs/libcfs_string.c
libcfs/libcfs/tracefile.c

index ebc8913..3167231 100644 (file)
@@ -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"
index 1f8771d..76b7bec 100644 (file)
@@ -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);
index cd7ef49..ba5e7e1 100644 (file)
@@ -43,7 +43,7 @@
 #include <libcfs/libcfs.h>
 
 /* 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),
index 0c974ed..115a70a 100644 (file)
@@ -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)