summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_attr.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-02-27 04:30:42 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2020-03-03 07:55:55 +0300
commitd5f0f49a9bdd4206e941282dfd323c436331659b (patch)
tree8fbd423d8b336a8c2bdc417a6d67b496432a5ff9 /fs/xfs/libxfs/xfs_attr.c
parentf3e93d95feef7655a980be83a3b1830e8e1711a1 (diff)
downloadlinux-d5f0f49a9bdd4206e941282dfd323c436331659b.tar.xz
xfs: clean up the attr flag confusion
The ATTR_* flags have a long IRIX history, where they a userspace interface, the on-disk format and an internal interface. We've split out the on-disk interface to the XFS_ATTR_* values, but despite (or because?) of that the flag have still been a mess. Switch the internal interface to pass the on-disk XFS_ATTR_* flags for the namespace and the Linux XATTR_* flags for the actual flags instead. The ATTR_* values that are actually used are move to xfs_fs.h with a new XFS_IOC_* prefix to not conflict with the userspace version that has the same name and must have the same value. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Chandan Rajendra <chandanrlinux@gmail.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr.c')
-rw-r--r--fs/xfs/libxfs/xfs_attr.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 495364927ea0..dab1921dcfc6 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -295,7 +295,7 @@ xfs_attr_set(
struct xfs_inode *dp = args->dp;
struct xfs_mount *mp = dp->i_mount;
struct xfs_trans_res tres;
- int rsvd = (args->flags & ATTR_ROOT) != 0;
+ bool rsvd = (args->attr_filter & XFS_ATTR_ROOT);
int error, local;
unsigned int total;
@@ -423,10 +423,10 @@ xfs_attr_shortform_addname(xfs_da_args_t *args)
trace_xfs_attr_sf_addname(args);
retval = xfs_attr_shortform_lookup(args);
- if (retval == -ENOATTR && (args->flags & ATTR_REPLACE))
+ if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE))
return retval;
if (retval == -EEXIST) {
- if (args->flags & ATTR_CREATE)
+ if (args->attr_flags & XATTR_CREATE)
return retval;
retval = xfs_attr_shortform_remove(args);
if (retval)
@@ -436,7 +436,7 @@ xfs_attr_shortform_addname(xfs_da_args_t *args)
* that the leaf format add routine won't trip over the attr
* not being around.
*/
- args->flags &= ~ATTR_REPLACE;
+ args->attr_flags &= ~XATTR_REPLACE;
}
if (args->namelen >= XFS_ATTR_SF_ENTSIZE_MAX ||
@@ -489,10 +489,10 @@ xfs_attr_leaf_addname(
* the given flags produce an error or call for an atomic rename.
*/
retval = xfs_attr3_leaf_lookup_int(bp, args);
- if (retval == -ENOATTR && (args->flags & ATTR_REPLACE))
+ if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE))
goto out_brelse;
if (retval == -EEXIST) {
- if (args->flags & ATTR_CREATE) /* pure create op */
+ if (args->attr_flags & XATTR_CREATE)
goto out_brelse;
trace_xfs_attr_leaf_replace(args);
@@ -763,10 +763,10 @@ restart:
goto out;
blk = &state->path.blk[ state->path.active-1 ];
ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC);
- if (retval == -ENOATTR && (args->flags & ATTR_REPLACE))
+ if (retval == -ENOATTR && (args->attr_flags & XATTR_REPLACE))
goto out;
if (retval == -EEXIST) {
- if (args->flags & ATTR_CREATE)
+ if (args->attr_flags & XATTR_CREATE)
goto out;
trace_xfs_attr_node_replace(args);