|
@@ -287,6 +287,7 @@ void bch_btree_keys_init(struct btree_keys *, const struct btree_keys_ops *,
|
|
|
void bch_bset_init_next(struct btree_keys *, struct bset *, uint64_t);
|
|
|
void bch_bset_build_written_tree(struct btree_keys *);
|
|
|
void bch_bset_fix_invalidated_key(struct btree_keys *, struct bkey *);
|
|
|
+bool bch_bkey_try_merge(struct btree_keys *, struct bkey *, struct bkey *);
|
|
|
void bch_bset_insert(struct btree_keys *, struct bkey *, struct bkey *);
|
|
|
unsigned bch_btree_insert_key(struct btree_keys *, struct bkey *,
|
|
|
struct bkey *);
|
|
@@ -299,17 +300,6 @@ enum {
|
|
|
BTREE_INSERT_STATUS_FRONT_MERGE,
|
|
|
};
|
|
|
|
|
|
-/*
|
|
|
- * Tries to merge l and r: l should be lower than r
|
|
|
- * Returns true if we were able to merge. If we did merge, l will be the merged
|
|
|
- * key, r will be untouched.
|
|
|
- */
|
|
|
-static inline bool bch_bkey_try_merge(struct btree_keys *b,
|
|
|
- struct bkey *l, struct bkey *r)
|
|
|
-{
|
|
|
- return b->ops->key_merge ? b->ops->key_merge(b, l, r) : false;
|
|
|
-}
|
|
|
-
|
|
|
/* Btree key iteration */
|
|
|
|
|
|
struct btree_iter {
|