Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 45590710 authored by Gu Zheng's avatar Gu Zheng Committed by Jaegeuk Kim
Browse files

f2fs: introduce help function F2FS_NODE()



Introduce help function F2FS_NODE() to simplify the conversion of node_page to
f2fs_node.

Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 963d4f7d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ static void __set_data_blkaddr(struct dnode_of_data *dn, block_t new_addr)

	wait_on_page_writeback(node_page);

	rn = (struct f2fs_node *)page_address(node_page);
	rn = F2FS_NODE(node_page);

	/* Get physical address of data block */
	addr_array = blkaddr_in_node(rn);
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ static void init_dent_inode(const struct qstr *name, struct page *ipage)
	struct f2fs_node *rn;

	/* copy name info. to this inode page */
	rn = (struct f2fs_node *)page_address(ipage);
	rn = F2FS_NODE(ipage);
	rn->i.i_namelen = cpu_to_le32(name->len);
	memcpy(rn->i.i_name, name->name, name->len);
	set_page_dirty(ipage);
+7 −2
Original line number Diff line number Diff line
@@ -455,6 +455,11 @@ static inline struct f2fs_checkpoint *F2FS_CKPT(struct f2fs_sb_info *sbi)
	return (struct f2fs_checkpoint *)(sbi->ckpt);
}

static inline struct f2fs_node *F2FS_NODE(struct page *page)
{
	return (struct f2fs_node *)page_address(page);
}

static inline struct f2fs_nm_info *NM_I(struct f2fs_sb_info *sbi)
{
	return (struct f2fs_nm_info *)(sbi->nm_info);
@@ -813,7 +818,7 @@ static inline struct kmem_cache *f2fs_kmem_cache_create(const char *name,

static inline bool IS_INODE(struct page *page)
{
	struct f2fs_node *p = (struct f2fs_node *)page_address(page);
	struct f2fs_node *p = F2FS_NODE(page);
	return RAW_IS_INODE(p);
}

@@ -827,7 +832,7 @@ static inline block_t datablock_addr(struct page *node_page,
{
	struct f2fs_node *raw_node;
	__le32 *addr_array;
	raw_node = (struct f2fs_node *)page_address(node_page);
	raw_node = F2FS_NODE(node_page);
	addr_array = blkaddr_in_node(raw_node);
	return le32_to_cpu(addr_array[offset]);
}
+1 −1
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ int truncate_data_blocks_range(struct dnode_of_data *dn, int count)
	struct f2fs_node *raw_node;
	__le32 *addr;

	raw_node = page_address(dn->node_page);
	raw_node = F2FS_NODE(dn->node_page);
	addr = blkaddr_in_node(raw_node) + ofs;

	for ( ; count > 0; count--, addr++, dn->ofs_in_node++) {
+2 −2
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ static int do_read_inode(struct inode *inode)
	if (IS_ERR(node_page))
		return PTR_ERR(node_page);

	rn = page_address(node_page);
	rn = F2FS_NODE(node_page);
	ri = &(rn->i);

	inode->i_mode = le16_to_cpu(ri->i_mode);
@@ -153,7 +153,7 @@ void update_inode(struct inode *inode, struct page *node_page)

	wait_on_page_writeback(node_page);

	rn = page_address(node_page);
	rn = F2FS_NODE(node_page);
	ri = &(rn->i);

	ri->i_mode = cpu_to_le16(inode->i_mode);
Loading