* [PATCH 1/2] erofs: get rid of ROOT_NID()
@ 2023-10-26 2:16 Ferry Meng
2023-10-26 2:16 ` [PATCH 2/2] erofs: tidy up redundant includes Ferry Meng
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Ferry Meng @ 2023-10-26 2:16 UTC (permalink / raw)
To: linux-erofs; +Cc: LKML, Ferry Meng
Let's open code this helper for simplicity.
Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
---
fs/erofs/internal.h | 2 --
fs/erofs/super.c | 6 +++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index 4ff88d0dd980..ca7d85958450 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -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)
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 3700af9ee173..019229eb2ef6 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -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;
}
--
2.19.1.6.gb485710b
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/2] erofs: tidy up redundant includes
2023-10-26 2:16 [PATCH 1/2] erofs: get rid of ROOT_NID() Ferry Meng
@ 2023-10-26 2:16 ` Ferry Meng
2023-10-26 2:35 ` Gao Xiang
` (2 more replies)
2023-10-26 2:34 ` [PATCH 1/2] erofs: get rid of ROOT_NID() Gao Xiang
` (2 subsequent siblings)
3 siblings, 3 replies; 8+ messages in thread
From: Ferry Meng @ 2023-10-26 2:16 UTC (permalink / raw)
To: linux-erofs; +Cc: LKML, Ferry Meng
- Remove unused includes like <linux/parser.h> and <linux/prefetch.h>;
- Move common includes into "internal.h".
Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
---
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(-)
diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index 0c2c99c58b5e..ceb6c248bf40 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -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)
diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c
index 332ec5f74002..29d539481a2b 100644
--- a/fs/erofs/decompressor.c
+++ b/fs/erofs/decompressor.c
@@ -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 */
diff --git a/fs/erofs/decompressor_deflate.c b/fs/erofs/decompressor_deflate.c
index 19e5bdeb30b6..c15ce24d51df 100644
--- a/fs/erofs/decompressor_deflate.c
+++ b/fs/erofs/decompressor_deflate.c
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: GPL-2.0-or-later
-#include <linux/module.h>
#include <linux/zlib.h>
#include "compress.h"
diff --git a/fs/erofs/decompressor_lzma.c b/fs/erofs/decompressor_lzma.c
index dee10d22ada9..72a202740cdb 100644
--- a/fs/erofs/decompressor_lzma.c
+++ b/fs/erofs/decompressor_lzma.c
@@ -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 {
diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index ca7d85958450..3551a5734e89 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -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>
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 019229eb2ef6..f38ff2d63364 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -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"
--
2.19.1.6.gb485710b
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 2/2] erofs: tidy up redundant includes
2023-10-26 2:16 ` [PATCH 2/2] erofs: tidy up redundant includes Ferry Meng
@ 2023-10-26 2:35 ` Gao Xiang
2023-10-26 3:42 ` Yue Hu
2023-10-30 15:04 ` Chao Yu
2 siblings, 0 replies; 8+ messages in thread
From: Gao Xiang @ 2023-10-26 2:35 UTC (permalink / raw)
To: Ferry Meng, linux-erofs; +Cc: LKML
On 2023/10/26 10:16, Ferry Meng wrote:
> - Remove unused includes like <linux/parser.h> and <linux/prefetch.h>;
>
> - Move common includes into "internal.h".
>
> 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] 8+ messages in thread
* Re: [PATCH 2/2] erofs: tidy up redundant includes
2023-10-26 2:16 ` [PATCH 2/2] erofs: tidy up redundant includes Ferry Meng
2023-10-26 2:35 ` Gao Xiang
@ 2023-10-26 3:42 ` Yue Hu
2023-10-30 15:04 ` Chao Yu
2 siblings, 0 replies; 8+ messages in thread
From: Yue Hu @ 2023-10-26 3:42 UTC (permalink / raw)
To: Ferry Meng; +Cc: linux-erofs, LKML
On Thu, 26 Oct 2023 10:16:27 +0800
Ferry Meng <mengferry@linux.alibaba.com> wrote:
> - Remove unused includes like <linux/parser.h> and <linux/prefetch.h>;
>
> - Move common includes into "internal.h".
>
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
Reviewed-by: Yue Hu <huyue2@coolpad.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] erofs: tidy up redundant includes
2023-10-26 2:16 ` [PATCH 2/2] erofs: tidy up redundant includes Ferry Meng
2023-10-26 2:35 ` Gao Xiang
2023-10-26 3:42 ` Yue Hu
@ 2023-10-30 15:04 ` Chao Yu
2 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2023-10-30 15:04 UTC (permalink / raw)
To: Ferry Meng, linux-erofs; +Cc: LKML
On 2023/10/26 10:16, Ferry Meng wrote:
> - Remove unused includes like <linux/parser.h> and <linux/prefetch.h>;
>
> - Move common includes into "internal.h".
>
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
Reviewed-by: Chao Yu <chao@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] erofs: get rid of ROOT_NID()
2023-10-26 2:16 [PATCH 1/2] erofs: get rid of ROOT_NID() Ferry Meng
2023-10-26 2:16 ` [PATCH 2/2] erofs: tidy up redundant includes Ferry Meng
@ 2023-10-26 2:34 ` Gao Xiang
2023-10-26 3:31 ` Yue Hu
2023-10-30 15:03 ` Chao Yu
3 siblings, 0 replies; 8+ messages in thread
From: Gao Xiang @ 2023-10-26 2:34 UTC (permalink / raw)
To: Ferry Meng, linux-erofs; +Cc: LKML
On 2023/10/26 10:16, Ferry Meng wrote:
> Let's open code this helper for simplicity.
>
> 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] 8+ messages in thread
* Re: [PATCH 1/2] erofs: get rid of ROOT_NID()
2023-10-26 2:16 [PATCH 1/2] erofs: get rid of ROOT_NID() Ferry Meng
2023-10-26 2:16 ` [PATCH 2/2] erofs: tidy up redundant includes Ferry Meng
2023-10-26 2:34 ` [PATCH 1/2] erofs: get rid of ROOT_NID() Gao Xiang
@ 2023-10-26 3:31 ` Yue Hu
2023-10-30 15:03 ` Chao Yu
3 siblings, 0 replies; 8+ messages in thread
From: Yue Hu @ 2023-10-26 3:31 UTC (permalink / raw)
To: Ferry Meng; +Cc: linux-erofs, LKML
On Thu, 26 Oct 2023 10:16:26 +0800
Ferry Meng <mengferry@linux.alibaba.com> wrote:
> Let's open code this helper for simplicity.
>
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
Reviewed-by: Yue Hu <huyue2@coolpad.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] erofs: get rid of ROOT_NID()
2023-10-26 2:16 [PATCH 1/2] erofs: get rid of ROOT_NID() Ferry Meng
` (2 preceding siblings ...)
2023-10-26 3:31 ` Yue Hu
@ 2023-10-30 15:03 ` Chao Yu
3 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2023-10-30 15:03 UTC (permalink / raw)
To: Ferry Meng, linux-erofs; +Cc: LKML
On 2023/10/26 10:16, Ferry Meng wrote:
> Let's open code this helper for simplicity.
>
> Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
Reviewed-by: Chao Yu <chao@kernel.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-10-30 15:04 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-26 2:16 [PATCH 1/2] erofs: get rid of ROOT_NID() Ferry Meng
2023-10-26 2:16 ` [PATCH 2/2] erofs: tidy up redundant includes Ferry Meng
2023-10-26 2:35 ` Gao Xiang
2023-10-26 3:42 ` Yue Hu
2023-10-30 15:04 ` Chao Yu
2023-10-26 2:34 ` [PATCH 1/2] erofs: get rid of ROOT_NID() Gao Xiang
2023-10-26 3:31 ` Yue Hu
2023-10-30 15:03 ` Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox