aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2014-10-13 18:54:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-13 20:18:24 -0400
commit87e747cdb9828cb09828ccbdc398374192355c68 (patch)
tree61335c8fa6b82d118a76ea92ed0263551bc46bd5
parentc4dd08694b8f078900c8e0c86e369b667a5101c5 (diff)
cifs: replace strnicmp with strncasecmp
The kernel used to contain two functions for length-delimited, case-insensitive string comparison, strnicmp with correct semantics and a slightly buggy strncasecmp. The latter is the POSIX name, so strnicmp was renamed to strncasecmp, and strnicmp made into a wrapper for the new strncasecmp to avoid breaking existing users. To allow the compat wrapper strnicmp to be removed at some point in the future, and to avoid the extra indirection cost, do s/strnicmp/strncasecmp/g. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Cc: Steve French <sfrench@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/cifs/cifs_dfs_ref.c6
-rw-r--r--fs/cifs/connect.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index 58df174deb10..b8602f199815 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -195,15 +195,15 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
195 else 195 else
196 noff = tkn_e - (sb_mountdata + off) + 1; 196 noff = tkn_e - (sb_mountdata + off) + 1;
197 197
198 if (strnicmp(sb_mountdata + off, "unc=", 4) == 0) { 198 if (strncasecmp(sb_mountdata + off, "unc=", 4) == 0) {
199 off += noff; 199 off += noff;
200 continue; 200 continue;
201 } 201 }
202 if (strnicmp(sb_mountdata + off, "ip=", 3) == 0) { 202 if (strncasecmp(sb_mountdata + off, "ip=", 3) == 0) {
203 off += noff; 203 off += noff;
204 continue; 204 continue;
205 } 205 }
206 if (strnicmp(sb_mountdata + off, "prefixpath=", 11) == 0) { 206 if (strncasecmp(sb_mountdata + off, "prefixpath=", 11) == 0) {
207 off += noff; 207 off += noff;
208 continue; 208 continue;
209 } 209 }
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 36ca2045009b..239e1fb33000 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1718,7 +1718,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1718 goto cifs_parse_mount_err; 1718 goto cifs_parse_mount_err;
1719 } 1719 }
1720 1720
1721 if (strnicmp(string, "default", 7) != 0) { 1721 if (strncasecmp(string, "default", 7) != 0) {
1722 vol->iocharset = kstrdup(string, 1722 vol->iocharset = kstrdup(string,
1723 GFP_KERNEL); 1723 GFP_KERNEL);
1724 if (!vol->iocharset) { 1724 if (!vol->iocharset) {
@@ -1790,7 +1790,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
1790 if (string == NULL) 1790 if (string == NULL)
1791 goto out_nomem; 1791 goto out_nomem;
1792 1792
1793 if (strnicmp(string, "1", 1) == 0) { 1793 if (strncasecmp(string, "1", 1) == 0) {
1794 /* This is the default */ 1794 /* This is the default */
1795 break; 1795 break;
1796 } 1796 }