summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_acl.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-02-26 17:30:35 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2020-03-02 20:55:53 -0800
commitd49db18b247d8e7e16f2178cd713f4621d1d7ade (patch)
tree98a42ea01c2ce331e14963ee257c7a6787195c78 /fs/xfs/xfs_acl.c
parente513e25c380ab98d401714077c8b8ff4dae9f98b (diff)
xfs: remove ATTR_ALLOC and XFS_DA_OP_ALLOCVAL
Use a NULL args->value as the indicator to lazily allocate a buffer instead, and let the caller always free args->value instead of duplicating the cleanup. 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/xfs_acl.c')
-rw-r--r--fs/xfs/xfs_acl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 512e29540902..52b992941f89 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -131,7 +131,7 @@ xfs_get_acl(struct inode *inode, int type)
struct posix_acl *acl = NULL;
struct xfs_da_args args = {
.dp = ip,
- .flags = ATTR_ALLOC | ATTR_ROOT,
+ .flags = ATTR_ROOT,
.valuelen = XFS_ACL_MAX_SIZE(mp),
};
int error;
@@ -150,19 +150,19 @@ xfs_get_acl(struct inode *inode, int type)
}
args.namelen = strlen(args.name);
+ /*
+ * If the attribute doesn't exist make sure we have a negative cache
+ * entry, for any other error assume it is transient.
+ */
error = xfs_attr_get(&args);
- if (error) {
- /*
- * If the attribute doesn't exist make sure we have a negative
- * cache entry, for any other error assume it is transient.
- */
- if (error != -ENOATTR)
- acl = ERR_PTR(error);
- } else {
+ if (!error) {
acl = xfs_acl_from_disk(mp, args.value, args.valuelen,
XFS_ACL_MAX_ENTRIES(mp));
- kmem_free(args.value);
+ } else if (error != -ENOATTR) {
+ acl = ERR_PTR(error);
}
+
+ kmem_free(args.value);
return acl;
}