Skip to contentSkip to conversation

f2fs: fix macro definition on_f2fs_build_free_nids

PATCH Superseded Julian Sun 2 participants 5 messages Jul 21, 2024 – Jul 22, 2024 F2FS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Julian Sun

author
#0 lore raw

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
index b72ef96f7e33..34eeb2a8598c 100644
@@ -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
author
#1 lore raw

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
index 8a9d910aa552..c9925d1ca2df 100644
@@ -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
maintainer
#2 lore raw

Re: [f2fs-dev] [PATCH 2/2] f2fs: fix macro definition stat_inc_cp_count

Quoted 14 lines · Julian Sun

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 +0 -0
index 8a9d910aa552..c9925d1ca2df 100644

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

maintainer
#3 lore raw
In reply to Julian Sun
Quoted 14 lines · Julian Sun

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 +0 -0
index b72ef96f7e33..34eeb2a8598c 100644

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 -0
  static 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

author
#4 lore raw
Quoted 19 lines · Chao Yu <[email protected]> 于2024年7月21日周日 21:32写道:
Quoted 17 lines · Julian Sun

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 +0 -0
index b72ef96f7e33..34eeb2a8598c 100644
@@ -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_i instead 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 struct kmem_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