Lines Matching refs:acl

46 	struct posix_acl *acl;  in ocfs2_acl_from_xattr()  local
55 acl = posix_acl_alloc(count, GFP_NOFS); in ocfs2_acl_from_xattr()
56 if (!acl) in ocfs2_acl_from_xattr()
62 acl->a_entries[n].e_tag = le16_to_cpu(entry->e_tag); in ocfs2_acl_from_xattr()
63 acl->a_entries[n].e_perm = le16_to_cpu(entry->e_perm); in ocfs2_acl_from_xattr()
64 switch(acl->a_entries[n].e_tag) { in ocfs2_acl_from_xattr()
66 acl->a_entries[n].e_uid = in ocfs2_acl_from_xattr()
71 acl->a_entries[n].e_gid = in ocfs2_acl_from_xattr()
81 return acl; in ocfs2_acl_from_xattr()
87 static void *ocfs2_acl_to_xattr(const struct posix_acl *acl, size_t *size) in ocfs2_acl_to_xattr() argument
93 *size = acl->a_count * sizeof(struct posix_acl_entry); in ocfs2_acl_to_xattr()
100 for (n = 0; n < acl->a_count; n++, entry++) { in ocfs2_acl_to_xattr()
101 entry->e_tag = cpu_to_le16(acl->a_entries[n].e_tag); in ocfs2_acl_to_xattr()
102 entry->e_perm = cpu_to_le16(acl->a_entries[n].e_perm); in ocfs2_acl_to_xattr()
103 switch(acl->a_entries[n].e_tag) { in ocfs2_acl_to_xattr()
107 acl->a_entries[n].e_uid)); in ocfs2_acl_to_xattr()
112 acl->a_entries[n].e_gid)); in ocfs2_acl_to_xattr()
128 struct posix_acl *acl; in ocfs2_get_acl_nolock() local
152 acl = ocfs2_acl_from_xattr(value, retval); in ocfs2_get_acl_nolock()
154 acl = NULL; in ocfs2_get_acl_nolock()
156 acl = ERR_PTR(retval); in ocfs2_get_acl_nolock()
160 return acl; in ocfs2_get_acl_nolock()
228 struct posix_acl *acl, in ocfs2_set_acl() argument
243 if (acl) { in ocfs2_set_acl()
245 ret = posix_acl_equiv_mode(acl, &mode); in ocfs2_set_acl()
250 acl = NULL; in ocfs2_set_acl()
261 return acl ? -EACCES : 0; in ocfs2_set_acl()
267 if (acl) { in ocfs2_set_acl()
268 value = ocfs2_acl_to_xattr(acl, &size); in ocfs2_set_acl()
285 int ocfs2_iop_set_acl(struct inode *inode, struct posix_acl *acl, int type) in ocfs2_iop_set_acl() argument
296 status = ocfs2_set_acl(NULL, inode, bh, type, acl, NULL, NULL); in ocfs2_iop_set_acl()
306 struct posix_acl *acl; in ocfs2_iop_get_acl() local
319 acl = ocfs2_get_acl_nolock(inode, type, di_bh); in ocfs2_iop_get_acl()
323 return acl; in ocfs2_iop_get_acl()
329 struct posix_acl *acl; in ocfs2_acl_chmod() local
338 acl = ocfs2_get_acl_nolock(inode, ACL_TYPE_ACCESS, bh); in ocfs2_acl_chmod()
339 if (IS_ERR(acl) || !acl) in ocfs2_acl_chmod()
340 return PTR_ERR(acl); in ocfs2_acl_chmod()
341 ret = __posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); in ocfs2_acl_chmod()
345 acl, NULL, NULL); in ocfs2_acl_chmod()
346 posix_acl_release(acl); in ocfs2_acl_chmod()
363 struct posix_acl *acl = NULL; in ocfs2_init_acl() local
369 acl = ocfs2_get_acl_nolock(dir, ACL_TYPE_DEFAULT, in ocfs2_init_acl()
371 if (IS_ERR(acl)) in ocfs2_init_acl()
372 return PTR_ERR(acl); in ocfs2_init_acl()
374 if (!acl) { in ocfs2_init_acl()
383 if ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) && acl) { in ocfs2_init_acl()
386 ACL_TYPE_DEFAULT, acl, in ocfs2_init_acl()
392 ret = __posix_acl_create(&acl, GFP_NOFS, &mode); in ocfs2_init_acl()
405 acl, meta_ac, data_ac); in ocfs2_init_acl()
409 posix_acl_release(acl); in ocfs2_init_acl()