summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_inode_fork.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-09 20:56:07 +0300
committerDarrick J. Wong <djwong@kernel.org>2022-07-12 21:17:27 +0300
commitc01147d929899f02a0a8b15e406d12784768ca72 (patch)
tree28ab8cd3cdb8ac076bfe7f59abaf327b1ac3f453 /fs/xfs/libxfs/xfs_inode_fork.h
parent932b42c66cb5d0ca9800b128415b4ad6b1952b3e (diff)
downloadlinux-c01147d929899f02a0a8b15e406d12784768ca72.tar.xz
xfs: replace inode fork size macros with functions
Replace the shouty macros here with typechecked helper functions. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_fork.h')
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h
index efee11956540..d3943d6ad0b9 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.h
+++ b/fs/xfs/libxfs/xfs_inode_fork.h
@@ -77,21 +77,8 @@ struct xfs_ifork {
/*
* Fork handling.
*/
-
-#define XFS_IFORK_BOFF(ip) ((int)((ip)->i_forkoff << 3))
-
-#define XFS_IFORK_DSIZE(ip) \
- (xfs_inode_has_attr_fork(ip) ? XFS_IFORK_BOFF(ip) : XFS_LITINO((ip)->i_mount))
-#define XFS_IFORK_ASIZE(ip) \
- (xfs_inode_has_attr_fork(ip) ? XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : 0)
-#define XFS_IFORK_SIZE(ip,w) \
- ((w) == XFS_DATA_FORK ? \
- XFS_IFORK_DSIZE(ip) : \
- ((w) == XFS_ATTR_FORK ? \
- XFS_IFORK_ASIZE(ip) : \
- 0))
#define XFS_IFORK_MAXEXT(ip, w) \
- (XFS_IFORK_SIZE(ip, w) / sizeof(xfs_bmbt_rec_t))
+ (xfs_inode_fork_size(ip, w) / sizeof(xfs_bmbt_rec_t))
static inline bool xfs_ifork_has_extents(struct xfs_ifork *ifp)
{