mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
9p: simplify v9fs_cache_session_get_cookie()
Use the convenient 'strreplace()' to simplify 'v9fs_cache_session_get_cookie()'. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Message-ID: <20260814040826.1213127-1-dmantipov@yandex.ru> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
This commit is contained in:
parent
64f350a594
commit
74795e00cf
|
|
@ -20,17 +20,14 @@ int v9fs_cache_session_get_cookie(struct v9fs_session_info *v9ses,
|
|||
const char *dev_name)
|
||||
{
|
||||
struct fscache_volume *vcookie;
|
||||
char *name, *p;
|
||||
char *name;
|
||||
|
||||
name = kasprintf(GFP_KERNEL, "9p,%s,%s",
|
||||
dev_name, v9ses->cachetag ?: v9ses->aname);
|
||||
if (!name)
|
||||
return -ENOMEM;
|
||||
|
||||
for (p = name; *p; p++)
|
||||
if (*p == '/')
|
||||
*p = ';';
|
||||
|
||||
strreplace(name, '/', ';');
|
||||
vcookie = fscache_acquire_volume(name, NULL, NULL, 0);
|
||||
p9_debug(P9_DEBUG_FSC, "session %p get volume %p (%s)\n",
|
||||
v9ses, vcookie, name);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user