1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_DIRENT_FORMAT_H
3 #define _BCACHEFS_DIRENT_FORMAT_H
6 * Dirents (and xattrs) have to implement string lookups; since our b-tree
7 * doesn't support arbitrary length strings for the key, we instead index by a
8 * 64 bit hash (currently truncated sha1) of the string, stored in the offset
9 * field of the key - using linear probing to resolve hash collisions. This also
10 * provides us with the readdir cookie posix requires.
12 * Linear probing requires us to use whiteouts for deletions, in the event of a
19 /* Target inode number: */
22 struct { /* DT_SUBVOL */
23 __le32 d_child_subvol;
24 __le32 d_parent_subvol;
29 * Copy of mode bits 12-15 from the target inode - so userspace can get
30 * the filetype without having to do a stat()
35 } __packed __aligned(8);
40 #define BCH_NAME_MAX 512
42 #endif /* _BCACHEFS_DIRENT_FORMAT_H */