aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_attr.h
diff options
context:
space:
mode:
authorGravatar Dave Chinner <dchinner@redhat.com> 2022-05-12 15:12:54 +1000
committerGravatar Dave Chinner <david@fromorbit.com> 2022-05-12 15:12:54 +1000
commit251b29c88eb84922e916ed4685f50db741aeb0af (patch)
tree6cc67e576b264c4a2c4e870bd323d2856b6eeb99 /fs/xfs/libxfs/xfs_attr.h
parentxfs: kill XFS_DAC_LEAF_ADDNAME_INIT (diff)
downloadlinux-251b29c88eb84922e916ed4685f50db741aeb0af.tar.gz
linux-251b29c88eb84922e916ed4685f50db741aeb0af.tar.bz2
linux-251b29c88eb84922e916ed4685f50db741aeb0af.zip
xfs: consolidate leaf/node states in xfs_attr_set_iter
The operations performed from XFS_DAS_FOUND_LBLK through to XFS_DAS_RM_LBLK are now identical to XFS_DAS_FOUND_NBLK through to XFS_DAS_RM_NBLK. We can collapse these down into a single set of code. To do this, define the states that leaf and node run through as separate sets of sequential states. Then as we move to the next state, we can use increments rather than specific state assignments to move through the states. This means the state progression is set by the initial state that enters the series and we don't need to duplicate the code anymore. At the exit point of the series we need to select the correct leaf or node state, but that can also be done by state increment rather than assignment. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Allison Henderson<allison.henderson@oracle.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr.h')
-rw-r--r--fs/xfs/libxfs/xfs_attr.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.h b/fs/xfs/libxfs/xfs_attr.h
index cdfc5a9b4495..908a13d61716 100644
--- a/fs/xfs/libxfs/xfs_attr.h
+++ b/fs/xfs/libxfs/xfs_attr.h
@@ -450,16 +450,21 @@ enum xfs_delattr_state {
XFS_DAS_RMTBLK, /* Removing remote blks */
XFS_DAS_RM_NAME, /* Remove attr name */
XFS_DAS_RM_SHRINK, /* We are shrinking the tree */
+
+ /* Leaf state set sequence */
XFS_DAS_FOUND_LBLK, /* We found leaf blk for attr */
XFS_DAS_LEAF_ALLOC_RMT, /* We are allocating remote blocks */
- XFS_DAS_FOUND_NBLK, /* We found node blk for attr */
- XFS_DAS_NODE_ALLOC_RMT, /* We are allocating remote blocks */
XFS_DAS_FLIP_LFLAG, /* Flipped leaf INCOMPLETE attr flag */
XFS_DAS_RM_LBLK, /* A rename is removing leaf blocks */
XFS_DAS_RD_LEAF, /* Read in the new leaf */
+
+ /* Node state set sequence, must match leaf state above */
+ XFS_DAS_FOUND_NBLK, /* We found node blk for attr */
+ XFS_DAS_NODE_ALLOC_RMT, /* We are allocating remote blocks */
XFS_DAS_FLIP_NFLAG, /* Flipped node INCOMPLETE attr flag */
XFS_DAS_RM_NBLK, /* A rename is removing node blocks */
XFS_DAS_CLR_FLAG, /* Clear incomplete flag */
+
XFS_DAS_DONE, /* finished operation */
};