linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: fix to use le32_to_cpu() in RAW_IS_INODE()
@ 2023-05-18  9:29 Chao Yu
  2023-05-24  1:36 ` Jaegeuk Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Chao Yu @ 2023-05-18  9:29 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

__le32 type variable should be converted w/ le32_to_cpu() before access.

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fs/f2fs/f2fs.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 7f6c51a6b930..a4bff3b5b887 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -2840,7 +2840,11 @@ static inline void f2fs_radix_tree_insert(struct radix_tree_root *root,
 		cond_resched();
 }
 
-#define RAW_IS_INODE(p)	((p)->footer.nid == (p)->footer.ino)
+static inline bool RAW_IS_INODE(struct f2fs_node *node)
+{
+	return le32_to_cpu(node->footer.ino) ==
+			le32_to_cpu(node->footer.nid);
+}
 
 static inline bool IS_INODE(struct page *page)
 {
-- 
2.40.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: fix to use le32_to_cpu() in RAW_IS_INODE()
  2023-05-18  9:29 [f2fs-dev] [PATCH] f2fs: fix to use le32_to_cpu() in RAW_IS_INODE() Chao Yu
@ 2023-05-24  1:36 ` Jaegeuk Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Jaegeuk Kim @ 2023-05-24  1:36 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-kernel, linux-f2fs-devel

On 05/18, Chao Yu wrote:
> __le32 type variable should be converted w/ le32_to_cpu() before access.
> 
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
>  fs/f2fs/f2fs.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 7f6c51a6b930..a4bff3b5b887 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -2840,7 +2840,11 @@ static inline void f2fs_radix_tree_insert(struct radix_tree_root *root,
>  		cond_resched();
>  }
>  
> -#define RAW_IS_INODE(p)	((p)->footer.nid == (p)->footer.ino)

Does this compare the same __le32 types?

> +static inline bool RAW_IS_INODE(struct f2fs_node *node)
> +{
> +	return le32_to_cpu(node->footer.ino) ==
> +			le32_to_cpu(node->footer.nid);
> +}
>  
>  static inline bool IS_INODE(struct page *page)
>  {
> -- 
> 2.40.1


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-24  1:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-18  9:29 [f2fs-dev] [PATCH] f2fs: fix to use le32_to_cpu() in RAW_IS_INODE() Chao Yu
2023-05-24  1:36 ` Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).