erofs: get rid of ROOT_NID()
PATCH 1/2 erofs: get rid of ROOT_NID()
Let's open code this helper for simplicity.
--- fs/erofs/internal.h | 2 -- fs/erofs/super.c | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-)
fs/erofs/internal.h +0 -2
@@ -228,8 +228,6 @@ struct erofs_buf { };#define __EROFS_BUF_INITIALIZER ((struct erofs_buf){ .page = NULL }) -#define ROOT_NID (sb) ((sb)->root_nid) -#define erofs_blknr (sb, addr) ((addr) >> (sb)->s_blocksize_bits)#define erofs_blkoff (sb, addr) ((addr) & ((sb)->s_blocksize - 1))#define erofs_pos (sb, blk) ((erofs_off_t)(blk) << (sb)->s_blocksize_bits)
fs/erofs/super.c +3 -3
@@ -724,13 +724,13 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)xa_init (&sbi->managed_pslots);#endif - inode =erofs_iget (sb,ROOT_NID (sbi)); + inode =erofs_iget (sb, sbi->root_nid);if (IS_ERR (inode))return PTR_ERR (inode);if (!S_ISDIR (inode->i_mode)) {erofs_err (sb,"rootino(nid %llu) is not a directory(i_mode %o)" , -ROOT_NID (sbi), inode->i_mode); + sbi->root_nid, inode->i_mode);iput (inode);return -EINVAL ; }
@@ -760,7 +760,7 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)if (err)return err; -erofs_info (sb,"mounted with root inode @ nid %llu." ,ROOT_NID (sbi)); +erofs_info (sb,"mounted with root inode @ nid %llu." , sbi->root_nid);return 0 ; }
Signature · 1 line
2.19.1.6.gb485710b
PATCH 2/2 erofs: tidy up redundant includes
- Remove unused includes like <linux/parser.h> and <linux/prefetch.h>;
- Move common includes into "internal.h".
--- fs/erofs/data.c | 2 -- fs/erofs/decompressor.c | 1 - fs/erofs/decompressor_deflate.c | 1 - fs/erofs/decompressor_lzma.c | 1 - fs/erofs/internal.h | 2 ++ fs/erofs/super.c | 3 --- 6 files changed, 2 insertions(+), 8 deletions(-)
fs/erofs/data.c +0 -2
@@ -5,9 +5,7 @@* Copyright (C) 2021, Alibaba Cloud */ #include "internal.h" -#include <linux/prefetch.h> #include <linux/sched/mm.h> -#include <linux/dax.h> #include <trace/events/erofs.h> void erofs_unmap_metabuf (struct erofs_buf *buf)
fs/erofs/decompressor.c +0 -1
@@ -4,7 +4,6 @@* https://www.huawei.com/ */ #include "compress.h" -#include <linux/module.h> #include <linux/lz4.h> #ifndef LZ4_DISTANCE_MAX /* history window size */
fs/erofs/decompressor_deflate.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0-or-later -#include <linux/module.h> #include <linux/zlib.h> #include "compress.h"
fs/erofs/decompressor_lzma.c +0 -1
@@ -1,6 +1,5 @@// SPDX-License-Identifier: GPL-2.0-or-later #include <linux/xz.h> -#include <linux/module.h> #include "compress.h" struct z_erofs_lzma {
fs/erofs/internal.h +2 -0
@@ -8,8 +8,10 @@#define __EROFS_INTERNAL_H#include <linux/fs.h> +#include <linux/dax.h> #include <linux/dcache.h> #include <linux/mm.h> +#include <linux/module.h> #include <linux/pagemap.h> #include <linux/bio.h> #include <linux/magic.h>
fs/erofs/super.c +0 -3
@@ -4,14 +4,11 @@* https://www.huawei.com/ * Copyright (C) 2021, Alibaba Cloud */ -#include <linux/module.h> #include <linux/statfs.h> -#include <linux/parser.h> #include <linux/seq_file.h> #include <linux/crc32c.h> #include <linux/fs_context.h> #include <linux/fs_parser.h> -#include <linux/dax.h> #include <linux/exportfs.h> #include "xattr.h"
Signature · 1 line
2.19.1.6.gb485710b
Re: [PATCH 2/2] erofs: tidy up redundant includes
Quoted 5 lines · Ferry Meng
- Remove unused includes like <
linux/parser.h> and <linux/prefetch.h>;- Move common includes into "
internal.h".Signed-off-by Ferry Meng <[email protected]>
Thanks,
Gao Xiang
Re: [PATCH 2/2] erofs: tidy up redundant includes
In reply to Ferry MengQuoted 5 lines · On Thu, 26 Oct 2023 10:16:27 +0800 Ferry Meng <[email protected]>…
- Remove unused includes like <
linux/parser.h> and <linux/prefetch.h>;- Move common includes into "
internal.h".Signed-off-by Ferry Meng <[email protected]>
Re: [PATCH 2/2] erofs: tidy up redundant includes
In reply to Ferry MengQuoted 5 lines · Ferry Meng
- Remove unused includes like <
linux/parser.h> and <linux/prefetch.h>;- Move common includes into "
internal.h".Signed-off-by Ferry Meng <[email protected]>
Quoted 3 lines · Ferry Meng
Let's open code this helper for simplicity.
Signed-off-by Ferry Meng <[email protected]>
Thanks,
Gao Xiang
Quoted 3 lines · On Thu, 26 Oct 2023 10:16:26 +0800 Ferry Meng <[email protected]>…
Let's open code this helper for simplicity.
Signed-off-by Ferry Meng <[email protected]>
Quoted 3 lines · Ferry Meng
Let's open code this helper for simplicity.
Signed-off-by Ferry Meng <[email protected]>