From: James Simmons Date: Mon, 15 Dec 2014 19:15:43 +0000 (-0500) Subject: LU-3963 libcfs: Use kernel's strncasecmp and remove cfs_get_blocked_sigs X-Git-Tag: 2.6.92~39 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=d97075bb9644dba102491280690e58ad8caf1acf LU-3963 libcfs: Use kernel's strncasecmp and remove cfs_get_blocked_sigs Remove libcfs function cfs_strncasecmp() since the kernel already has its own strncasecmp(). Lastly remove from libcfs.h cfs_get_blocked_sigs() since this function no longer exist. Change-Id: Ief5bac8ac23114c8e34d988906b06dda8eb77306 Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/13070 Reviewed-by: John L. Hammond Reviewed-by: Bob Glossman Tested-by: Jenkins Reviewed-by: Patrick Farrell Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- diff --git a/libcfs/include/libcfs/libcfs.h b/libcfs/include/libcfs/libcfs.h index 33dc487..2f9f633 100644 --- a/libcfs/include/libcfs/libcfs.h +++ b/libcfs/include/libcfs/libcfs.h @@ -226,7 +226,6 @@ void cfs_enter_debugger(void); * Defined by platform */ int unshare_fs_struct(void); -sigset_t cfs_get_blocked_sigs(void); sigset_t cfs_block_allsigs(void); sigset_t cfs_block_sigs(unsigned long sigs); sigset_t cfs_block_sigsinv(unsigned long sigs); diff --git a/libcfs/include/libcfs/libcfs_string.h b/libcfs/include/libcfs/libcfs_string.h index 5afaec7..2afe1f5 100644 --- a/libcfs/include/libcfs/libcfs_string.h +++ b/libcfs/include/libcfs/libcfs_string.h @@ -45,8 +45,6 @@ /* libcfs_string.c */ char *cfs_strrstr(const char *haystack, const char *needle); -/* 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 4ef54fa..bb956a2 100644 --- a/libcfs/libcfs/libcfs_string.c +++ b/libcfs/libcfs/libcfs_string.c @@ -69,26 +69,6 @@ char *cfs_strrstr(const char *haystack, const char *needle) } EXPORT_SYMBOL(cfs_strrstr); -/* non-0 = don't match */ -int cfs_strncasecmp(const char *s1, const char *s2, size_t n) -{ - if (s1 == NULL || s2 == NULL) - return 1; - - if (n == 0) - return 0; - - while (n-- != 0 && tolower(*s1) == tolower(*s2)) { - if (n == 0 || *s1 == '\0' || *s2 == '\0') - break; - s1++; - s2++; - } - - 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), int *oldmask, int minmask, int allmask) @@ -129,7 +109,7 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit), debugstr = bit2str(i); if (debugstr != NULL && strlen(debugstr) == len && - cfs_strncasecmp(str, debugstr, len) == 0) { + strncasecmp(str, debugstr, len) == 0) { if (op == '-') newmask &= ~(1 << i); else @@ -139,7 +119,7 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit), } } if (!found && len == 3 && - (cfs_strncasecmp(str, "ALL", len) == 0)) { + (strncasecmp(str, "ALL", len) == 0)) { if (op == '-') newmask = minmask; else diff --git a/lnet/lnet/router_proc.c b/lnet/lnet/router_proc.c index d151474..e39e1ee 100644 --- a/lnet/lnet/router_proc.c +++ b/lnet/lnet/router_proc.c @@ -840,8 +840,8 @@ static int __proc_lnet_portal_rotor(void *data, int write, rc = -EINVAL; lnet_res_lock(0); for (i = 0; portal_rotors[i].pr_name != NULL; i++) { - if (cfs_strncasecmp(portal_rotors[i].pr_name, tmp, - strlen(portal_rotors[i].pr_name)) == 0) { + if (strncasecmp(portal_rotors[i].pr_name, tmp, + strlen(portal_rotors[i].pr_name)) == 0) { portal_rotor = portal_rotors[i].pr_value; rc = 0; break;