Lines Matching refs:acl

36 	struct posix_acl *acl;  in ocfs2_acl_from_xattr()  local
45 acl = posix_acl_alloc(count, GFP_NOFS); in ocfs2_acl_from_xattr()
46 if (!acl) in ocfs2_acl_from_xattr()
52 acl->a_entries[n].e_tag = le16_to_cpu(entry->e_tag); in ocfs2_acl_from_xattr()
53 acl->a_entries[n].e_perm = le16_to_cpu(entry->e_perm); in ocfs2_acl_from_xattr()
54 switch(acl->a_entries[n].e_tag) { in ocfs2_acl_from_xattr()
56 acl->a_entries[n].e_uid = in ocfs2_acl_from_xattr()
61 acl->a_entries[n].e_gid = in ocfs2_acl_from_xattr()
71 return acl; in ocfs2_acl_from_xattr()
77 static void *ocfs2_acl_to_xattr(const struct posix_acl *acl, size_t *size) in ocfs2_acl_to_xattr() argument
83 *size = acl->a_count * sizeof(struct posix_acl_entry); in ocfs2_acl_to_xattr()
90 for (n = 0; n < acl->a_count; n++, entry++) { in ocfs2_acl_to_xattr()
91 entry->e_tag = cpu_to_le16(acl->a_entries[n].e_tag); in ocfs2_acl_to_xattr()
92 entry->e_perm = cpu_to_le16(acl->a_entries[n].e_perm); in ocfs2_acl_to_xattr()
93 switch(acl->a_entries[n].e_tag) { in ocfs2_acl_to_xattr()
97 acl->a_entries[n].e_uid)); in ocfs2_acl_to_xattr()
102 acl->a_entries[n].e_gid)); in ocfs2_acl_to_xattr()
118 struct posix_acl *acl; in ocfs2_get_acl_nolock() local
142 acl = ocfs2_acl_from_xattr(value, retval); in ocfs2_get_acl_nolock()
144 acl = NULL; in ocfs2_get_acl_nolock()
146 acl = ERR_PTR(retval); in ocfs2_get_acl_nolock()
150 return acl; in ocfs2_get_acl_nolock()
218 struct posix_acl *acl, in ocfs2_set_acl() argument
237 return acl ? -EACCES : 0; in ocfs2_set_acl()
243 if (acl) { in ocfs2_set_acl()
244 value = ocfs2_acl_to_xattr(acl, &size); in ocfs2_set_acl()
258 set_cached_acl(inode, type, acl); in ocfs2_set_acl()
264 struct posix_acl *acl, int type) in ocfs2_iop_set_acl() argument
274 if (type == ACL_TYPE_ACCESS && acl) { in ocfs2_iop_set_acl()
278 &acl); in ocfs2_iop_set_acl()
286 status = ocfs2_set_acl(NULL, inode, bh, type, acl, NULL, NULL); in ocfs2_iop_set_acl()
297 struct posix_acl *acl; in ocfs2_iop_get_acl() local
313 acl = ocfs2_get_acl_nolock(inode, type, di_bh); in ocfs2_iop_get_acl()
318 return acl; in ocfs2_iop_get_acl()
324 struct posix_acl *acl; in ocfs2_acl_chmod() local
334 acl = ocfs2_get_acl_nolock(inode, ACL_TYPE_ACCESS, bh); in ocfs2_acl_chmod()
336 if (IS_ERR_OR_NULL(acl)) in ocfs2_acl_chmod()
337 return PTR_ERR_OR_ZERO(acl); in ocfs2_acl_chmod()
338 ret = __posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); in ocfs2_acl_chmod()
342 acl, NULL, NULL); in ocfs2_acl_chmod()
343 posix_acl_release(acl); in ocfs2_acl_chmod()
360 struct posix_acl *acl = NULL; in ocfs2_init_acl() local
367 acl = ocfs2_get_acl_nolock(dir, ACL_TYPE_DEFAULT, in ocfs2_init_acl()
370 if (IS_ERR(acl)) in ocfs2_init_acl()
371 return PTR_ERR(acl); in ocfs2_init_acl()
373 if (!acl) { in ocfs2_init_acl()
382 if ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) && acl) { in ocfs2_init_acl()
385 ACL_TYPE_DEFAULT, acl, in ocfs2_init_acl()
391 ret = __posix_acl_create(&acl, GFP_NOFS, &mode); in ocfs2_init_acl()
404 acl, meta_ac, data_ac); in ocfs2_init_acl()
408 posix_acl_release(acl); in ocfs2_init_acl()