2 File: linux/posix_acl_xattr.h
4 Extended attribute system call representation of Access Control Lists.
9 #ifndef _POSIX_ACL_XATTR_H
10 #define _POSIX_ACL_XATTR_H
12 #include <uapi/linux/xattr.h>
13 #include <linux/posix_acl.h>
15 /* Supported ACL a_version fields */
16 #define POSIX_ACL_XATTR_VERSION 0x0002
18 /* An undefined entry e_id value */
19 #define ACL_UNDEFINED_ID (-1)
25 } posix_acl_xattr_entry;
29 posix_acl_xattr_entry a_entries[0];
30 } posix_acl_xattr_header;
34 posix_acl_xattr_size(int count)
36 return (sizeof(posix_acl_xattr_header) +
37 (count * sizeof(posix_acl_xattr_entry)));
41 posix_acl_xattr_count(size_t size)
43 if (size < sizeof(posix_acl_xattr_header))
45 size -= sizeof(posix_acl_xattr_header);
46 if (size % sizeof(posix_acl_xattr_entry))
48 return size / sizeof(posix_acl_xattr_entry);
51 #ifdef CONFIG_FS_POSIX_ACL
52 void posix_acl_fix_xattr_from_user(void *value, size_t size);
53 void posix_acl_fix_xattr_to_user(void *value, size_t size);
55 static inline void posix_acl_fix_xattr_from_user(void *value, size_t size)
58 static inline void posix_acl_fix_xattr_to_user(void *value, size_t size)
63 struct posix_acl *posix_acl_from_xattr(struct user_namespace *user_ns,
64 const void *value, size_t size);
65 int posix_acl_to_xattr(struct user_namespace *user_ns,
66 const struct posix_acl *acl, void *buffer, size_t size);
68 extern const struct xattr_handler posix_acl_access_xattr_handler;
69 extern const struct xattr_handler posix_acl_default_xattr_handler;
71 #endif /* _POSIX_ACL_XATTR_H */