diff options
author | Dave Chinner <dchinner@redhat.com> | 2022-05-11 10:05:23 +0300 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2022-05-11 10:05:23 +0300 |
commit | 709c8632597c3276cd21324b0256628f1a7fd4df (patch) | |
tree | bec82810123cce8daa5553d12e95d29079ad2580 /fs/xfs/xfs_attr_item.c | |
parent | e22b88de5bacdd60ffa70e911e5fbae9ad36441a (diff) | |
download | linux-709c8632597c3276cd21324b0256628f1a7fd4df.tar.xz |
xfs: rework deferred attribute operation setup
Logged attribute intents only have set and remove types - there is
no separate intent type for a replace operation. We should have a
separate type for a replace operation, as it needs to perform
operations that neither SET or REMOVE can perform.
Add this type to the intent items and rearrange the deferred
operation setup to reflect the different operations we are
performing.
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/xfs_attr_item.c')
-rw-r--r-- | fs/xfs/xfs_attr_item.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c index 96933a3c0dcd..ee8b140a2801 100644 --- a/fs/xfs/xfs_attr_item.c +++ b/fs/xfs/xfs_attr_item.c @@ -318,6 +318,7 @@ xfs_xattri_finish_update( switch (op) { case XFS_ATTR_OP_FLAGS_SET: + case XFS_ATTR_OP_FLAGS_REPLACE: error = xfs_attr_set_iter(attr); break; case XFS_ATTR_OP_FLAGS_REMOVE: @@ -507,8 +508,14 @@ xfs_attri_validate( return false; /* alfi_op_flags should be either a set or remove */ - if (op != XFS_ATTR_OP_FLAGS_SET && op != XFS_ATTR_OP_FLAGS_REMOVE) + switch (op) { + case XFS_ATTR_OP_FLAGS_SET: + case XFS_ATTR_OP_FLAGS_REPLACE: + case XFS_ATTR_OP_FLAGS_REMOVE: + break; + default: return false; + } if (attrp->alfi_value_len > XATTR_SIZE_MAX) return false; |