]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcache/dirent.h
bcache in userspace; userspace fsck
[bcachefs-tools-debian] / libbcache / dirent.h
1 #ifndef _BCACHE_DIRENT_H
2 #define _BCACHE_DIRENT_H
3
4 extern const struct bkey_ops bch_bkey_dirent_ops;
5
6 struct qstr;
7 struct file;
8 struct dir_context;
9 struct cache_set;
10
11 int bch_dirent_create(struct cache_set *c, struct inode *, u8,
12                       const struct qstr *, u64);
13 int bch_dirent_delete(struct cache_set *c, struct inode *, const struct qstr *);
14
15 enum bch_rename_mode {
16         BCH_RENAME,
17         BCH_RENAME_OVERWRITE,
18         BCH_RENAME_EXCHANGE,
19 };
20
21 int bch_dirent_rename(struct cache_set *,
22                       struct inode *, const struct qstr *,
23                       struct inode *, const struct qstr *,
24                       u64 *, enum bch_rename_mode);
25
26 u64 bch_dirent_lookup(struct cache_set *c, struct inode *,
27                       const struct qstr *);
28 int bch_empty_dir(struct cache_set *, u64);
29 int bch_readdir(struct cache_set *, struct file *, struct dir_context *);
30
31 #endif /* _BCACHE_DIRENT_H */
32