提交 987c7c31 编写于 作者: C Chao Yu 提交者: Jaegeuk Kim

f2fs: introduce f2fs_has_inline_xattr for better readability

This patch introduces a help function f2fs_has_inline_xattr for better
readability.
Signed-off-by: NChao Yu <chao2.yu@samsung.com>
Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
上级 28cdce04
...@@ -991,9 +991,14 @@ static inline void set_raw_inline(struct f2fs_inode_info *fi, ...@@ -991,9 +991,14 @@ static inline void set_raw_inline(struct f2fs_inode_info *fi,
ri->i_inline |= F2FS_INLINE_DATA; ri->i_inline |= F2FS_INLINE_DATA;
} }
static inline int f2fs_has_inline_xattr(struct inode *inode)
{
return is_inode_flag_set(F2FS_I(inode), FI_INLINE_XATTR);
}
static inline unsigned int addrs_per_inode(struct f2fs_inode_info *fi) static inline unsigned int addrs_per_inode(struct f2fs_inode_info *fi)
{ {
if (is_inode_flag_set(fi, FI_INLINE_XATTR)) if (f2fs_has_inline_xattr(&fi->vfs_inode))
return DEF_ADDRS_PER_INODE - F2FS_INLINE_XATTR_ADDRS; return DEF_ADDRS_PER_INODE - F2FS_INLINE_XATTR_ADDRS;
return DEF_ADDRS_PER_INODE; return DEF_ADDRS_PER_INODE;
} }
...@@ -1007,7 +1012,7 @@ static inline void *inline_xattr_addr(struct page *page) ...@@ -1007,7 +1012,7 @@ static inline void *inline_xattr_addr(struct page *page)
static inline int inline_xattr_size(struct inode *inode) static inline int inline_xattr_size(struct inode *inode)
{ {
if (is_inode_flag_set(F2FS_I(inode), FI_INLINE_XATTR)) if (f2fs_has_inline_xattr(inode))
return F2FS_INLINE_XATTR_ADDRS << 2; return F2FS_INLINE_XATTR_ADDRS << 2;
else else
return 0; return 0;
......
...@@ -1501,7 +1501,7 @@ void recover_inline_xattr(struct inode *inode, struct page *page) ...@@ -1501,7 +1501,7 @@ void recover_inline_xattr(struct inode *inode, struct page *page)
struct page *ipage; struct page *ipage;
struct f2fs_inode *ri; struct f2fs_inode *ri;
if (!is_inode_flag_set(F2FS_I(inode), FI_INLINE_XATTR)) if (!f2fs_has_inline_xattr(inode))
return; return;
if (!IS_INODE(page)) if (!IS_INODE(page))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部