]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/acl.h
Update bcachefs sources to 33a60d9b05 bcachefs: Assorted fixes for clang
[bcachefs-tools-debian] / libbcachefs / acl.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_ACL_H
3 #define _BCACHEFS_ACL_H
4
5 struct bch_inode_unpacked;
6 struct bch_hash_info;
7 struct bch_inode_info;
8 struct posix_acl;
9
10 #ifdef CONFIG_BCACHEFS_POSIX_ACL
11
12 #define BCH_ACL_VERSION 0x0001
13
14 typedef struct {
15         __le16          e_tag;
16         __le16          e_perm;
17         __le32          e_id;
18 } bch_acl_entry;
19
20 typedef struct {
21         __le16          e_tag;
22         __le16          e_perm;
23 } bch_acl_entry_short;
24
25 typedef struct {
26         __le32          a_version;
27 } bch_acl_header;
28
29 struct posix_acl *bch2_get_acl(struct mnt_idmap *, struct dentry *, int);
30
31 int bch2_set_acl_trans(struct btree_trans *, subvol_inum,
32                        struct bch_inode_unpacked *,
33                        struct posix_acl *, int);
34 int bch2_set_acl(struct mnt_idmap *, struct dentry *, struct posix_acl *, int);
35 int bch2_acl_chmod(struct btree_trans *, subvol_inum,
36                    struct bch_inode_unpacked *,
37                    umode_t, struct posix_acl **);
38
39 #else
40
41 static inline int bch2_set_acl_trans(struct btree_trans *trans, subvol_inum inum,
42                                      struct bch_inode_unpacked *inode_u,
43                                      struct posix_acl *acl, int type)
44 {
45         return 0;
46 }
47
48 static inline int bch2_acl_chmod(struct btree_trans *trans, subvol_inum inum,
49                                  struct bch_inode_unpacked *inode,
50                                  umode_t mode,
51                                  struct posix_acl **new_acl)
52 {
53         return 0;
54 }
55
56 #endif /* CONFIG_BCACHEFS_POSIX_ACL */
57
58 #endif /* _BCACHEFS_ACL_H */