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

xfs: replace XFS_IFORK_Q with a proper predicate function



Replace this shouty macro with a real C function that has a more
descriptive name.

Signed-off-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent e45d7cb2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ int
xfs_inode_hasattr(
	struct xfs_inode	*ip)
{
	if (!XFS_IFORK_Q(ip))
	if (!xfs_inode_has_attr_fork(ip))
		return 0;
	if (ip->i_af.if_format == XFS_DINODE_FMT_EXTENTS &&
	    ip->i_af.if_nextents == 0)
@@ -999,7 +999,7 @@ xfs_attr_set(
		 * If the inode doesn't have an attribute fork, add one.
		 * (inode must not be locked when we call this routine)
		 */
		if (XFS_IFORK_Q(dp) == 0) {
		if (xfs_inode_has_attr_fork(dp) == 0) {
			int sf_size = sizeof(struct xfs_attr_sf_hdr) +
				xfs_attr_sf_entsize_byname(args->namelen,
						args->valuelen);
+1 −1
Original line number Diff line number Diff line
@@ -576,7 +576,7 @@ xfs_attr_init_add_state(struct xfs_da_args *args)
	 * context, i_af is guaranteed to exist. Hence if the attr fork is
	 * null, we were called from a pure remove operation and so we are done.
	 */
	if (!XFS_IFORK_Q(args->dp))
	if (!xfs_inode_has_attr_fork(args->dp))
		return XFS_DAS_DONE;

	args->op_flags |= XFS_DA_OP_ADDNAME;
+2 −2
Original line number Diff line number Diff line
@@ -1023,7 +1023,7 @@ xfs_bmap_add_attrfork(
	int			logflags;	/* logging flags */
	int			error;		/* error return value */

	ASSERT(XFS_IFORK_Q(ip) == 0);
	ASSERT(xfs_inode_has_attr_fork(ip) == 0);

	mp = ip->i_mount;
	ASSERT(!XFS_NOT_DQATTACHED(mp, ip));
@@ -1034,7 +1034,7 @@ xfs_bmap_add_attrfork(
			rsvd, &tp);
	if (error)
		return error;
	if (XFS_IFORK_Q(ip))
	if (xfs_inode_has_attr_fork(ip))
		goto trans_cancel;

	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
+1 −1
Original line number Diff line number Diff line
@@ -717,7 +717,7 @@ xfs_ifork_verify_local_attr(
	struct xfs_ifork	*ifp = &ip->i_af;
	xfs_failaddr_t		fa;

	if (!XFS_IFORK_Q(ip))
	if (!xfs_inode_has_attr_fork(ip))
		fa = __this_address;
	else
		fa = xfs_attr_shortform_verify(ip);
+2 −3
Original line number Diff line number Diff line
@@ -78,13 +78,12 @@ struct xfs_ifork {
 * Fork handling.
 */

#define XFS_IFORK_Q(ip)			((ip)->i_forkoff != 0)
#define XFS_IFORK_BOFF(ip)		((int)((ip)->i_forkoff << 3))

#define XFS_IFORK_DSIZE(ip) \
	(XFS_IFORK_Q(ip) ? XFS_IFORK_BOFF(ip) : XFS_LITINO((ip)->i_mount))
	(xfs_inode_has_attr_fork(ip) ? XFS_IFORK_BOFF(ip) : XFS_LITINO((ip)->i_mount))
#define XFS_IFORK_ASIZE(ip) \
	(XFS_IFORK_Q(ip) ? XFS_LITINO((ip)->i_mount) - XFS_IFORK_BOFF(ip) : 0)
	(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) : \
Loading