]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/bkey.h
Update bcachefs sources to fd6fb298aa bcachefs: Make sure hash info gets initialized...
[bcachefs-tools-debian] / libbcachefs / bkey.h
index 01687e48cdceceecad37a39b6747c44eaadfa25c..2650bd639b55998c9b6a31f6ce2312520d687a22 100644 (file)
@@ -34,7 +34,12 @@ struct bkey_s {
        };
 };
 
-#define bkey_next(_k)          vstruct_next(_k)
+#define bkey_p_next(_k)                vstruct_next(_k)
+
+static inline struct bkey_i *bkey_next(struct bkey_i *k)
+{
+       return (struct bkey_i *) (k->_data + k->k.u64s);
+}
 
 #define bkey_val_u64s(_k)      ((_k)->u64s - BKEY_U64s)
 
@@ -492,7 +497,7 @@ static inline struct bpos bkey_unpack_pos(const struct btree *b,
 
 /* Disassembled bkeys */
 
-static inline struct bkey_s_c bkey_disassemble(struct btree *b,
+static inline struct bkey_s_c bkey_disassemble(const struct btree *b,
                                               const struct bkey_packed *k,
                                               struct bkey *u)
 {
@@ -502,7 +507,7 @@ static inline struct bkey_s_c bkey_disassemble(struct btree *b,
 }
 
 /* non const version: */
-static inline struct bkey_s __bkey_disassemble(struct btree *b,
+static inline struct bkey_s __bkey_disassemble(const struct btree *b,
                                               struct bkey_packed *k,
                                               struct bkey *u)
 {
@@ -752,7 +757,6 @@ static inline void bch2_bkey_format_add_key(struct bkey_format_state *s, const s
 #define x(id, field) __bkey_format_add(s, id, k->field);
        bkey_fields()
 #undef x
-       __bkey_format_add(s, BKEY_FIELD_OFFSET, bkey_start_offset(k));
 }
 
 void bch2_bkey_format_add_pos(struct bkey_format_state *, struct bpos);