4 (C) 2001 Andreas Gruenbacher, <a.gruenbacher@computer.org>
7 #include <linux/xattr_acl.h>
9 #define EXT2_ACL_VERSION 0x0001
10 #define EXT2_ACL_MAX_ENTRIES 32
21 } ext2_acl_entry_short;
27 static inline size_t ext2_acl_size(int count)
30 return sizeof(ext2_acl_header) +
31 count * sizeof(ext2_acl_entry_short);
33 return sizeof(ext2_acl_header) +
34 4 * sizeof(ext2_acl_entry_short) +
35 (count - 4) * sizeof(ext2_acl_entry);
39 static inline int ext2_acl_count(size_t size)
42 size -= sizeof(ext2_acl_header);
43 s = size - 4 * sizeof(ext2_acl_entry_short);
45 if (size % sizeof(ext2_acl_entry_short))
47 return size / sizeof(ext2_acl_entry_short);
49 if (s % sizeof(ext2_acl_entry))
51 return s / sizeof(ext2_acl_entry) + 4;
55 #ifdef CONFIG_EXT2_FS_POSIX_ACL
57 /* Value for inode->u.ext2_i.i_acl and inode->u.ext2_i.i_default_acl
58 if the ACL has not been cached */
59 #define EXT2_ACL_NOT_CACHED ((void *)-1)
62 extern int ext2_permission (struct inode *, int, struct nameidata *);
63 extern int ext2_acl_chmod (struct inode *);
64 extern int ext2_init_acl (struct inode *, struct inode *);
66 extern int init_ext2_acl(void);
67 extern void exit_ext2_acl(void);
70 #include <linux/sched.h>
71 #define ext2_permission NULL
72 #define ext2_get_acl NULL
73 #define ext2_set_acl NULL
76 ext2_acl_chmod (struct inode *inode)
81 static inline int ext2_init_acl (struct inode *inode, struct inode *dir)
83 inode->i_mode &= ~current->fs->umask;