* [patch 114/131] shmem: convert shmem_init_inodecache() to void
@ 2017-11-16 1:38 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2017-11-16 1:38 UTC (permalink / raw)
To: akpm, hughd, mm-commits, torvalds, zhangweiping
From: weiping zhang <zhangweiping@didichuxing.com>
Subject: 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.com
Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/shmem.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff -puN mm/shmem.c~shmem-convert-shmem_init_inodecache-to-void mm/shmem.c
--- a/mm/shmem.c~shmem-convert-shmem_init_inodecache-to-void
+++ a/mm/shmem.c
@@ -3862,12 +3862,11 @@ static void shmem_init_inode(void *foo)
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",
sizeof(struct shmem_inode_info),
0, SLAB_PANIC|SLAB_ACCOUNT, shmem_init_inode);
- return 0;
}
static void shmem_destroy_inodecache(void)
@@ -3991,9 +3990,7 @@ int __init shmem_init(void)
if (shmem_inode_cachep)
return 0;
- error = shmem_init_inodecache();
- if (error)
- goto out3;
+ shmem_init_inodecache();
error = register_filesystem(&shmem_fs_type);
if (error) {
@@ -4020,7 +4017,6 @@ out1:
unregister_filesystem(&shmem_fs_type);
out2:
shmem_destroy_inodecache();
-out3:
shm_mnt = ERR_PTR(error);
return error;
}
_
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-11-16 1:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-16 1:38 [patch 114/131] shmem: convert shmem_init_inodecache() to void akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).