summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_xattr.c')
-rw-r--r--fs/xfs/xfs_xattr.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index 1670bfbc9ad2..bd770094b95a 100644
--- a/fs/xfs/xfs_xattr.c
+++ b/fs/xfs/xfs_xattr.c
@@ -12,6 +12,8 @@
#include "xfs_inode.h"
#include "xfs_attr.h"
#include "xfs_acl.h"
+#include "xfs_da_format.h"
+#include "xfs_da_btree.h"
#include <linux/posix_acl_xattr.h>
#include <linux/xattr.h>
@@ -66,20 +68,25 @@ xfs_xattr_set(const struct xattr_handler *handler, struct dentry *unused,
struct inode *inode, const char *name, const void *value,
size_t size, int flags)
{
- int xflags = handler->flags;
- struct xfs_inode *ip = XFS_I(inode);
+ struct xfs_da_args args = {
+ .dp = XFS_I(inode),
+ .flags = handler->flags,
+ .name = name,
+ .namelen = strlen(name),
+ .value = (void *)value,
+ .valuelen = size,
+ };
int error;
/* Convert Linux syscall to XFS internal ATTR flags */
if (flags & XATTR_CREATE)
- xflags |= ATTR_CREATE;
+ args.flags |= ATTR_CREATE;
if (flags & XATTR_REPLACE)
- xflags |= ATTR_REPLACE;
+ args.flags |= ATTR_REPLACE;
- error = xfs_attr_set(ip, (unsigned char *)name, strlen(name),
- (void *)value, size, xflags);
+ error = xfs_attr_set(&args);
if (!error)
- xfs_forget_acl(inode, name, xflags);
+ xfs_forget_acl(inode, name, args.flags);
return error;
}