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

Commit 4bc8e9bc authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

f2fs: introduce f2fs_has_xattr_block for better readability



This patch introduces a help function f2fs_has_xattr_block for better
readability.

Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 90aa6dc9
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -637,6 +637,11 @@ static inline int F2FS_HAS_BLOCKS(struct inode *inode)
		return inode->i_blocks > F2FS_DEFAULT_ALLOCATED_BLOCKS;
		return inode->i_blocks > F2FS_DEFAULT_ALLOCATED_BLOCKS;
}
}


static inline bool f2fs_has_xattr_block(unsigned int ofs)
{
	return ofs == XATTR_NODE_OFFSET;
}

static inline bool inc_valid_block_count(struct f2fs_sb_info *sbi,
static inline bool inc_valid_block_count(struct f2fs_sb_info *sbi,
				 struct inode *inode, blkcnt_t count)
				 struct inode *inode, blkcnt_t count)
{
{
+2 −2
Original line number Original line Diff line number Diff line
@@ -836,7 +836,7 @@ struct page *new_node_page(struct dnode_of_data *dn,
	SetPageUptodate(page);
	SetPageUptodate(page);
	set_page_dirty(page);
	set_page_dirty(page);


	if (ofs == XATTR_NODE_OFFSET)
	if (f2fs_has_xattr_block(ofs))
		F2FS_I(dn->inode)->i_xattr_nid = dn->nid;
		F2FS_I(dn->inode)->i_xattr_nid = dn->nid;


	dn->node_page = page;
	dn->node_page = page;
@@ -1533,7 +1533,7 @@ bool recover_xattr_data(struct inode *inode, struct page *page, block_t blkaddr)


	recover_inline_xattr(inode, page);
	recover_inline_xattr(inode, page);


	if (ofs_of_node(page) != XATTR_NODE_OFFSET)
	if (!f2fs_has_xattr_block(ofs_of_node(page)))
		return false;
		return false;


	/* 1: invalidate the previous xattr nid */
	/* 1: invalidate the previous xattr nid */
+1 −1
Original line number Original line Diff line number Diff line
@@ -242,7 +242,7 @@ static inline bool IS_DNODE(struct page *node_page)
{
{
	unsigned int ofs = ofs_of_node(node_page);
	unsigned int ofs = ofs_of_node(node_page);


	if (ofs == XATTR_NODE_OFFSET)
	if (f2fs_has_xattr_block(ofs))
		return false;
		return false;


	if (ofs == 3 || ofs == 4 + NIDS_PER_BLOCK ||
	if (ofs == 3 || ofs == 4 + NIDS_PER_BLOCK ||