]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/dirent.h
Rename from bcache-tools to bcachefs-tools
[bcachefs-tools-debian] / libbcachefs / dirent.h
1 #ifndef _BCACHE_DIRENT_H
2 #define _BCACHE_DIRENT_H
3
4 extern const struct bkey_ops bch2_bkey_dirent_ops;
5
6 struct qstr;
7 struct file;
8 struct dir_context;
9 struct bch_fs;
10 struct bch_hash_info;
11
12 unsigned bch2_dirent_name_bytes(struct bkey_s_c_dirent);
13 int bch2_dirent_create(struct bch_fs *c, u64, const struct bch_hash_info *,
14                        u8, const struct qstr *, u64, u64 *, int);
15 int bch2_dirent_delete(struct bch_fs *, u64, const struct bch_hash_info *,
16                        const struct qstr *, u64 *);
17
18 enum bch_rename_mode {
19         BCH_RENAME,
20         BCH_RENAME_OVERWRITE,
21         BCH_RENAME_EXCHANGE,
22 };
23
24 int bch2_dirent_rename(struct bch_fs *,
25                        struct inode *, const struct qstr *,
26                        struct inode *, const struct qstr *,
27                        u64 *, enum bch_rename_mode);
28
29 u64 bch2_dirent_lookup(struct bch_fs *, u64, const struct bch_hash_info *,
30                        const struct qstr *);
31
32 int bch2_empty_dir(struct bch_fs *, u64);
33 int bch2_readdir(struct bch_fs *, struct file *, struct dir_context *);
34
35 #endif /* _BCACHE_DIRENT_H */
36