mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
smb: client: simplify cifs_fscache_get_super_cookie()
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>
This commit is contained in:
parent
9388e7c820
commit
b476724a6d
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user