Lines Matching refs:acl

50 	struct posix_acl *acl;  in get_cached_acl()  local
54 acl = rcu_dereference(*p); in get_cached_acl()
55 if (!acl || is_uncached_acl(acl) || in get_cached_acl()
56 refcount_inc_not_zero(&acl->a_refcount)) in get_cached_acl()
62 return acl; in get_cached_acl()
68 struct posix_acl *acl = rcu_dereference(*acl_by_type(inode, type)); in get_cached_acl_rcu() local
70 if (acl == ACL_DONT_CACHE) { in get_cached_acl_rcu()
75 acl = ret; in get_cached_acl_rcu()
78 return acl; in get_cached_acl_rcu()
82 void set_cached_acl(struct inode *inode, int type, struct posix_acl *acl) in set_cached_acl() argument
87 old = xchg(p, posix_acl_dup(acl)); in set_cached_acl()
121 struct posix_acl *acl; in __get_acl() local
129 acl = get_cached_acl(inode, type); in __get_acl()
130 if (!is_uncached_acl(acl)) in __get_acl()
131 return acl; in __get_acl()
158 acl = inode->i_op->get_acl(idmap, dentry, type); in __get_acl()
160 acl = inode->i_op->get_inode_acl(inode, type, false); in __get_acl()
165 if (IS_ERR(acl)) { in __get_acl()
171 return acl; in __get_acl()
177 posix_acl_dup(acl); in __get_acl()
178 if (unlikely(!try_cmpxchg(p, &sentinel, acl))) in __get_acl()
179 posix_acl_release(acl); in __get_acl()
180 return acl; in __get_acl()
193 posix_acl_init(struct posix_acl *acl, int count) in posix_acl_init() argument
195 refcount_set(&acl->a_refcount, 1); in posix_acl_init()
196 acl->a_count = count; in posix_acl_init()
208 struct posix_acl *acl = kmalloc(size, flags); in posix_acl_alloc() local
209 if (acl) in posix_acl_alloc()
210 posix_acl_init(acl, count); in posix_acl_alloc()
211 return acl; in posix_acl_alloc()
219 posix_acl_clone(const struct posix_acl *acl, gfp_t flags) in posix_acl_clone() argument
223 if (acl) { in posix_acl_clone()
224 int size = sizeof(struct posix_acl) + acl->a_count * in posix_acl_clone()
226 clone = kmemdup(acl, size, flags); in posix_acl_clone()
238 posix_acl_valid(struct user_namespace *user_ns, const struct posix_acl *acl) in posix_acl_valid() argument
244 FOREACH_ACL_ENTRY(pa, acl, pe) { in posix_acl_valid()
307 posix_acl_equiv_mode(const struct posix_acl *acl, umode_t *mode_p) in posix_acl_equiv_mode() argument
316 if (!acl) in posix_acl_equiv_mode()
319 FOREACH_ACL_ENTRY(pa, acl, pe) { in posix_acl_equiv_mode()
355 struct posix_acl *acl = posix_acl_alloc(3, flags); in posix_acl_from_mode() local
356 if (!acl) in posix_acl_from_mode()
359 acl->a_entries[0].e_tag = ACL_USER_OBJ; in posix_acl_from_mode()
360 acl->a_entries[0].e_perm = (mode & S_IRWXU) >> 6; in posix_acl_from_mode()
362 acl->a_entries[1].e_tag = ACL_GROUP_OBJ; in posix_acl_from_mode()
363 acl->a_entries[1].e_perm = (mode & S_IRWXG) >> 3; in posix_acl_from_mode()
365 acl->a_entries[2].e_tag = ACL_OTHER; in posix_acl_from_mode()
366 acl->a_entries[2].e_perm = (mode & S_IRWXO); in posix_acl_from_mode()
367 return acl; in posix_acl_from_mode()
377 const struct posix_acl *acl, int want) in posix_acl_permission() argument
387 FOREACH_ACL_ENTRY(pa, acl, pe) { in posix_acl_permission()
454 static int posix_acl_create_masq(struct posix_acl *acl, umode_t *mode_p) in posix_acl_create_masq() argument
463 FOREACH_ACL_ENTRY(pa, acl, pe) { in posix_acl_create_masq()
511 static int __posix_acl_chmod_masq(struct posix_acl *acl, umode_t mode) in __posix_acl_chmod_masq() argument
518 FOREACH_ACL_ENTRY(pa, acl, pe) { in __posix_acl_chmod_masq()
557 __posix_acl_create(struct posix_acl **acl, gfp_t gfp, umode_t *mode_p) in __posix_acl_create() argument
559 struct posix_acl *clone = posix_acl_clone(*acl, gfp); in __posix_acl_create()
568 posix_acl_release(*acl); in __posix_acl_create()
569 *acl = clone; in __posix_acl_create()
575 __posix_acl_chmod(struct posix_acl **acl, gfp_t gfp, umode_t mode) in __posix_acl_chmod() argument
577 struct posix_acl *clone = posix_acl_clone(*acl, gfp); in __posix_acl_chmod()
586 posix_acl_release(*acl); in __posix_acl_chmod()
587 *acl = clone; in __posix_acl_chmod()
610 struct posix_acl *acl; in posix_acl_chmod() local
618 acl = get_inode_acl(inode, ACL_TYPE_ACCESS); in posix_acl_chmod()
619 if (IS_ERR_OR_NULL(acl)) { in posix_acl_chmod()
620 if (acl == ERR_PTR(-EOPNOTSUPP)) in posix_acl_chmod()
622 return PTR_ERR(acl); in posix_acl_chmod()
625 ret = __posix_acl_chmod(&acl, GFP_KERNEL, mode); in posix_acl_chmod()
628 ret = inode->i_op->set_acl(idmap, dentry, acl, ACL_TYPE_ACCESS); in posix_acl_chmod()
629 posix_acl_release(acl); in posix_acl_chmod()
636 struct posix_acl **default_acl, struct posix_acl **acl) in posix_acl_create() argument
642 *acl = NULL; in posix_acl_create()
668 *acl = clone; in posix_acl_create()
709 struct posix_acl **acl) in posix_acl_update_mode() argument
714 error = posix_acl_equiv_mode(*acl, &mode); in posix_acl_update_mode()
718 *acl = NULL; in posix_acl_update_mode()
781 struct posix_acl *acl; in posix_acl_from_xattr() local
790 acl = posix_acl_alloc(count, GFP_NOFS); in posix_acl_from_xattr()
791 if (!acl) in posix_acl_from_xattr()
793 acl_e = acl->a_entries; in posix_acl_from_xattr()
823 return acl; in posix_acl_from_xattr()
826 posix_acl_release(acl); in posix_acl_from_xattr()
835 posix_acl_to_xattr(struct user_namespace *user_ns, const struct posix_acl *acl, in posix_acl_to_xattr() argument
842 real_size = posix_acl_xattr_size(acl->a_count); in posix_acl_to_xattr()
851 for (n=0; n < acl->a_count; n++, ext_entry++) { in posix_acl_to_xattr()
852 const struct posix_acl_entry *acl_e = &acl->a_entries[n]; in posix_acl_to_xattr()
890 const struct posix_acl *acl, void *buffer, in vfs_posix_acl_to_xattr() argument
901 real_size = posix_acl_xattr_size(acl->a_count); in vfs_posix_acl_to_xattr()
912 for (n=0; n < acl->a_count; n++, ext_entry++) { in vfs_posix_acl_to_xattr()
913 const struct posix_acl_entry *acl_e = &acl->a_entries[n]; in vfs_posix_acl_to_xattr()
937 int type, struct posix_acl *acl) in set_posix_acl() argument
947 return acl ? -EACCES : 0; in set_posix_acl()
951 if (acl) { in set_posix_acl()
952 int ret = posix_acl_valid(inode->i_sb->s_user_ns, acl); in set_posix_acl()
956 return inode->i_op->set_acl(idmap, dentry, acl, type); in set_posix_acl()
981 struct posix_acl *acl, int type) in simple_set_acl() argument
988 &inode->i_mode, &acl); in simple_set_acl()
996 set_cached_acl(inode, type, acl); in simple_set_acl()
1002 struct posix_acl *default_acl, *acl; in simple_acl_create() local
1005 error = posix_acl_create(dir, &inode->i_mode, &default_acl, &acl); in simple_acl_create()
1010 set_cached_acl(inode, ACL_TYPE_ACCESS, acl); in simple_acl_create()
1014 if (acl) in simple_acl_create()
1015 posix_acl_release(acl); in simple_acl_create()
1021 struct posix_acl *acl) in vfs_set_acl_idmapped_mnt() argument
1023 for (int n = 0; n < acl->a_count; n++) { in vfs_set_acl_idmapped_mnt()
1024 struct posix_acl_entry *acl_e = &acl->a_entries[n]; in vfs_set_acl_idmapped_mnt()
1136 struct posix_acl *acl; in vfs_get_acl() local
1156 acl = __get_acl(idmap, dentry, inode, acl_type); in vfs_get_acl()
1157 if (IS_ERR(acl)) in vfs_get_acl()
1158 return acl; in vfs_get_acl()
1159 if (!acl) in vfs_get_acl()
1162 return acl; in vfs_get_acl()
1235 struct posix_acl *acl = NULL; in do_set_acl() local
1242 acl = posix_acl_from_xattr(current_user_ns(), kvalue, size); in do_set_acl()
1243 if (IS_ERR(acl)) in do_set_acl()
1244 return PTR_ERR(acl); in do_set_acl()
1247 error = vfs_set_acl(idmap, dentry, acl_name, acl); in do_set_acl()
1248 posix_acl_release(acl); in do_set_acl()
1256 struct posix_acl *acl; in do_get_acl() local
1258 acl = vfs_get_acl(idmap, dentry, acl_name); in do_get_acl()
1259 if (IS_ERR(acl)) in do_get_acl()
1260 return PTR_ERR(acl); in do_get_acl()
1263 acl, kvalue, size); in do_get_acl()
1264 posix_acl_release(acl); in do_get_acl()