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 * Copyright (c) 2012 Whamcloud, Inc.
36 * This file is part of Lustre, http://www.lustre.org/
37 * Lustre is a trademark of Sun Microsystems, Inc.
39 * lustre/lustre/include/lustre_idmap.h
41 * MDS data structures.
42 * See also lustre_idl.h for wire formats of requests.
45 #ifndef _LUSTRE_EACL_H
46 #define _LUSTRE_EACL_H
48 /** \defgroup eacl eacl
53 #ifdef CONFIG_FS_POSIX_ACL
55 #include <linux/posix_acl_xattr.h>
57 #include <lustre_idmap.h>
58 #include <md_object.h>
59 #include <lu_object.h>
66 } ext_acl_xattr_entry;
70 ext_acl_xattr_entry a_entries[0];
71 } ext_acl_xattr_header;
73 #define CFS_ACL_XATTR_SIZE(count, prefix) \
74 (sizeof(prefix ## _header) + (count) * sizeof(prefix ## _entry))
76 #define CFS_ACL_XATTR_COUNT(size, prefix) \
77 (((size) - sizeof(prefix ## _header)) / sizeof(prefix ## _entry))
79 extern int lustre_posix_acl_permission(struct md_ucred *mu, struct lu_attr *la,
80 int want, posix_acl_xattr_entry *entry,
82 extern int lustre_posix_acl_chmod_masq(posix_acl_xattr_entry *entry,
83 __u32 mode, int count);
84 extern int lustre_posix_acl_create_masq(posix_acl_xattr_entry *entry,
85 __u32 *pmode, int count);
87 extern ext_acl_xattr_header *
88 lustre_posix_acl_xattr_2ext(posix_acl_xattr_header *header, int size);
90 lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, int size,
91 posix_acl_xattr_header **out);
93 lustre_posix_acl_xattr_id2client(struct md_ucred *mu,
94 struct lustre_idmap_table *t,
95 posix_acl_xattr_header *header,
98 lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size);
100 lustre_ext_acl_xattr_id2server(struct md_ucred *mu,
101 struct lustre_idmap_table *t,
102 ext_acl_xattr_header *header);
104 lustre_ext_acl_xattr_free(ext_acl_xattr_header *header);
106 lustre_acl_xattr_merge2posix(posix_acl_xattr_header *posix_header, int size,
107 ext_acl_xattr_header *ext_header,
108 posix_acl_xattr_header **out);
109 extern ext_acl_xattr_header *
110 lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size,
111 ext_acl_xattr_header *ext_header);
113 #endif /* CONFIG_FS_POSIX_ACL */