public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment
@ 2023-08-15  9:48 Ferry Meng
  2023-08-15  9:48 ` [PATCH 2/3] erofs: add necessary kmem_cache_create flags for erofs inode cache Ferry Meng
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Ferry Meng @ 2023-08-15  9:48 UTC (permalink / raw)
  To: linux-erofs; +Cc: LKML, Ferry Meng

Remove some redundant comments in erofs/super.c, and avoid unncessary
line breaks for cleanup.

Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
---
 fs/erofs/super.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 566f68ddfa36..ae5caf605ffc 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -21,8 +21,7 @@
 static struct kmem_cache *erofs_inode_cachep __read_mostly;
 struct file_system_type erofs_fs_type;
 
-void _erofs_err(struct super_block *sb, const char *function,
-		const char *fmt, ...)
+void _erofs_err(struct super_block *sb, const char *func, const char *fmt, ...)
 {
 	struct va_format vaf;
 	va_list args;
@@ -32,12 +31,11 @@ void _erofs_err(struct super_block *sb, const char *function,
 	vaf.fmt = fmt;
 	vaf.va = &args;
 
-	pr_err("(device %s): %s: %pV", sb->s_id, function, &vaf);
+	pr_err("(device %s): %s: %pV", sb->s_id, func, &vaf);
 	va_end(args);
 }
 
-void _erofs_info(struct super_block *sb, const char *function,
-		 const char *fmt, ...)
+void _erofs_info(struct super_block *sb, const char *func, const char *fmt, ...)
 {
 	struct va_format vaf;
 	va_list args;
@@ -102,11 +100,9 @@ static void erofs_free_inode(struct inode *inode)
 {
 	struct erofs_inode *vi = EROFS_I(inode);
 
-	/* be careful of RCU symlink path */
 	if (inode->i_op == &erofs_fast_symlink_iops)
 		kfree(inode->i_link);
 	kfree(vi->xattr_shared_xattrs);
-
 	kmem_cache_free(erofs_inode_cachep, vi);
 }
 
@@ -119,8 +115,7 @@ static bool check_layout_compatibility(struct super_block *sb,
 
 	/* check if current kernel meets all mandatory requirements */
 	if (feature & (~EROFS_ALL_FEATURE_INCOMPAT)) {
-		erofs_err(sb,
-			  "unidentified incompatible feature %x, please upgrade kernel version",
+		erofs_err(sb, "unidentified incompatible feature %x, please upgrade kernel",
 			   feature & ~EROFS_ALL_FEATURE_INCOMPAT);
 		return false;
 	}
@@ -429,7 +424,6 @@ static int erofs_read_superblock(struct super_block *sb)
 	return ret;
 }
 
-/* set up default EROFS parameters */
 static void erofs_default_options(struct erofs_fs_context *ctx)
 {
 #ifdef CONFIG_EROFS_FS_ZIP
@@ -731,7 +725,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
 	xa_init(&sbi->managed_pslots);
 #endif
 
-	/* get the root inode */
 	inode = erofs_iget(sb, ROOT_NID(sbi));
 	if (IS_ERR(inode))
 		return PTR_ERR(inode);
@@ -748,7 +741,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
 		return -ENOMEM;
 
 	erofs_shrinker_register(sb);
-	/* sb->s_umount is already locked, SB_ACTIVE and SB_BORN are not set */
 	if (erofs_sb_has_fragments(sbi) && sbi->packed_nid) {
 		sbi->packed_inode = erofs_iget(sb, sbi->packed_nid);
 		if (IS_ERR(sbi->packed_inode)) {
@@ -881,10 +873,6 @@ static int erofs_init_fs_context(struct fs_context *fc)
 	return 0;
 }
 
-/*
- * could be triggered after deactivate_locked_super()
- * is called, thus including umount and failed to initialize.
- */
 static void erofs_kill_sb(struct super_block *sb)
 {
 	struct erofs_sb_info *sbi;
@@ -913,7 +901,6 @@ static void erofs_kill_sb(struct super_block *sb)
 	sb->s_fs_info = NULL;
 }
 
-/* called when ->s_root is non-NULL */
 static void erofs_put_super(struct super_block *sb)
 {
 	struct erofs_sb_info *const sbi = EROFS_SB(sb);
@@ -1007,7 +994,6 @@ static void __exit erofs_module_exit(void)
 	erofs_pcpubuf_exit();
 }
 
-/* get filesystem statistics */
 static int erofs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
 	struct super_block *sb = dentry->d_sb;
-- 
2.19.1.6.gb485710b


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

* [PATCH 2/3] erofs: add necessary kmem_cache_create flags for erofs inode cache
  2023-08-15  9:48 [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment Ferry Meng
@ 2023-08-15  9:48 ` Ferry Meng
  2023-08-15 15:13   ` Gao Xiang
  2023-08-23 14:45   ` Chao Yu
  2023-08-15  9:48 ` [PATCH 3/3] erofs: remove redundant erofs_fs_type declaration in super.c Ferry Meng
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 10+ messages in thread
From: Ferry Meng @ 2023-08-15  9:48 UTC (permalink / raw)
  To: linux-erofs; +Cc: LKML, Ferry Meng

To improve memory access efficiency and enable statistics functionality,
add SLAB_MEM_SPREAD and SLAB_ACCOUNT flag during erofs_icachep's allocation
time.

Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
---
 fs/erofs/super.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index ae5caf605ffc..82f41d09f8d8 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -937,9 +937,9 @@ static int __init erofs_module_init(void)
 	erofs_check_ondisk_layout_definitions();
 
 	erofs_inode_cachep = kmem_cache_create("erofs_inode",
-					       sizeof(struct erofs_inode), 0,
-					       SLAB_RECLAIM_ACCOUNT,
-					       erofs_inode_init_once);
+					    sizeof(struct erofs_inode), 0,
+					    SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD | SLAB_ACCOUNT,
+					    erofs_inode_init_once);
 	if (!erofs_inode_cachep)
 		return -ENOMEM;
 
-- 
2.19.1.6.gb485710b


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

* [PATCH 3/3] erofs: remove redundant erofs_fs_type declaration in super.c
  2023-08-15  9:48 [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment Ferry Meng
  2023-08-15  9:48 ` [PATCH 2/3] erofs: add necessary kmem_cache_create flags for erofs inode cache Ferry Meng
@ 2023-08-15  9:48 ` Ferry Meng
  2023-08-15 15:15   ` Gao Xiang
  2023-08-23 14:46   ` Chao Yu
  2023-08-15 15:14 ` [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment Gao Xiang
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 10+ messages in thread
From: Ferry Meng @ 2023-08-15  9:48 UTC (permalink / raw)
  To: linux-erofs; +Cc: LKML, Ferry Meng

As erofs_fs_type has been declared in internal.h, there is no use to
declare repeatedly in super.c.

Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
---
 fs/erofs/super.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 82f41d09f8d8..78a94955dd61 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -19,7 +19,6 @@
 #include <trace/events/erofs.h>
 
 static struct kmem_cache *erofs_inode_cachep __read_mostly;
-struct file_system_type erofs_fs_type;
 
 void _erofs_err(struct super_block *sb, const char *func, const char *fmt, ...)
 {
-- 
2.19.1.6.gb485710b


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

* Re: [PATCH 2/3] erofs: add necessary kmem_cache_create flags for erofs inode cache
  2023-08-15  9:48 ` [PATCH 2/3] erofs: add necessary kmem_cache_create flags for erofs inode cache Ferry Meng
@ 2023-08-15 15:13   ` Gao Xiang
  2023-08-23 14:45   ` Chao Yu
  1 sibling, 0 replies; 10+ messages in thread
From: Gao Xiang @ 2023-08-15 15:13 UTC (permalink / raw)
  To: Ferry Meng, linux-erofs; +Cc: LKML



On 2023/8/15 17:48, Ferry Meng wrote:
> To improve memory access efficiency and enable statistics functionality,
> add SLAB_MEM_SPREAD and SLAB_ACCOUNT flag during erofs_icachep's allocation
> time.
> 
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>

Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Thanks,
Gao Xiang

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

* Re: [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment
  2023-08-15  9:48 [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment Ferry Meng
  2023-08-15  9:48 ` [PATCH 2/3] erofs: add necessary kmem_cache_create flags for erofs inode cache Ferry Meng
  2023-08-15  9:48 ` [PATCH 3/3] erofs: remove redundant erofs_fs_type declaration in super.c Ferry Meng
@ 2023-08-15 15:14 ` Gao Xiang
  2023-08-15 15:15 ` Gao Xiang
  2023-08-23 14:38 ` Chao Yu
  4 siblings, 0 replies; 10+ messages in thread
From: Gao Xiang @ 2023-08-15 15:14 UTC (permalink / raw)
  To: Ferry Meng, linux-erofs; +Cc: LKML



On 2023/8/15 17:48, Ferry Meng wrote:
> Remove some redundant comments in erofs/super.c, and avoid unncessary
> line breaks for cleanup.
> 
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>

Thanks,
Gao Xiang

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

* Re: [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment
  2023-08-15  9:48 [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment Ferry Meng
                   ` (2 preceding siblings ...)
  2023-08-15 15:14 ` [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment Gao Xiang
@ 2023-08-15 15:15 ` Gao Xiang
  2023-08-23 14:38 ` Chao Yu
  4 siblings, 0 replies; 10+ messages in thread
From: Gao Xiang @ 2023-08-15 15:15 UTC (permalink / raw)
  To: Ferry Meng, linux-erofs; +Cc: LKML



On 2023/8/15 17:48, Ferry Meng wrote:
> Remove some redundant comments in erofs/super.c, and avoid unncessary
> line breaks for cleanup.
> 
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>

Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Thanks,
Gao Xiang

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

* Re: [PATCH 3/3] erofs: remove redundant erofs_fs_type declaration in super.c
  2023-08-15  9:48 ` [PATCH 3/3] erofs: remove redundant erofs_fs_type declaration in super.c Ferry Meng
@ 2023-08-15 15:15   ` Gao Xiang
  2023-08-23 14:46   ` Chao Yu
  1 sibling, 0 replies; 10+ messages in thread
From: Gao Xiang @ 2023-08-15 15:15 UTC (permalink / raw)
  To: Ferry Meng, linux-erofs; +Cc: LKML



On 2023/8/15 17:48, Ferry Meng wrote:
> As erofs_fs_type has been declared in internal.h, there is no use to
> declare repeatedly in super.c.
> 
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>

Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Thanks,
Gao Xiang

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

* Re: [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment
  2023-08-15  9:48 [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment Ferry Meng
                   ` (3 preceding siblings ...)
  2023-08-15 15:15 ` Gao Xiang
@ 2023-08-23 14:38 ` Chao Yu
  4 siblings, 0 replies; 10+ messages in thread
From: Chao Yu @ 2023-08-23 14:38 UTC (permalink / raw)
  To: Ferry Meng, linux-erofs; +Cc: LKML

On 2023/8/15 17:48, Ferry Meng wrote:
> Remove some redundant comments in erofs/super.c, and avoid unncessary
> line breaks for cleanup.
> 
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

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

* Re: [PATCH 2/3] erofs: add necessary kmem_cache_create flags for erofs inode cache
  2023-08-15  9:48 ` [PATCH 2/3] erofs: add necessary kmem_cache_create flags for erofs inode cache Ferry Meng
  2023-08-15 15:13   ` Gao Xiang
@ 2023-08-23 14:45   ` Chao Yu
  1 sibling, 0 replies; 10+ messages in thread
From: Chao Yu @ 2023-08-23 14:45 UTC (permalink / raw)
  To: Ferry Meng, linux-erofs; +Cc: LKML

On 2023/8/15 17:48, Ferry Meng wrote:
> To improve memory access efficiency and enable statistics functionality,
> add SLAB_MEM_SPREAD and SLAB_ACCOUNT flag during erofs_icachep's allocation
> time.
> 
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

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

* Re: [PATCH 3/3] erofs: remove redundant erofs_fs_type declaration in super.c
  2023-08-15  9:48 ` [PATCH 3/3] erofs: remove redundant erofs_fs_type declaration in super.c Ferry Meng
  2023-08-15 15:15   ` Gao Xiang
@ 2023-08-23 14:46   ` Chao Yu
  1 sibling, 0 replies; 10+ messages in thread
From: Chao Yu @ 2023-08-23 14:46 UTC (permalink / raw)
  To: Ferry Meng, linux-erofs; +Cc: LKML

On 2023/8/15 17:48, Ferry Meng wrote:
> As erofs_fs_type has been declared in internal.h, there is no use to
> declare repeatedly in super.c.
> 
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

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

end of thread, other threads:[~2023-08-23 14:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15  9:48 [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment Ferry Meng
2023-08-15  9:48 ` [PATCH 2/3] erofs: add necessary kmem_cache_create flags for erofs inode cache Ferry Meng
2023-08-15 15:13   ` Gao Xiang
2023-08-23 14:45   ` Chao Yu
2023-08-15  9:48 ` [PATCH 3/3] erofs: remove redundant erofs_fs_type declaration in super.c Ferry Meng
2023-08-15 15:15   ` Gao Xiang
2023-08-23 14:46   ` Chao Yu
2023-08-15 15:14 ` [PATCH 1/3] erofs: clean up redundant comment and adjust code alignment Gao Xiang
2023-08-15 15:15 ` Gao Xiang
2023-08-23 14:38 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox