Commit 9a8ec03e authored by weiping zhang's avatar weiping zhang Committed by Linus Torvalds

shmem: convert shmem_init_inodecache() to void

shmem_inode_cachep was created with SLAB_PANIC flag and
shmem_init_inodecache() never returns non-zero, so convert this
function to return void.

Link: http://lkml.kernel.org/r/20170909124542.GA35224@bogon.didichuxing.comSigned-off-by: default avatarweiping zhang <zhangweiping@didichuxing.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 31367466
...@@ -3862,12 +3862,11 @@ static void shmem_init_inode(void *foo) ...@@ -3862,12 +3862,11 @@ static void shmem_init_inode(void *foo)
inode_init_once(&info->vfs_inode); inode_init_once(&info->vfs_inode);
} }
static int shmem_init_inodecache(void) static void shmem_init_inodecache(void)
{ {
shmem_inode_cachep = kmem_cache_create("shmem_inode_cache", shmem_inode_cachep = kmem_cache_create("shmem_inode_cache",
sizeof(struct shmem_inode_info), sizeof(struct shmem_inode_info),
0, SLAB_PANIC|SLAB_ACCOUNT, shmem_init_inode); 0, SLAB_PANIC|SLAB_ACCOUNT, shmem_init_inode);
return 0;
} }
static void shmem_destroy_inodecache(void) static void shmem_destroy_inodecache(void)
...@@ -3991,9 +3990,7 @@ int __init shmem_init(void) ...@@ -3991,9 +3990,7 @@ int __init shmem_init(void)
if (shmem_inode_cachep) if (shmem_inode_cachep)
return 0; return 0;
error = shmem_init_inodecache(); shmem_init_inodecache();
if (error)
goto out3;
error = register_filesystem(&shmem_fs_type); error = register_filesystem(&shmem_fs_type);
if (error) { if (error) {
...@@ -4020,7 +4017,6 @@ int __init shmem_init(void) ...@@ -4020,7 +4017,6 @@ int __init shmem_init(void)
unregister_filesystem(&shmem_fs_type); unregister_filesystem(&shmem_fs_type);
out2: out2:
shmem_destroy_inodecache(); shmem_destroy_inodecache();
out3:
shm_mnt = ERR_PTR(error); shm_mnt = ERR_PTR(error);
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment