25 #include <linux/slab.h>
26 #include <linux/xattr.h>
41 struct xfs_acl_entry *ace;
52 for (i = 0; i <
count; i++) {
65 switch (acl_e->
e_tag) {
83 posix_acl_release(acl);
91 struct xfs_acl_entry *ace;
95 for (i = 0; i < acl->
a_count; i++) {
108 struct xfs_inode *
ip = XFS_I(inode);
111 int len =
sizeof(
struct xfs_acl);
112 unsigned char *ea_name;
115 acl = get_cached_acl(inode, type);
119 trace_xfs_get_acl(ip);
137 xfs_acl = kzalloc(
sizeof(
struct xfs_acl),
GFP_KERNEL);
141 error = -
xfs_attr_get(ip, ea_name, (
unsigned char *)xfs_acl,
151 goto out_update_cache;
161 set_cached_acl(inode, type, acl);
170 struct xfs_inode *
ip = XFS_I(inode);
171 unsigned char *ea_name;
194 xfs_acl = kzalloc(
sizeof(
struct xfs_acl),
GFP_KERNEL);
199 len =
sizeof(
struct xfs_acl) -
200 (sizeof(struct xfs_acl_entry) *
203 error = -
xfs_attr_set(ip, ea_name, (
unsigned char *)xfs_acl,
221 set_cached_acl(inode, type, acl);
230 if (mode != inode->
i_mode) {
244 xfs_acl_exists(
struct inode *inode,
unsigned char *
name)
273 int error = 0, inherit = 0;
293 error = xfs_set_mode(inode, mode);
301 posix_acl_release(acl);
315 if (IS_ERR(acl) || !acl)
323 posix_acl_release(acl);
328 xfs_xattr_acl_get(
struct dentry *
dentry,
const char *name,
341 posix_acl_release(acl);
347 xfs_xattr_acl_set(
struct dentry *dentry,
const char *name,
348 const void *value,
size_t size,
int flags,
int type)
350 struct inode *inode = dentry->
d_inode;
357 return value ? -
EACCES : 0;
373 error = PTR_ERR(acl);
390 posix_acl_release(acl);
397 error = xfs_set_mode(inode, mode);
405 posix_acl_release(acl);
413 .get = xfs_xattr_acl_get,
414 .set = xfs_xattr_acl_set,
420 .get = xfs_xattr_acl_get,
421 .set = xfs_xattr_acl_set,