f2fs: fix to use le32_to_cpu() in RAW_IS_INODE()
Chao Yu
maintainerPATCH 1/1 f2fs: fix to use le32_to_cpu() in RAW_IS_INODE()
__le32 type variable should be converted w/ le32_to_cpu() before access.
Signed-off-by Chao Yu <[email protected]>
--- fs/f2fs/f2fs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
fs/f2fs/f2fs.h +5 -1
@@ -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) {
Signature · 8 lines
2.40.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Jaegeuk Kim
maintainerQuoted 12 lines · Chao Yu
__le32type variable should be converted w/le32_to_cpu()before access.Signed-off-by Chao Yu <[email protected]>--- fs/f2fs/f2fs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)fs/f2fs/f2fs.h +0
-0
fs/f2fs/f2fs.h static inline void f2fs_radix_tree_insert(struct radix_tree_root *root, · line 2843
Quoted 4 lines
fs/f2fs/f2fs.h +0
-1@@ -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?
Quoted 10 lines
fs/f2fs/f2fs.h +5
-0+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) {Signature · 1 line
2.40.1