diff options
author | Dave Chinner <dchinner@redhat.com> | 2022-05-12 15:12:56 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2022-05-12 15:12:56 +1000 |
commit | 4b9879b19cafa63ae02fef30f678b2179a648d45 (patch) | |
tree | 6b145ce957f0eff7a4efb754efe14b043f7d0e92 /fs/xfs/libxfs/xfs_attr.h | |
parent | xfs: introduce attr remove initial states into xfs_attr_set_iter (diff) | |
download | linux-4b9879b19cafa63ae02fef30f678b2179a648d45.tar.gz linux-4b9879b19cafa63ae02fef30f678b2179a648d45.tar.bz2 linux-4b9879b19cafa63ae02fef30f678b2179a648d45.zip |
xfs: switch attr remove to xfs_attri_set_iter
Now that xfs_attri_set_iter() has initial states for removing
attributes, switch the pure attribute removal code over to using it.
This requires attrs being removed to always be marked as INCOMPLETE
before we start the removal due to the fact we look up the attr to
remove again in xfs_attr_node_remove_attr().
Note: this drops the fillstate/refillstate optimisations from
the remove path that avoid having to look up the path again after
setting the incomplete flag and removing remote attrs. Restoring
that optimisation to this path is future Dave's problem.
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.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.h b/fs/xfs/libxfs/xfs_attr.h index 988c2451683a..41d70ad62cbf 100644 --- a/fs/xfs/libxfs/xfs_attr.h +++ b/fs/xfs/libxfs/xfs_attr.h @@ -603,6 +603,16 @@ xfs_attr_init_add_state(struct xfs_da_args *args) } static inline enum xfs_delattr_state +xfs_attr_init_remove_state(struct xfs_da_args *args) +{ + if (xfs_attr_is_shortform(args->dp)) + return XFS_DAS_SF_REMOVE; + if (xfs_attr_is_leaf(args->dp)) + return XFS_DAS_LEAF_REMOVE; + return XFS_DAS_NODE_REMOVE; +} + +static inline enum xfs_delattr_state xfs_attr_init_replace_state(struct xfs_da_args *args) { return xfs_attr_init_add_state(args); |