aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_ioctl.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2024-04-22 09:47:21 -0700
committerDarrick J. Wong <djwong@kernel.org>2024-04-23 07:46:50 -0700
commit54275d8496f3e4764302cebc0e9517d950ba6589 (patch)
treeddea806b9910875a1b3357788a1398d2adf2c7cf /fs/xfs/xfs_ioctl.c
parent779a4b606c7678343e3603398fe07de38b817ef4 (diff)
xfs: remove xfs_da_args.attr_flags
This field only ever contains XATTR_{CREATE,REPLACE}, and it only goes as deep as xfs_attr_set. Remove the field from the structure and replace it with an enum specifying exactly what kind of change we want to make to the xattr structure. Upsert is the name that we'll give to the flags==0 operation, because we're either updating an existing value or inserting it, and the caller doesn't care. Note: The "UPSERTR" name created here is to make userspace porting easier. It will be removed in the next patch. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r--fs/xfs/xfs_ioctl.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index efa95892655d..0eca7a9096e2 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -361,15 +361,15 @@ xfs_attr_filter(
return 0;
}
-static unsigned int
-xfs_attr_flags(
+static inline enum xfs_attr_update
+xfs_xattr_flags(
u32 ioc_flags)
{
if (ioc_flags & XFS_IOC_ATTR_CREATE)
- return XATTR_CREATE;
+ return XFS_ATTRUPDATE_CREATE;
if (ioc_flags & XFS_IOC_ATTR_REPLACE)
- return XATTR_REPLACE;
- return 0;
+ return XFS_ATTRUPDATE_REPLACE;
+ return XFS_ATTRUPDATE_UPSERTR;
}
int
@@ -476,7 +476,6 @@ xfs_attrmulti_attr_get(
struct xfs_da_args args = {
.dp = XFS_I(inode),
.attr_filter = xfs_attr_filter(flags),
- .attr_flags = xfs_attr_flags(flags),
.name = name,
.namelen = strlen(name),
.valuelen = *len,
@@ -510,7 +509,6 @@ xfs_attrmulti_attr_set(
struct xfs_da_args args = {
.dp = XFS_I(inode),
.attr_filter = xfs_attr_filter(flags),
- .attr_flags = xfs_attr_flags(flags),
.name = name,
.namelen = strlen(name),
};
@@ -528,7 +526,7 @@ xfs_attrmulti_attr_set(
args.valuelen = len;
}
- error = xfs_attr_change(&args);
+ error = xfs_attr_change(&args, xfs_xattr_flags(flags));
if (!error && (flags & XFS_IOC_ATTR_ROOT))
xfs_forget_acl(inode, name);
kfree(args.value);