Update to 3.4-final.
[linux-flexiantxendom0-3.2.10.git] / fs / ext4 / richacl.h
1 /*
2  * Copyright IBM Corporation, 2010
3  * Author Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2.1 of the GNU Lesser General Public License
7  * as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it would be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  */
14
15 #ifndef __FS_EXT4_RICHACL_H
16 #define __FS_EXT4_RICHACL_H
17
18 #include <linux/richacl.h>
19
20 #ifdef CONFIG_EXT4_FS_RICHACL
21
22 # define EXT4_IS_RICHACL(inode) IS_RICHACL(inode)
23
24 /* Value for i_richacl if RICHACL has not been cached */
25 # define EXT4_RICHACL_NOT_CACHED ((void *)-1)
26
27 extern int ext4_permission(struct inode *, int);
28 extern int ext4_richacl_permission(struct inode *, unsigned int);
29 extern int ext4_may_create(struct inode *, int);
30 extern int ext4_may_delete(struct inode *, struct inode *, int);
31 extern int ext4_init_richacl(handle_t *, struct inode *, struct inode *);
32 extern int ext4_richacl_chmod(struct inode *);
33
34 #else  /* CONFIG_FS_EXT4_RICHACL */
35
36 # define EXT4_IS_RICHACL(inode) (0)
37
38 # define ext4_permission NULL
39 # define ext4_may_create NULL
40 # define ext4_may_delete NULL
41 # define ext4_richacl_permission NULL
42
43 static inline int
44 ext4_init_richacl(handle_t *handle, struct inode *inode, struct inode *dir)
45 {
46         return 0;
47 }
48
49 static inline int
50 ext4_richacl_chmod(struct inode *inode)
51 {
52         return 0;
53 }
54
55 #endif  /* CONFIG_FS_EXT4_RICHACL */
56 #endif  /* __FS_EXT4_RICHACL_H */