f2fs: fix macro definition on_f2fs_build_free_nids
PATCH 1/2 f2fs: fix macro definition on_f2fs_build_free_nids
The macro on_f2fs_build_free_nids accepts a parameter nmi, but it was not used, rather the variable nm_i was directly used, which may be a local variable inside a function that calls the macros.
--- fs/f2fs/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/node.c +1 -1
@@ -20,7 +20,7 @@#include "iostat.h" #include <trace/events/f2fs.h> -#define on_f2fs_build_free_nids (nmi) mutex_is_locked(&(nm_i)->build_lock) +#define on_f2fs_build_free_nids (nmi) mutex_is_locked(&(nmi)->build_lock)static struct kmem_cache *nat_entry_slab;static struct kmem_cache *free_nid_slab;
Signature · 8 lines
2.39.2 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
PATCH 2/2 f2fs: fix macro definition stat_inc_cp_count
The macro stat_inc_cp_count accepts a parameter si,
but it was not used, rather the variable sbi was directly used, which may be a local variable inside a function that calls the macros.
--- fs/f2fs/f2fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/f2fs.h +1 -1
@@ -3987,7 +3987,7 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)#define stat_inc_cp_call_count (sbi, foreground) \ atomic_inc(&sbi->cp_call_count[(foreground)]) -#define stat_inc_cp_count (si) (F2FS_STAT(sbi)->cp_count++) +#define stat_inc_cp_count (_sbi) (F2FS_STAT(_sbi)->cp_count++)#define stat_io_skip_bggc_count (sbi) ((sbi)->io_skip_bggc++)#define stat_other_skip_bggc_count (sbi) ((sbi)->other_skip_bggc++)#define stat_inc_dirty_inode (sbi, type) ((sbi)->ndirty_inode[type]++)
Signature · 8 lines
2.39.2 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Chao Yu
maintainerRe: [f2fs-dev] [PATCH 2/2] f2fs: fix macro definition stat_inc_cp_count
Quoted 14 lines · Julian Sun
The macro
stat_inc_cp_countaccepts a parameter si,
but it was not used, rather the variable sbi was directly used, which may be a local variable inside a function that calls the macros.Signed-off-by Julian Sun <[email protected]>--- fs/f2fs/f2fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/f2fs.h +0
-0
fs/f2fs/f2fs.h static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi) · line 3990
Quoted 5 lines
fs/f2fs/f2fs.h +1
-1@@ -3987,7 +3987,7 @@ static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)#define stat_inc_cp_call_count (sbi, foreground) \ atomic_inc(&sbi->cp_call_count[(foreground)]) -#define stat_inc_cp_count (si) (F2FS_STAT(sbi)->cp_count++) +#define stat_inc_cp_count (_sbi) (F2FS_STAT(_sbi)->cp_count++)
Let's use sbi instead of _sbi.
Thanks,
fs/f2fs/f2fs.h static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi) · line 3993
Quoted 3 lines
fs/f2fs/f2fs.h +0
-0#define stat_io_skip_bggc_count (sbi) ((sbi)->io_skip_bggc++)#define stat_other_skip_bggc_count (sbi) ((sbi)->other_skip_bggc++)#define stat_inc_dirty_inode (sbi, type) ((sbi)->ndirty_inode[type]++)
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Chao Yu
maintainerQuoted 14 lines · Julian Sun
The macro
on_f2fs_build_free_nidsaccepts a parameter nmi, but it was not used, rather the variablenm_iwas directly used, which may be a local variable inside a function that calls the macros.Signed-off-by Julian Sun <[email protected]>--- fs/f2fs/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/node.c +0
-0
fs/f2fs/node.c line 23
Quoted 5 lines
fs/f2fs/node.c +1
-1@@ -20,7 +20,7 @@#include "iostat.h" #include <trace/events/f2fs.h> -#define on_f2fs_build_free_nids (nmi) mutex_is_locked(&(nm_i)->build_lock) +#define on_f2fs_build_free_nids (nmi) mutex_is_locked(&(nmi)->build_lock)
It's better to use nm_i instead of nmi?
Thanks,
fs/f2fs/node.c line 26
Quoted 3 lines
fs/f2fs/node.c +0
-0static struct kmem_cache *nat_entry_slab;static struct kmem_cache *free_nid_slab;
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 19 lines · Chao Yu <[email protected]> 于2024年7月21日周日 21:32写道:
Quoted 17 lines · Julian Sun
The macro
on_f2fs_build_free_nidsaccepts a parameter nmi, but it was not used, rather the variablenm_iwas directly used, which may be a local variable inside a function that calls the macros.Signed-off-by Julian Sun <[email protected]>--- fs/f2fs/node.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/node.c +0
-0@@ -20,7 +20,7 @@#include "iostat.h" #include <trace/events/f2fs.h>
Quoted 7 lines
Quoted 7 lines
fs/f2fs/node.c +1
-1-#define on_f2fs_build_free_nids (nmi) mutex_is_locked(&(nm_i)->build_lock) +#define on_f2fs_build_free_nids (nmi) mutex_is_locked(&(nmi)->build_lock)It's better to use
nm_iinstead of nmi?Thanks,
Thanks a lot for your review.
Sure. I will send patch v2.
Quoted 4 lines
Quoted 4 lines
static struct
kmem_cache*nat_entry_slab;
static structkmem_cache*free_nid_slab;
Best regards,
Signature · 7 lines
Julian Sun <[email protected]> _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel