Commit 428f27cc authored by Ferry Meng's avatar Ferry Meng Committed by Gao Xiang

erofs: clean up redundant comment and adjust code alignment

Remove some redundant comments in erofs/super.c, and avoid unncessary
line breaks for cleanup.
Signed-off-by: default avatarFerry Meng <mengferry@linux.alibaba.com>
Reviewed-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20230815094849.53249-1-mengferry@linux.alibaba.comSigned-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
parent e3157bb5
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
static struct kmem_cache *erofs_inode_cachep __read_mostly; static struct kmem_cache *erofs_inode_cachep __read_mostly;
struct file_system_type erofs_fs_type; struct file_system_type erofs_fs_type;
void _erofs_err(struct super_block *sb, const char *function, void _erofs_err(struct super_block *sb, const char *func, const char *fmt, ...)
const char *fmt, ...)
{ {
struct va_format vaf; struct va_format vaf;
va_list args; va_list args;
...@@ -32,12 +31,11 @@ void _erofs_err(struct super_block *sb, const char *function, ...@@ -32,12 +31,11 @@ void _erofs_err(struct super_block *sb, const char *function,
vaf.fmt = fmt; vaf.fmt = fmt;
vaf.va = &args; 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); va_end(args);
} }
void _erofs_info(struct super_block *sb, const char *function, void _erofs_info(struct super_block *sb, const char *func, const char *fmt, ...)
const char *fmt, ...)
{ {
struct va_format vaf; struct va_format vaf;
va_list args; va_list args;
...@@ -102,11 +100,9 @@ static void erofs_free_inode(struct inode *inode) ...@@ -102,11 +100,9 @@ static void erofs_free_inode(struct inode *inode)
{ {
struct erofs_inode *vi = EROFS_I(inode); struct erofs_inode *vi = EROFS_I(inode);
/* be careful of RCU symlink path */
if (inode->i_op == &erofs_fast_symlink_iops) if (inode->i_op == &erofs_fast_symlink_iops)
kfree(inode->i_link); kfree(inode->i_link);
kfree(vi->xattr_shared_xattrs); kfree(vi->xattr_shared_xattrs);
kmem_cache_free(erofs_inode_cachep, vi); kmem_cache_free(erofs_inode_cachep, vi);
} }
...@@ -119,8 +115,7 @@ static bool check_layout_compatibility(struct super_block *sb, ...@@ -119,8 +115,7 @@ static bool check_layout_compatibility(struct super_block *sb,
/* check if current kernel meets all mandatory requirements */ /* check if current kernel meets all mandatory requirements */
if (feature & (~EROFS_ALL_FEATURE_INCOMPAT)) { if (feature & (~EROFS_ALL_FEATURE_INCOMPAT)) {
erofs_err(sb, erofs_err(sb, "unidentified incompatible feature %x, please upgrade kernel",
"unidentified incompatible feature %x, please upgrade kernel version",
feature & ~EROFS_ALL_FEATURE_INCOMPAT); feature & ~EROFS_ALL_FEATURE_INCOMPAT);
return false; return false;
} }
...@@ -433,7 +428,6 @@ static int erofs_read_superblock(struct super_block *sb) ...@@ -433,7 +428,6 @@ static int erofs_read_superblock(struct super_block *sb)
return ret; return ret;
} }
/* set up default EROFS parameters */
static void erofs_default_options(struct erofs_fs_context *ctx) static void erofs_default_options(struct erofs_fs_context *ctx)
{ {
#ifdef CONFIG_EROFS_FS_ZIP #ifdef CONFIG_EROFS_FS_ZIP
...@@ -735,7 +729,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) ...@@ -735,7 +729,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
xa_init(&sbi->managed_pslots); xa_init(&sbi->managed_pslots);
#endif #endif
/* get the root inode */
inode = erofs_iget(sb, ROOT_NID(sbi)); inode = erofs_iget(sb, ROOT_NID(sbi));
if (IS_ERR(inode)) if (IS_ERR(inode))
return PTR_ERR(inode); return PTR_ERR(inode);
...@@ -752,7 +745,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) ...@@ -752,7 +745,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
return -ENOMEM; return -ENOMEM;
erofs_shrinker_register(sb); 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) { if (erofs_sb_has_fragments(sbi) && sbi->packed_nid) {
sbi->packed_inode = erofs_iget(sb, sbi->packed_nid); sbi->packed_inode = erofs_iget(sb, sbi->packed_nid);
if (IS_ERR(sbi->packed_inode)) { if (IS_ERR(sbi->packed_inode)) {
...@@ -885,10 +877,6 @@ static int erofs_init_fs_context(struct fs_context *fc) ...@@ -885,10 +877,6 @@ static int erofs_init_fs_context(struct fs_context *fc)
return 0; 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) static void erofs_kill_sb(struct super_block *sb)
{ {
struct erofs_sb_info *sbi; struct erofs_sb_info *sbi;
...@@ -917,7 +905,6 @@ static void erofs_kill_sb(struct super_block *sb) ...@@ -917,7 +905,6 @@ static void erofs_kill_sb(struct super_block *sb)
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
} }
/* called when ->s_root is non-NULL */
static void erofs_put_super(struct super_block *sb) static void erofs_put_super(struct super_block *sb)
{ {
struct erofs_sb_info *const sbi = EROFS_SB(sb); struct erofs_sb_info *const sbi = EROFS_SB(sb);
...@@ -1018,7 +1005,6 @@ static void __exit erofs_module_exit(void) ...@@ -1018,7 +1005,6 @@ static void __exit erofs_module_exit(void)
erofs_pcpubuf_exit(); erofs_pcpubuf_exit();
} }
/* get filesystem statistics */
static int erofs_statfs(struct dentry *dentry, struct kstatfs *buf) static int erofs_statfs(struct dentry *dentry, struct kstatfs *buf)
{ {
struct super_block *sb = dentry->d_sb; struct super_block *sb = dentry->d_sb;
......
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