1 #ifndef _BCACHEFS_DIRENT_H
2 #define _BCACHEFS_DIRENT_H
6 extern const struct bch_hash_desc bch2_dirent_hash_desc;
8 const char *bch2_dirent_invalid(const struct bch_fs *, struct bkey_s_c);
9 void bch2_dirent_to_text(struct bch_fs *, char *, size_t, struct bkey_s_c);
11 #define bch2_bkey_dirent_ops (struct bkey_ops) { \
12 .key_invalid = bch2_dirent_invalid, \
13 .val_to_text = bch2_dirent_to_text, \
21 struct bch_inode_info;
23 unsigned bch2_dirent_name_bytes(struct bkey_s_c_dirent);
25 int __bch2_dirent_create(struct btree_trans *, u64,
26 const struct bch_hash_info *, u8,
27 const struct qstr *, u64, int);
28 int bch2_dirent_create(struct bch_fs *c, u64, const struct bch_hash_info *,
29 u8, const struct qstr *, u64, u64 *, int);
31 int __bch2_dirent_delete(struct btree_trans *, u64,
32 const struct bch_hash_info *,
34 int bch2_dirent_delete(struct bch_fs *, u64, const struct bch_hash_info *,
35 const struct qstr *, u64 *);
37 enum bch_rename_mode {
43 int bch2_dirent_rename(struct btree_trans *,
44 struct bch_inode_info *, const struct qstr *,
45 struct bch_inode_info *, const struct qstr *,
46 enum bch_rename_mode);
48 u64 bch2_dirent_lookup(struct bch_fs *, u64, const struct bch_hash_info *,
51 int bch2_empty_dir(struct bch_fs *, u64);
52 int bch2_readdir(struct bch_fs *, struct file *, struct dir_context *);
54 #endif /* _BCACHEFS_DIRENT_H */