From 74795e00cfa797023a177db10c95d1d2776f27e6 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Fri, 14 Aug 2026 07:08:26 +0300 Subject: [PATCH] 9p: simplify v9fs_cache_session_get_cookie() Use the convenient 'strreplace()' to simplify 'v9fs_cache_session_get_cookie()'. Signed-off-by: Dmitry Antipov Message-ID: <20260814040826.1213127-1-dmantipov@yandex.ru> Signed-off-by: Dominique Martinet --- fs/9p/cache.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/9p/cache.c b/fs/9p/cache.c index 12c0ae29f185..194a912158ac 100644 --- a/fs/9p/cache.c +++ b/fs/9p/cache.c @@ -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);