xref: /linux/fs/bcachefs/fs-common.h (revision 527a0f2bdcfe77fce22f006b97e42e4da3137c86)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_FS_COMMON_H
3 #define _BCACHEFS_FS_COMMON_H
4 
5 #include "dirent.h"
6 
7 struct posix_acl;
8 
9 #define BCH_CREATE_TMPFILE		(1U << 0)
10 #define BCH_CREATE_SUBVOL		(1U << 1)
11 #define BCH_CREATE_SNAPSHOT		(1U << 2)
12 #define BCH_CREATE_SNAPSHOT_RO		(1U << 3)
13 
14 int bch2_create_trans(struct btree_trans *, subvol_inum,
15 		      struct bch_inode_unpacked *,
16 		      struct bch_inode_unpacked *,
17 		      const struct qstr *,
18 		      uid_t, gid_t, umode_t, dev_t,
19 		      struct posix_acl *,
20 		      struct posix_acl *,
21 		      subvol_inum, unsigned);
22 
23 int bch2_link_trans(struct btree_trans *,
24 		    subvol_inum, struct bch_inode_unpacked *,
25 		    subvol_inum, struct bch_inode_unpacked *,
26 		    const struct qstr *);
27 
28 int bch2_unlink_trans(struct btree_trans *, subvol_inum,
29 		      struct bch_inode_unpacked *,
30 		      struct bch_inode_unpacked *,
31 		      const struct qstr *, bool);
32 
33 int bch2_rename_trans(struct btree_trans *,
34 		      subvol_inum, struct bch_inode_unpacked *,
35 		      subvol_inum, struct bch_inode_unpacked *,
36 		      struct bch_inode_unpacked *,
37 		      struct bch_inode_unpacked *,
38 		      const struct qstr *,
39 		      const struct qstr *,
40 		      enum bch_rename_mode);
41 
42 bool bch2_reinherit_attrs(struct bch_inode_unpacked *,
43 			  struct bch_inode_unpacked *);
44 
45 #endif /* _BCACHEFS_FS_COMMON_H */
46