Lines Matching defs:acl
5 * acl.c
10 * Lots of code in this file is copy from linux/fs/ext3/acl.c.
30 #include "acl.h"
33 * Convert from xattr value to acl struct.
38 struct posix_acl *acl;
47 acl = posix_acl_alloc(count, GFP_NOFS);
48 if (!acl)
54 acl->a_entries[n].e_tag = le16_to_cpu(entry->e_tag);
55 acl->a_entries[n].e_perm = le16_to_cpu(entry->e_perm);
56 switch(acl->a_entries[n].e_tag) {
58 acl->a_entries[n].e_uid =
63 acl->a_entries[n].e_gid =
73 return acl;
77 * Convert acl struct to xattr value.
79 static void *ocfs2_acl_to_xattr(const struct posix_acl *acl, size_t *size)
85 *size = acl->a_count * sizeof(struct posix_acl_entry);
92 for (n = 0; n < acl->a_count; n++, entry++) {
93 entry->e_tag = cpu_to_le16(acl->a_entries[n].e_tag);
94 entry->e_perm = cpu_to_le16(acl->a_entries[n].e_perm);
95 switch(acl->a_entries[n].e_tag) {
99 acl->a_entries[n].e_uid));
104 acl->a_entries[n].e_gid));
120 struct posix_acl *acl;
144 acl = ocfs2_acl_from_xattr(value, retval);
146 acl = NULL;
148 acl = ERR_PTR(retval);
152 return acl;
220 struct posix_acl *acl,
239 return acl ? -EACCES : 0;
245 if (acl) {
246 value = ocfs2_acl_to_xattr(acl, &size);
260 set_cached_acl(inode, type, acl);
265 int ocfs2_iop_set_acl(struct inode *inode, struct posix_acl *acl, int type)
274 if (type == ACL_TYPE_ACCESS && acl) {
277 status = posix_acl_update_mode(inode, &mode, &acl);
285 status = ocfs2_set_acl(NULL, inode, bh, type, acl, NULL, NULL);
296 struct posix_acl *acl;
309 acl = ocfs2_get_acl_nolock(inode, type, di_bh);
314 return acl;
320 struct posix_acl *acl;
330 acl = ocfs2_get_acl_nolock(inode, ACL_TYPE_ACCESS, bh);
332 if (IS_ERR_OR_NULL(acl))
333 return PTR_ERR_OR_ZERO(acl);
334 ret = __posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
338 acl, NULL, NULL);
339 posix_acl_release(acl);
356 struct posix_acl *acl = NULL;
363 acl = ocfs2_get_acl_nolock(dir, ACL_TYPE_DEFAULT,
366 if (IS_ERR(acl))
367 return PTR_ERR(acl);
369 if (!acl) {
378 if ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) && acl) {
381 ACL_TYPE_DEFAULT, acl,
387 ret = __posix_acl_create(&acl, GFP_NOFS, &mode);
400 acl, meta_ac, data_ac);
404 posix_acl_release(acl);