]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: use XFS_IFORK_Q to determine the presence of an xattr fork
authorDarrick J. Wong <djwong@kernel.org>
Wed, 24 Aug 2022 12:27:38 +0000 (14:27 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 30 Aug 2022 08:24:07 +0000 (10:24 +0200)
commitd4292c66974521a5af81ac7967fae617cab322f4
treed4a1284ea422f9d649451a9ed59f1622003a2e70
parent7ff5f1edf91581b77d043d12283d2e460861bedb
xfs: use XFS_IFORK_Q to determine the presence of an xattr fork

Source kernel commit: e45d7cb2356e6b59fe64da28324025cc6fcd3fbd

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>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
include/xfs_inode.h
libxfs/rdwr.c
libxfs/util.c
libxfs/xfs_attr.c
libxfs/xfs_attr.h
libxfs/xfs_bmap.c
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_fork.c
libxfs/xfs_inode_fork.h
repair/phase6.c