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 (c) 2008, 2010, Oracle and/or its affiliates. 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 /** \defgroup eacl eacl
50 #ifdef CONFIG_FS_POSIX_ACL
52 # ifdef HAVE_XATTR_ACL
53 # include <linux/xattr_acl.h>
54 # endif /* HAVE_XATTR_ACL */
55 # ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
56 # include <linux/posix_acl_xattr.h>
57 # endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
59 #include <lustre_idmap.h>
60 #include <md_object.h>
61 #include <lu_object.h>
68 } ext_acl_xattr_entry;
72 ext_acl_xattr_entry a_entries[0];
73 } ext_acl_xattr_header;
75 #define CFS_ACL_XATTR_SIZE(count, prefix) \
76 (sizeof(prefix ## _header) + (count) * sizeof(prefix ## _entry))
78 #define CFS_ACL_XATTR_COUNT(size, prefix) \
79 (((size) - sizeof(prefix ## _header)) / sizeof(prefix ## _entry))
81 extern int lustre_posix_acl_permission(struct md_ucred *mu, struct lu_attr *la,
82 int want, posix_acl_xattr_entry *entry,
84 extern int lustre_posix_acl_chmod_masq(posix_acl_xattr_entry *entry,
85 __u32 mode, int count);
86 extern int lustre_posix_acl_create_masq(posix_acl_xattr_entry *entry,
87 __u32 *pmode, int count);
89 extern ext_acl_xattr_header *
90 lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size);
92 lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, int size,
93 posix_acl_xattr_header **out);
95 lustre_posix_acl_xattr_id2client(struct md_ucred *mu,
96 struct lustre_idmap_table *t,
97 posix_acl_xattr_header *header,
100 lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size);
102 lustre_ext_acl_xattr_id2server(struct md_ucred *mu,
103 struct lustre_idmap_table *t,
104 ext_acl_xattr_header *header);
106 lustre_ext_acl_xattr_free(ext_acl_xattr_header *header);
108 lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
109 ext_acl_xattr_header *ext_header,
110 posix_acl_xattr_header **out);
111 extern ext_acl_xattr_header *
112 lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
113 ext_acl_xattr_header *ext_header);
115 #endif /* CONFIG_FS_POSIX_ACL */