Lines Matching refs:acl
40 struct posix_acl *acl; in xfs_acl_from_disk() local
48 acl = posix_acl_alloc(count, GFP_KERNEL); in xfs_acl_from_disk()
49 if (!acl) in xfs_acl_from_disk()
53 acl_e = &acl->a_entries[i]; in xfs_acl_from_disk()
80 return acl; in xfs_acl_from_disk()
83 posix_acl_release(acl); in xfs_acl_from_disk()
88 xfs_acl_to_disk(struct xfs_acl *aclp, const struct posix_acl *acl) in xfs_acl_to_disk() argument
94 aclp->acl_cnt = cpu_to_be32(acl->a_count); in xfs_acl_to_disk()
95 for (i = 0; i < acl->a_count; i++) { in xfs_acl_to_disk()
97 acl_e = &acl->a_entries[i]; in xfs_acl_to_disk()
109 struct posix_acl *acl; in xfs_get_acl() local
115 acl = get_cached_acl(inode, type); in xfs_get_acl()
116 if (acl != ACL_NOT_CACHED) in xfs_get_acl()
117 return acl; in xfs_get_acl()
150 acl = NULL; in xfs_get_acl()
156 acl = xfs_acl_from_disk(xfs_acl); in xfs_get_acl()
157 if (IS_ERR(acl)) in xfs_get_acl()
161 set_cached_acl(inode, type, acl); in xfs_get_acl()
164 return acl; in xfs_get_acl()
168 xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) in xfs_set_acl() argument
183 return acl ? -EACCES : 0; in xfs_set_acl()
190 if (acl) { in xfs_set_acl()
198 xfs_acl_to_disk(xfs_acl, acl); in xfs_set_acl()
201 (XFS_ACL_MAX_ENTRIES - acl->a_count)); in xfs_set_acl()
221 set_cached_acl(inode, type, acl); in xfs_set_acl()
270 xfs_inherit_acl(struct inode *inode, struct posix_acl *acl) in xfs_inherit_acl() argument
276 error = xfs_set_acl(inode, ACL_TYPE_DEFAULT, acl); in xfs_inherit_acl()
281 error = posix_acl_create(&acl, GFP_KERNEL, &mode); in xfs_inherit_acl()
298 error = xfs_set_acl(inode, ACL_TYPE_ACCESS, acl); in xfs_inherit_acl()
301 posix_acl_release(acl); in xfs_inherit_acl()
308 struct posix_acl *acl; in xfs_acl_chmod() local
314 acl = xfs_get_acl(inode, ACL_TYPE_ACCESS); in xfs_acl_chmod()
315 if (IS_ERR(acl) || !acl) in xfs_acl_chmod()
316 return PTR_ERR(acl); in xfs_acl_chmod()
318 error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); in xfs_acl_chmod()
322 error = xfs_set_acl(inode, ACL_TYPE_ACCESS, acl); in xfs_acl_chmod()
323 posix_acl_release(acl); in xfs_acl_chmod()
331 struct posix_acl *acl; in xfs_xattr_acl_get() local
334 acl = xfs_get_acl(dentry->d_inode, type); in xfs_xattr_acl_get()
335 if (IS_ERR(acl)) in xfs_xattr_acl_get()
336 return PTR_ERR(acl); in xfs_xattr_acl_get()
337 if (acl == NULL) in xfs_xattr_acl_get()
340 error = posix_acl_to_xattr(acl, value, size); in xfs_xattr_acl_get()
341 posix_acl_release(acl); in xfs_xattr_acl_get()
351 struct posix_acl *acl = NULL; in xfs_xattr_acl_set() local
364 acl = posix_acl_from_xattr(value, size); in xfs_xattr_acl_set()
365 if (!acl) { in xfs_xattr_acl_set()
372 if (IS_ERR(acl)) { in xfs_xattr_acl_set()
373 error = PTR_ERR(acl); in xfs_xattr_acl_set()
377 error = posix_acl_valid(acl); in xfs_xattr_acl_set()
382 if (acl->a_count > XFS_ACL_MAX_ENTRIES) in xfs_xattr_acl_set()
387 error = posix_acl_equiv_mode(acl, &mode); in xfs_xattr_acl_set()
390 posix_acl_release(acl); in xfs_xattr_acl_set()
391 acl = NULL; in xfs_xattr_acl_set()
403 error = xfs_set_acl(inode, type, acl); in xfs_xattr_acl_set()
405 posix_acl_release(acl); in xfs_xattr_acl_set()