1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * This file is part of Lustre, http://www.lustre.org
7 * See also lustre_idl.h for wire formats of requests.
10 #ifndef _LUSTRE_EACL_H
11 #define _LUSTRE_EACL_H
13 #ifdef CONFIG_FS_POSIX_ACL
15 # ifdef HAVE_XATTR_ACL
16 # include <linux/xattr_acl.h>
17 # endif /* HAVE_XATTR_ACL */
18 # ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
19 # include <linux/posix_acl_xattr.h>
20 # endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
22 #include <lustre_idmap.h>
23 #include <md_object.h>
24 #include <lu_object.h>
31 } ext_acl_xattr_entry;
35 ext_acl_xattr_entry a_entries[0];
36 } ext_acl_xattr_header;
38 #define CFS_ACL_XATTR_SIZE(count, prefix) \
39 (sizeof(prefix ## _header) + (count) * sizeof(prefix ## _entry))
41 #define CFS_ACL_XATTR_COUNT(size, prefix) \
42 (((size) - sizeof(prefix ## _header)) / sizeof(prefix ## _entry))
44 extern int lustre_posix_acl_permission(struct md_ucred *mu, struct lu_attr *la,
45 int want, posix_acl_xattr_entry *entry,
47 extern int lustre_posix_acl_chmod_masq(posix_acl_xattr_entry *entry,
48 __u32 mode, int count);
49 extern int lustre_posix_acl_create_masq(posix_acl_xattr_entry *entry,
50 __u32 *pmode, int count);
52 extern ext_acl_xattr_header *
53 lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size);
55 lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, int size,
56 posix_acl_xattr_header **out);
58 lustre_posix_acl_xattr_id2client(struct md_ucred *mu,
59 struct lustre_idmap_table *t,
60 posix_acl_xattr_header *header,
63 lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size);
65 lustre_ext_acl_xattr_id2server(struct md_ucred *mu,
66 struct lustre_idmap_table *t,
67 ext_acl_xattr_header *header);
69 lustre_ext_acl_xattr_free(ext_acl_xattr_header *header);
71 lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
72 ext_acl_xattr_header *ext_header,
73 posix_acl_xattr_header **out);
74 extern ext_acl_xattr_header *
75 lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
76 ext_acl_xattr_header *ext_header);
78 #endif /* CONFIG_FS_POSIX_ACL */