]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: clean up xfs_attr_node_hasname
authorDarrick J. Wong <djwong@kernel.org>
Sun, 22 May 2022 05:59:34 +0000 (15:59 +1000)
committerDave Chinner <david@fromorbit.com>
Sun, 22 May 2022 05:59:34 +0000 (15:59 +1000)
commit68fdb194c02958bb5661ac18bda512aabf082325
tree83a2dc3a763aa5e384b77c7f837e2fa6fa4cad48
parentc8934d8ff68aa480c71044c2dbca8d9629ca30ad
xfs: clean up xfs_attr_node_hasname

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>
fs/xfs/libxfs/xfs_attr.c
fs/xfs/libxfs/xfs_da_btree.c
fs/xfs/libxfs/xfs_da_btree.h