1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lustre/lustre/include/lustre_idmap.h
38 * MDS data structures.
39 * See also lustre_idl.h for wire formats of requests.
42 #ifndef _LUSTRE_EACL_H
43 #define _LUSTRE_EACL_H
45 #ifdef CONFIG_FS_POSIX_ACL
47 # ifdef HAVE_XATTR_ACL
48 # include <linux/xattr_acl.h>
49 # endif /* HAVE_XATTR_ACL */
50 # ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
51 # include <linux/posix_acl_xattr.h>
52 # endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
54 #include <lustre_idmap.h>
55 #include <md_object.h>
56 #include <lu_object.h>
63 } ext_acl_xattr_entry;
67 ext_acl_xattr_entry a_entries[0];
68 } ext_acl_xattr_header;
70 #define CFS_ACL_XATTR_SIZE(count, prefix) \
71 (sizeof(prefix ## _header) + (count) * sizeof(prefix ## _entry))
73 #define CFS_ACL_XATTR_COUNT(size, prefix) \
74 (((size) - sizeof(prefix ## _header)) / sizeof(prefix ## _entry))
76 extern int lustre_posix_acl_permission(struct md_ucred *mu, struct lu_attr *la,
77 int want, posix_acl_xattr_entry *entry,
79 extern int lustre_posix_acl_chmod_masq(posix_acl_xattr_entry *entry,
80 __u32 mode, int count);
81 extern int lustre_posix_acl_create_masq(posix_acl_xattr_entry *entry,
82 __u32 *pmode, int count);
84 extern ext_acl_xattr_header *
85 lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size);
87 lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, int size,
88 posix_acl_xattr_header **out);
90 lustre_posix_acl_xattr_id2client(struct md_ucred *mu,
91 struct lustre_idmap_table *t,
92 posix_acl_xattr_header *header,
95 lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size);
97 lustre_ext_acl_xattr_id2server(struct md_ucred *mu,
98 struct lustre_idmap_table *t,
99 ext_acl_xattr_header *header);
101 lustre_ext_acl_xattr_free(ext_acl_xattr_header *header);
103 lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
104 ext_acl_xattr_header *ext_header,
105 posix_acl_xattr_header **out);
106 extern ext_acl_xattr_header *
107 lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
108 ext_acl_xattr_header *ext_header);
110 #endif /* CONFIG_FS_POSIX_ACL */