]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: clean up xfs_attr_node_hasname
authorDarrick J. Wong <djwong@kernel.org>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
commitecc6ab2b2d9016e532b5204728a344a4dd4a2a5b
treeb370deb1778b2d0becf4d9ed14beb473a6251833
parent40c3c9f0384ed3d96d2a349937b124b9f0257cde
xfs: clean up xfs_attr_node_hasname

Source kernel commit: 4d0cdd2bb8f0bf1a30d361f14bafc428794551e0

The calling conventions of this function are a mess -- callers /can/
provide a pointer to a pointer to a state structure, but it's not
required, and as evidenced by the last two patches, the callers that do
weren't be careful enough about how to deal with an existing da state.

Push the allocation and freeing responsibilty to the callers, which
means that callers from the xattr node state machine steps now have the
visibility to allocate or free the da state structure as they please.
As a bonus, the node remove/add paths for larp-mode replaces can reset
the da state structure instead of freeing and immediately reallocating
it.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_attr.c
libxfs/xfs_da_btree.c
libxfs/xfs_da_btree.h