Whamcloud - gitweb
bfa393e0dfd7b3d0ecdeaff70750cc487df4a260
[fs/lustre-release.git] / lustre / include / linux / lustre_acl.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *   This file is part of Lustre, http://www.lustre.org
5  *
6  * MDS data structures.
7  * See also lustre_idl.h for wire formats of requests.
8  */
9
10 #ifndef _LUSTRE_ACL_H
11 #define _LUSTRE_ACL_H
12
13 #ifdef __KERNEL__
14 # include <linux/fs.h>
15 # include <linux/dcache.h>
16 # ifdef CONFIG_FS_POSIX_ACL
17 # include <linux/xattr_acl.h>
18 # endif
19 #endif
20
21 /* ACL */
22 #ifdef CONFIG_FS_POSIX_ACL
23 # ifdef HAVE_XATTR_ACL
24 #  define MDS_XATTR_NAME_ACL_ACCESS XATTR_NAME_ACL_ACCESS
25 #  define mds_xattr_acl_size(entry) xattr_acl_size(entry)
26 # else /* HAVE_XATTR_ACL */
27 #  define MDS_XATTR_NAME_ACL_ACCESS POSIX_ACL_XATTR_ACCESS
28 #  define mds_xattr_acl_size(entry) posix_acl_xattr_size(entry)
29 # endif /* HAVE_XATTR_ACL */
30
31 # define LUSTRE_POSIX_ACL_MAX_ENTRIES   (32)
32
33 # ifdef __KERNEL__
34 # define LUSTRE_POSIX_ACL_MAX_SIZE              \
35                 (sizeof(xattr_acl_header) +     \
36                 LUSTRE_POSIX_ACL_MAX_ENTRIES *  \
37                 sizeof(xattr_acl_entry))
38 # else /* __KERNEL__ */
39 #  define LUSTRE_POSIX_ACL_MAX_SIZE      0
40 # endif /* __KERNEL__ */
41
42 #else /* CONFIG_FS_POSIX_ACL */
43 # define LUSTRE_POSIX_ACL_MAX_SIZE      0
44 #endif /* CONFIG_FS_POSIX_ACL */
45
46 #endif /* _LUSTRE_ACL_H */