Skip to contentSkip to conversation

smb/client: remove unused smb3_parse_opt()

PATCH Applied David Disseldorp 2 participants 2 messages Apr 26

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smb/client: remove unused smb3_parse_opt()

Commit abdb1742a3123 ("cifs: get rid of mount options string parsing") removed the last caller.

---
 fs/smb/client/cifsproto.h  |  1 -
 fs/smb/client/fs_context.c | 31 -------------------------------
 2 files changed, 32 deletions(-)
fs/smb/client/cifsproto.h +0 -1
index 884bfa1cf0b42..b7cd67b64a833 100644
@@ -89,7 +89,6 @@ int cifs_handle_standard(struct TCP_Server_Info *server,
 			 struct mid_q_entry *mid);
 char *smb3_fs_context_fullpath(const struct smb3_fs_context *ctx, char dirsep);
 int smb3_parse_devname(const char *devname, struct smb3_fs_context *ctx);
-int smb3_parse_opt(const char *options, const char *key, char **val);
 int cifs_ipaddr_cmp(struct sockaddr *srcaddr, struct sockaddr *rhs);
 bool cifs_match_ipaddr(struct sockaddr *srcaddr, struct sockaddr *rhs);
 int cifs_discard_remaining_data(struct TCP_Server_Info *server);
fs/smb/client/fs_context.c +0 -31
index a46764c247107..6433eb2093dce 100644
@@ -536,37 +536,6 @@ cifs_parse_smb_version(struct fs_context *fc, char *value, struct smb3_fs_contex
 	return 0;
 }
 
-int smb3_parse_opt(const char *options, const char *key, char **val)
-{
-	int rc = -ENOENT;
-	char *opts, *orig, *p;
-
-	orig = opts = kstrdup(options, GFP_KERNEL);
-	if (!opts)
-		return -ENOMEM;
-
-	while ((p = strsep(&opts, ","))) {
-		char *nval;
-
-		if (!*p)
-			continue;
-		if (strncasecmp(p, key, strlen(key)))
-			continue;
-		nval = strchr(p, '=');
-		if (nval) {
-			if (nval == p)
-				continue;
-			*nval++ = 0;
-			*val = kstrdup(nval, GFP_KERNEL);
-			rc = !*val ? -ENOMEM : 0;
-			goto out;
-		}
-	}
-out:
-	kfree(orig);
-	return rc;
-}
-
 /*
  * Remove duplicate path delimiters. Windows is supposed to do that
  * but there are some bugs that prevent rename from working if there are
Signature · 1 line
2.51.0
Applied
#1 lore raw

merged into cifs-2.6.git for-next

Quoted 67 lines · David Disseldorp

Commit abdb1742a3123 ("cifs: get rid of mount options string parsing") removed the last caller.

---
 fs/smb/client/cifsproto.h  |  1 -
 fs/smb/client/fs_context.c | 31 -------------------------------
 2 files changed, 32 deletions(-)
fs/smb/client/cifsproto.h +0 -1
index 884bfa1cf0b42..b7cd67b64a833 100644
@@ -89,7 +89,6 @@ int cifs_handle_standard(struct TCP_Server_Info *server,
                         struct mid_q_entry *mid);
 char *smb3_fs_context_fullpath(const struct smb3_fs_context *ctx, char dirsep);
 int smb3_parse_devname(const char *devname, struct smb3_fs_context *ctx);
-int smb3_parse_opt(const char *options, const char *key, char **val);
 int cifs_ipaddr_cmp(struct sockaddr *srcaddr, struct sockaddr *rhs);
 bool cifs_match_ipaddr(struct sockaddr *srcaddr, struct sockaddr *rhs);
 int cifs_discard_remaining_data(struct TCP_Server_Info *server);
fs/smb/client/fs_context.c +0 -32
index a46764c247107..6433eb2093dce 100644
@@ -536,37 +536,6 @@ cifs_parse_smb_version(struct fs_context *fc, char *value, struct smb3_fs_contex
        return 0;
 }
 
-int smb3_parse_opt(const char *options, const char *key, char **val)
-{
-       int rc = -ENOENT;
-       char *opts, *orig, *p;
-
-       orig = opts = kstrdup(options, GFP_KERNEL);
-       if (!opts)
-               return -ENOMEM;
-
-       while ((p = strsep(&opts, ","))) {
-               char *nval;
-
-               if (!*p)
-                       continue;
-               if (strncasecmp(p, key, strlen(key)))
-                       continue;
-               nval = strchr(p, '=');
-               if (nval) {
-                       if (nval == p)
-                               continue;
-                       *nval++ = 0;
-                       *val = kstrdup(nval, GFP_KERNEL);
-                       rc = !*val ? -ENOMEM : 0;
-                       goto out;
-               }
-       }
-out:
-       kfree(orig);
-       return rc;
-}
-
 /*
  * Remove duplicate path delimiters. Windows is supposed to do that
  * but there are some bugs that prevent rename from working if there are
--

2.51.0

Signature · 3 lines
Thanks,

Steve