projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9388e7c
)
smb: client: simplify cifs_fscache_get_super_cookie()
author
Dmitry Antipov
<dmantipov@yandex.ru>
Mon, 27 Jul 2026 17:20:35 +0000
(20:20 +0300)
committer
Steve French
<stfrench@microsoft.com>
Mon, 27 Jul 2026 23:12:16 +0000
(18:12 -0500)
Avoid redundant 'strlen()' and use the convenient 'strreplace()'
to simplify 'cifs_fscache_get_super_cookie()'.
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/fscache.c
patch
|
blob
|
history
diff --git
a/fs/smb/client/fscache.c
b/fs/smb/client/fscache.c
index
01424a5
..
9f66bbc
100644
(file)
--- a/
fs/smb/client/fscache.c
+++ b/
fs/smb/client/fscache.c
@@
-38,7
+38,6
@@
int cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
struct TCP_Server_Info *server = tcon->ses->server;
struct fscache_volume *vcookie;
const struct sockaddr *sa = (struct sockaddr *)&server->dstaddr;
- size_t slen, i;
char *sharename;
char *key;
int ret = -ENOMEM;
@@
-73,10
+72,7
@@
int cifs_fscache_get_super_cookie(struct cifs_tcon *tcon)
return PTR_ERR(sharename);
}
- slen = strlen(sharename);
- for (i = 0; i < slen; i++)
- if (sharename[i] == '/')
- sharename[i] = ';';
+ strreplace(sharename, '/', ';');
key = kasprintf(GFP_KERNEL, "cifs,%pISpc,%s", sa, sharename);
if (!key)