diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-07-09 10:56:06 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2022-07-09 15:17:21 -0700 |
commit | e45d7cb2356e6b59fe64da28324025cc6fcd3fbd (patch) | |
tree | 19d84f0fc674b316e04ed33854262623c42fa4cc /fs/xfs/libxfs/xfs_attr.h | |
parent | 2ed5b09b3e8fc274ae8fecd6ab7c5106a364bed1 (diff) |
xfs: use XFS_IFORK_Q to determine the presence of an xattr fork
Modify xfs_ifork_ptr to return a NULL pointer if the caller asks for the
attribute fork but i_forkoff is zero. This eliminates the ambiguity
between i_forkoff and i_af.if_present, which should make it easier to
understand the lifetime of attr forks.
While we're at it, remove the if_present checks around calls to
xfs_idestroy_fork and xfs_ifork_zap_attr since they can both handle attr
forks that have already been torn down.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_attr.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.h b/fs/xfs/libxfs/xfs_attr.h index 0f100db504ee..36371c3b9069 100644 --- a/fs/xfs/libxfs/xfs_attr.h +++ b/fs/xfs/libxfs/xfs_attr.h @@ -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 (!args->dp->i_af.if_present) + if (!XFS_IFORK_Q(args->dp)) return XFS_DAS_DONE; args->op_flags |= XFS_DA_OP_ADDNAME; |