From 399f36d8c6e0c8292d2ff3db4fdcd33263b415ec Mon Sep 17 00:00:00 2001 From: Jingbo Xu Date: Thu, 30 Mar 2023 16:29:03 +0800 Subject: erofs: move several xattr helpers into xattr.c Move xattrblock_addr() and xattrblock_offset() helpers into xattr.c, as they are not used outside of xattr.c. inlinexattr_header_size() has only one caller, and thus make it inlined into the caller directly. Signed-off-by: Jingbo Xu Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/20230330082910.125374-2-jefflexu@linux.alibaba.com Reviewed-by: Yue Hu Acked-by: Chao Yu Signed-off-by: Gao Xiang --- fs/erofs/xattr.h | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'fs/erofs/xattr.h') diff --git a/fs/erofs/xattr.h b/fs/erofs/xattr.h index f7a21aaa9755..a65158cba14f 100644 --- a/fs/erofs/xattr.h +++ b/fs/erofs/xattr.h @@ -13,29 +13,6 @@ /* Attribute not found */ #define ENOATTR ENODATA -static inline unsigned int inlinexattr_header_size(struct inode *inode) -{ - return sizeof(struct erofs_xattr_ibody_header) + - sizeof(u32) * EROFS_I(inode)->xattr_shared_count; -} - -static inline erofs_blk_t xattrblock_addr(struct super_block *sb, - unsigned int xattr_id) -{ -#ifdef CONFIG_EROFS_FS_XATTR - return EROFS_SB(sb)->xattr_blkaddr + - xattr_id * sizeof(__u32) / sb->s_blocksize; -#else - return 0; -#endif -} - -static inline unsigned int xattrblock_offset(struct super_block *sb, - unsigned int xattr_id) -{ - return (xattr_id * sizeof(__u32)) % sb->s_blocksize; -} - #ifdef CONFIG_EROFS_FS_XATTR extern const struct xattr_handler erofs_xattr_user_handler; extern const struct xattr_handler erofs_xattr_trusted_handler; -- cgit v1.2.3