Commit c01147d9 authored by Darrick J. Wong's avatar Darrick J. Wong
Browse files

xfs: replace inode fork size macros with functions



Replace the shouty macros here with typechecked helper functions.

Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 932b42c6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -590,7 +590,7 @@ xfs_attr_shortform_bytesfit(
	 * to real extents, or the delalloc conversion will take care of the
	 * literal area rebalancing.
	 */
	if (bytes <= XFS_IFORK_ASIZE(dp))
	if (bytes <= xfs_inode_attr_fork_size(dp))
		return dp->i_forkoff;

	/*
+3 −3
Original line number Diff line number Diff line
@@ -880,7 +880,7 @@ xfs_bmap_add_attrfork_btree(

	mp = ip->i_mount;

	if (XFS_BMAP_BMDR_SPACE(block) <= XFS_IFORK_DSIZE(ip))
	if (XFS_BMAP_BMDR_SPACE(block) <= xfs_inode_data_fork_size(ip))
		*flags |= XFS_ILOG_DBROOT;
	else {
		cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK);
@@ -920,7 +920,7 @@ xfs_bmap_add_attrfork_extents(
	int			error;		/* error return value */

	if (ip->i_df.if_nextents * sizeof(struct xfs_bmbt_rec) <=
	    XFS_IFORK_DSIZE(ip))
	    xfs_inode_data_fork_size(ip))
		return 0;
	cur = NULL;
	error = xfs_bmap_extents_to_btree(tp, ip, &cur, 0, flags,
@@ -951,7 +951,7 @@ xfs_bmap_add_attrfork_local(
{
	struct xfs_da_args	dargs;		/* args for dir/attr code */

	if (ip->i_df.if_bytes <= XFS_IFORK_DSIZE(ip))
	if (ip->i_df.if_bytes <= xfs_inode_data_fork_size(ip))
		return 0;

	if (S_ISDIR(VFS_I(ip)->i_mode)) {
+1 −1
Original line number Diff line number Diff line
@@ -564,7 +564,7 @@ xfs_bmbt_init_cursor(
	if (xfs_has_crc(mp))
		cur->bc_flags |= XFS_BTREE_CRC_BLOCKS;

	cur->bc_ino.forksize = XFS_IFORK_SIZE(ip, whichfork);
	cur->bc_ino.forksize = xfs_inode_fork_size(ip, whichfork);
	cur->bc_ino.ip = ip;
	cur->bc_ino.allocated = 0;
	cur->bc_ino.flags = 0;
+1 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ xfs_dir_isempty(
	ASSERT(S_ISDIR(VFS_I(dp)->i_mode));
	if (dp->i_disk_size == 0)	/* might happen during shutdown. */
		return 1;
	if (dp->i_disk_size > XFS_IFORK_DSIZE(dp))
	if (dp->i_disk_size > xfs_inode_data_fork_size(dp))
		return 0;
	sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data;
	return !sfp->count;
+2 −2
Original line number Diff line number Diff line
@@ -842,7 +842,7 @@ xfs_dir2_block_removename(
	 * See if the size as a shortform is good enough.
	 */
	size = xfs_dir2_block_sfsize(dp, hdr, &sfh);
	if (size > XFS_IFORK_DSIZE(dp))
	if (size > xfs_inode_data_fork_size(dp))
		return 0;

	/*
@@ -1055,7 +1055,7 @@ xfs_dir2_leaf_to_block(
	 * Now see if the resulting block can be shrunken to shortform.
	 */
	size = xfs_dir2_block_sfsize(dp, hdr, &sfh);
	if (size > XFS_IFORK_DSIZE(dp))
	if (size > xfs_inode_data_fork_size(dp))
		return 0;

	return xfs_dir2_block_to_sf(args, dbp, size, &sfh);
Loading