Skip to content

Commit 45c5b88

Browse files
ColinIanKingmartinetd
authored andcommitted
fs/9p: replace functions v9fs_cache_{register|unregister} with direct calls
The helper functions v9fs_cache_register and v9fs_cache_unregister are trivial helper functions that don't offer any extra functionality and are unncessary. Replace them with direct calls to v9fs_init_inode_cache and v9fs_destroy_inode_cache respectively to simplify the code. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Message-ID: <20241107095756.10261-1-colin.i.king@gmail.com> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
1 parent 2d5404c commit 45c5b88

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

fs/9p/v9fs.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -659,21 +659,6 @@ static void v9fs_destroy_inode_cache(void)
659659
kmem_cache_destroy(v9fs_inode_cache);
660660
}
661661

662-
static int v9fs_cache_register(void)
663-
{
664-
int ret;
665-
666-
ret = v9fs_init_inode_cache();
667-
if (ret < 0)
668-
return ret;
669-
return ret;
670-
}
671-
672-
static void v9fs_cache_unregister(void)
673-
{
674-
v9fs_destroy_inode_cache();
675-
}
676-
677662
/**
678663
* init_v9fs - Initialize module
679664
*
@@ -686,7 +671,7 @@ static int __init init_v9fs(void)
686671
pr_info("Installing v9fs 9p2000 file system support\n");
687672
/* TODO: Setup list of registered trasnport modules */
688673

689-
err = v9fs_cache_register();
674+
err = v9fs_init_inode_cache();
690675
if (err < 0) {
691676
pr_err("Failed to register v9fs for caching\n");
692677
return err;
@@ -709,7 +694,7 @@ static int __init init_v9fs(void)
709694
v9fs_sysfs_cleanup();
710695

711696
out_cache:
712-
v9fs_cache_unregister();
697+
v9fs_destroy_inode_cache();
713698

714699
return err;
715700
}
@@ -722,7 +707,7 @@ static int __init init_v9fs(void)
722707
static void __exit exit_v9fs(void)
723708
{
724709
v9fs_sysfs_cleanup();
725-
v9fs_cache_unregister();
710+
v9fs_destroy_inode_cache();
726711
unregister_filesystem(&v9fs_fs_type);
727712
}
728713

0 commit comments

Comments
 (0)