diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-02-07 13:38:02 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:35 -0400 |
commit | 548b3d209fa5c6aaa9db58a69d9f6cf4ce8978b6 (patch) | |
tree | 9f96fb50cf49b7b72070011ec1ab6260cd1d9610 /fs/bcachefs/buckets.h | |
parent | 237e80483a6466f3c1968c2a8bb115b3e24d951b (diff) |
bcachefs: btree_ptr_v2
Add a new btree ptr type which contains the sequence number (random 64
bit cookie, actually) for that btree node - this lets us verify that
when we read in a btree node it really is the btree node we wanted.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.h')
-rw-r--r-- | fs/bcachefs/buckets.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h index 2e49f2a8ccd9..4c84787575f5 100644 --- a/fs/bcachefs/buckets.h +++ b/fs/bcachefs/buckets.h @@ -97,7 +97,8 @@ static inline struct bucket *PTR_BUCKET(struct bch_dev *ca, static inline enum bch_data_type ptr_data_type(const struct bkey *k, const struct bch_extent_ptr *ptr) { - if (k->type == KEY_TYPE_btree_ptr) + if (k->type == KEY_TYPE_btree_ptr || + k->type == KEY_TYPE_btree_ptr_v2) return BCH_DATA_BTREE; return ptr->cached ? BCH_DATA_CACHED : BCH_DATA_USER; |