File tree Expand file tree Collapse file tree 2 files changed +43
-39
lines changed Expand file tree Collapse file tree 2 files changed +43
-39
lines changed Original file line number Diff line number Diff line change @@ -710,45 +710,6 @@ struct bch_reservation {
710710#define BKEY_BTREE_PTR_U64s_MAX \
711711 (BKEY_U64s + BKEY_BTREE_PTR_VAL_U64s_MAX)
712712
713- /* Dirents */
714-
715- /*
716- * Dirents (and xattrs) have to implement string lookups; since our b-tree
717- * doesn't support arbitrary length strings for the key, we instead index by a
718- * 64 bit hash (currently truncated sha1) of the string, stored in the offset
719- * field of the key - using linear probing to resolve hash collisions. This also
720- * provides us with the readdir cookie posix requires.
721- *
722- * Linear probing requires us to use whiteouts for deletions, in the event of a
723- * collision:
724- */
725-
726- struct bch_dirent {
727- struct bch_val v ;
728-
729- /* Target inode number: */
730- union {
731- __le64 d_inum ;
732- struct { /* DT_SUBVOL */
733- __le32 d_child_subvol ;
734- __le32 d_parent_subvol ;
735- };
736- };
737-
738- /*
739- * Copy of mode bits 12-15 from the target inode - so userspace can get
740- * the filetype without having to do a stat()
741- */
742- __u8 d_type ;
743-
744- __u8 d_name [];
745- } __packed __aligned (8 );
746-
747- #define DT_SUBVOL 16
748- #define BCH_DT_MAX 17
749-
750- #define BCH_NAME_MAX 512
751-
752713/* Xattrs */
753714
754715#define KEY_TYPE_XATTR_INDEX_USER 0
@@ -1045,6 +1006,7 @@ struct bch_sb_field {
10451006 x(ext, 13) \
10461007 x(downgrade, 14)
10471008
1009+ #include "dirent_format.h"
10481010#include "inode_format.h"
10491011#include "quota_format.h"
10501012#include "sb-counters_format.h"
Original file line number Diff line number Diff line change 1+ /* SPDX-License-Identifier: GPL-2.0 */
2+ #ifndef _BCACHEFS_DIRENT_FORMAT_H
3+ #define _BCACHEFS_DIRENT_FORMAT_H
4+
5+ /*
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.
11+ *
12+ * Linear probing requires us to use whiteouts for deletions, in the event of a
13+ * collision:
14+ */
15+
16+ struct bch_dirent {
17+ struct bch_val v ;
18+
19+ /* Target inode number: */
20+ union {
21+ __le64 d_inum ;
22+ struct { /* DT_SUBVOL */
23+ __le32 d_child_subvol ;
24+ __le32 d_parent_subvol ;
25+ };
26+ };
27+
28+ /*
29+ * Copy of mode bits 12-15 from the target inode - so userspace can get
30+ * the filetype without having to do a stat()
31+ */
32+ __u8 d_type ;
33+
34+ __u8 d_name [];
35+ } __packed __aligned (8 );
36+
37+ #define DT_SUBVOL 16
38+ #define BCH_DT_MAX 17
39+
40+ #define BCH_NAME_MAX 512
41+
42+ #endif /* _BCACHEFS_DIRENT_FORMAT_H */
You can’t perform that action at this time.
0 commit comments