aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/reiserfs_acl.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/reiserfs_acl.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'include/linux/reiserfs_acl.h')
-rw-r--r--include/linux/reiserfs_acl.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
new file mode 100644
index 000000000000..a57e973af0bd
--- /dev/null
+++ b/include/linux/reiserfs_acl.h
@@ -0,0 +1,89 @@
1#include <linux/init.h>
2#include <linux/posix_acl.h>
3#include <linux/xattr_acl.h>
4
5#define REISERFS_ACL_VERSION 0x0001
6
7typedef struct {
8 __u16 e_tag;
9 __u16 e_perm;
10 __u32 e_id;
11} reiserfs_acl_entry;
12
13typedef struct {
14 __u16 e_tag;
15 __u16 e_perm;
16} reiserfs_acl_entry_short;
17
18typedef struct {
19 __u32 a_version;
20} reiserfs_acl_header;
21
22static inline size_t reiserfs_acl_size(int count)
23{
24 if (count <= 4) {
25 return sizeof(reiserfs_acl_header) +
26 count * sizeof(reiserfs_acl_entry_short);
27 } else {
28 return sizeof(reiserfs_acl_header) +
29 4 * sizeof(reiserfs_acl_entry_short) +
30 (count - 4) * sizeof(reiserfs_acl_entry);
31 }
32}
33
34static inline int reiserfs_acl_count(size_t size)
35{
36 ssize_t s;
37 size -= sizeof(reiserfs_acl_header);
38 s = size - 4 * sizeof(reiserfs_acl_entry_short);
39 if (s < 0) {
40 if (size % sizeof(reiserfs_acl_entry_short))
41 return -1;
42 return size / sizeof(reiserfs_acl_entry_short);
43 } else {
44 if (s % sizeof(reiserfs_acl_entry))
45 return -1;
46 return s / sizeof(reiserfs_acl_entry) + 4;
47 }
48}
49
50
51#ifdef CONFIG_REISERFS_FS_POSIX_ACL
52struct posix_acl * reiserfs_get_acl(struct inode *inode, int type);
53int reiserfs_acl_chmod (struct inode *inode);
54int reiserfs_inherit_default_acl (struct inode *dir, struct dentry *dentry, struct inode *inode);
55int reiserfs_cache_default_acl (struct inode *dir);
56extern int reiserfs_xattr_posix_acl_init (void) __init;
57extern int reiserfs_xattr_posix_acl_exit (void);
58extern struct reiserfs_xattr_handler posix_acl_default_handler;
59extern struct reiserfs_xattr_handler posix_acl_access_handler;
60#else
61
62#define reiserfs_get_acl NULL
63#define reiserfs_cache_default_acl(inode) 0
64
65static inline int
66reiserfs_xattr_posix_acl_init (void)
67{
68 return 0;
69}
70
71static inline int
72reiserfs_xattr_posix_acl_exit (void)
73{
74 return 0;
75}
76
77static inline int
78reiserfs_acl_chmod (struct inode *inode)
79{
80 return 0;
81}
82
83static inline int
84reiserfs_inherit_default_acl (const struct inode *dir, struct dentry *dentry, struct inode *inode)
85{
86 return 0;
87}
88
89#endif