4 (C) 2001 Andreas Gruenbacher, <a.gruenbacher@computer.org>
7 #include <linux/xattr_acl.h>
9 #define EXT3_ACL_VERSION 0x0001
10 #define EXT3_ACL_MAX_ENTRIES 32
21 } ext3_acl_entry_short;
27 static inline size_t ext3_acl_size(int count)
30 return sizeof(ext3_acl_header) +
31 count * sizeof(ext3_acl_entry_short);
33 return sizeof(ext3_acl_header) +
34 4 * sizeof(ext3_acl_entry_short) +
35 (count - 4) * sizeof(ext3_acl_entry);
39 static inline int ext3_acl_count(size_t size)
42 size -= sizeof(ext3_acl_header);
43 s = size - 4 * sizeof(ext3_acl_entry_short);
45 if (size % sizeof(ext3_acl_entry_short))
47 return size / sizeof(ext3_acl_entry_short);
49 if (s % sizeof(ext3_acl_entry))
51 return s / sizeof(ext3_acl_entry) + 4;
55 #ifdef CONFIG_EXT3_FS_POSIX_ACL
57 /* Value for inode->u.ext3_i.i_acl and inode->u.ext3_i.i_default_acl
58 if the ACL has not been cached */
59 #define EXT3_ACL_NOT_CACHED ((void *)-1)
62 extern int ext3_permission (struct inode *, int, struct nameidata *);
63 extern int ext3_acl_chmod (struct inode *);
64 extern int ext3_init_acl (handle_t *, struct inode *, struct inode *);
66 extern int init_ext3_acl(void);
67 extern void exit_ext3_acl(void);
69 #else /* CONFIG_EXT3_FS_POSIX_ACL */
70 #include <linux/sched.h>
71 #define ext3_permission NULL
74 ext3_acl_chmod(struct inode *inode)
80 ext3_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
82 inode->i_mode &= ~current->fs->umask;
85 #endif /* CONFIG_EXT3_FS_POSIX_ACL */