aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorGu Zheng <guz.fnst@cn.fujitsu.com>2013-07-15 05:57:38 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-07-30 02:17:02 -0400
commit4559071063270999d016c92a0b9241692cbbb522 (patch)
tree06e530ac8b0d5e80c4bd15011f019f666689279b /fs/f2fs/f2fs.h
parent963d4f7d7be6f9dba77362941921c33034fee91e (diff)
f2fs: introduce help function F2FS_NODE()
Introduce help function F2FS_NODE() to simplify the conversion of node_page to f2fs_node. Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 0a352b658ed8..2dfd584bf79f 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -455,6 +455,11 @@ static inline struct f2fs_checkpoint *F2FS_CKPT(struct f2fs_sb_info *sbi)
455 return (struct f2fs_checkpoint *)(sbi->ckpt); 455 return (struct f2fs_checkpoint *)(sbi->ckpt);
456} 456}
457 457
458static inline struct f2fs_node *F2FS_NODE(struct page *page)
459{
460 return (struct f2fs_node *)page_address(page);
461}
462
458static inline struct f2fs_nm_info *NM_I(struct f2fs_sb_info *sbi) 463static inline struct f2fs_nm_info *NM_I(struct f2fs_sb_info *sbi)
459{ 464{
460 return (struct f2fs_nm_info *)(sbi->nm_info); 465 return (struct f2fs_nm_info *)(sbi->nm_info);
@@ -813,7 +818,7 @@ static inline struct kmem_cache *f2fs_kmem_cache_create(const char *name,
813 818
814static inline bool IS_INODE(struct page *page) 819static inline bool IS_INODE(struct page *page)
815{ 820{
816 struct f2fs_node *p = (struct f2fs_node *)page_address(page); 821 struct f2fs_node *p = F2FS_NODE(page);
817 return RAW_IS_INODE(p); 822 return RAW_IS_INODE(p);
818} 823}
819 824
@@ -827,7 +832,7 @@ static inline block_t datablock_addr(struct page *node_page,
827{ 832{
828 struct f2fs_node *raw_node; 833 struct f2fs_node *raw_node;
829 __le32 *addr_array; 834 __le32 *addr_array;
830 raw_node = (struct f2fs_node *)page_address(node_page); 835 raw_node = F2FS_NODE(node_page);
831 addr_array = blkaddr_in_node(raw_node); 836 addr_array = blkaddr_in_node(raw_node);
832 return le32_to_cpu(addr_array[offset]); 837 return le32_to_cpu(addr_array[offset]);
833} 838}