All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] shmem: convert shmem_init_inodecache to void
@ 2017-09-09 12:46 weiping zhang
  2017-09-19 13:27 ` weiping zhang
  0 siblings, 1 reply; 2+ messages in thread
From: weiping zhang @ 2017-09-09 12:46 UTC (permalink / raw)
  To: hughd; +Cc: linux-mm

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

Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
---
 mm/shmem.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index ace53a582b..d744296 100644
--- a/mm/shmem.c
+++ b/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 @@ int __init shmem_init(void)
 	unregister_filesystem(&shmem_fs_type);
 out2:
 	shmem_destroy_inodecache();
-out3:
 	shm_mnt = ERR_PTR(error);
 	return error;
 }
-- 
2.9.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] shmem: convert shmem_init_inodecache to void
  2017-09-09 12:46 [PATCH] shmem: convert shmem_init_inodecache to void weiping zhang
@ 2017-09-19 13:27 ` weiping zhang
  0 siblings, 0 replies; 2+ messages in thread
From: weiping zhang @ 2017-09-19 13:27 UTC (permalink / raw)
  To: hughd; +Cc: linux-mm

On Sat, Sep 09, 2017 at 08:46:19PM +0800, weiping zhang wrote:
> shmem_inode_cachep was created with SLAB_PANIC flag and shmem_init_inodecache
> never return non-zero, hence convert this function to void.
> 
> Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
> ---
>  mm/shmem.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index ace53a582b..d744296 100644
> --- a/mm/shmem.c
> +++ b/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 @@ int __init shmem_init(void)
>  	unregister_filesystem(&shmem_fs_type);
>  out2:
>  	shmem_destroy_inodecache();
> -out3:
>  	shm_mnt = ERR_PTR(error);
>  	return error;
>  }
> -- 
> 2.9.4
> 

Hello Hughd,

Did you have time to look into this ?

Thanks,
Weiping

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-19 13:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-09 12:46 [PATCH] shmem: convert shmem_init_inodecache to void weiping zhang
2017-09-19 13:27 ` weiping zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.