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