diff mbox series

[f2fs-dev,1/2] f2fs: fix macro definition on_f2fs_build_free_nids

Message ID 20240721131739.260027-1-sunjunchao2870@gmail.com (mailing list archive)
State Superseded
Headers show
Series [f2fs-dev,1/2] f2fs: fix macro definition on_f2fs_build_free_nids | expand

Commit Message

Julian Sun July 21, 2024, 1:17 p.m. UTC
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.

Signed-off-by: Julian Sun <sunjunchao2870@gmail.com>
---
 fs/f2fs/node.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chao Yu July 22, 2024, 1:32 a.m. UTC | #1
On 2024/7/21 21:17, Julian Sun wrote:
> 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.
> 
> Signed-off-by: Julian Sun <sunjunchao2870@gmail.com>
> ---
>   fs/f2fs/node.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index b72ef96f7e33..34eeb2a8598c 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -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,

>   
>   static struct kmem_cache *nat_entry_slab;
>   static struct kmem_cache *free_nid_slab;
Julian Sun July 22, 2024, 2:14 a.m. UTC | #2
Chao Yu <chao@kernel.org> 于2024年7月21日周日 21:32写道:
>
> On 2024/7/21 21:17, Julian Sun wrote:
> > 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.
> >
> > Signed-off-by: Julian Sun <sunjunchao2870@gmail.com>
> > ---
> >   fs/f2fs/node.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> > index b72ef96f7e33..34eeb2a8598c 100644
> > --- a/fs/f2fs/node.c
> > +++ b/fs/f2fs/node.c
> > @@ -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,

Thanks a lot for your review.
Sure. I will send patch v2.

>
> >
> >   static struct kmem_cache *nat_entry_slab;
> >   static struct kmem_cache *free_nid_slab;


Best regards,
diff mbox series

Patch

diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index b72ef96f7e33..34eeb2a8598c 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -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;