Commit 45c5b88b authored by Colin Ian King's avatar Colin Ian King Committed by Dominique Martinet
Browse files

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: default avatarColin Ian King <colin.i.king@gmail.com>
Message-ID: <20241107095756.10261-1-colin.i.king@gmail.com>
Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
parent 2d5404ca
Loading
Loading
Loading
Loading
+3 −18
Original line number Diff line number Diff line
@@ -659,21 +659,6 @@ static void v9fs_destroy_inode_cache(void)
	kmem_cache_destroy(v9fs_inode_cache);
}

static int v9fs_cache_register(void)
{
	int ret;

	ret = v9fs_init_inode_cache();
	if (ret < 0)
		return ret;
	return ret;
}

static void v9fs_cache_unregister(void)
{
	v9fs_destroy_inode_cache();
}

/**
 * init_v9fs - Initialize module
 *
@@ -686,7 +671,7 @@ static int __init init_v9fs(void)
	pr_info("Installing v9fs 9p2000 file system support\n");
	/* TODO: Setup list of registered trasnport modules */

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

out_cache:
	v9fs_cache_unregister();
	v9fs_destroy_inode_cache();

	return err;
}
@@ -722,7 +707,7 @@ static int __init init_v9fs(void)
static void __exit exit_v9fs(void)
{
	v9fs_sysfs_cleanup();
	v9fs_cache_unregister();
	v9fs_destroy_inode_cache();
	unregister_filesystem(&v9fs_fs_type);
}