1 #ifndef _BCACHEFS_ACL_H
2 #define _BCACHEFS_ACL_H
4 #ifdef CONFIG_BCACHEFS_POSIX_ACL
6 #define BCH_ACL_VERSION 0x0001
17 } bch_acl_entry_short;
23 static inline size_t bch2_acl_size(int count)
26 return sizeof(bch_acl_header) +
27 count * sizeof(bch_acl_entry_short);
29 return sizeof(bch_acl_header) +
30 4 * sizeof(bch_acl_entry_short) +
31 (count - 4) * sizeof(bch_acl_entry);
35 static inline int bch2_acl_count(size_t size)
39 size -= sizeof(bch_acl_header);
40 s = size - 4 * sizeof(bch_acl_entry_short);
42 if (size % sizeof(bch_acl_entry_short))
44 return size / sizeof(bch_acl_entry_short);
46 if (s % sizeof(bch_acl_entry))
48 return s / sizeof(bch_acl_entry) + 4;
54 extern struct posix_acl *bch2_get_acl(struct inode *, int);
55 extern int bch2_set_acl(struct inode *, struct posix_acl *, int);
59 static inline int bch2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
64 #endif /* CONFIG_BCACHEFS_POSIX_ACL */
66 #endif /* _BCACHEFS_ACL_H */