#include "bcachefs.h"
#include "bkey_buf.h"
#include "bset.h"
#include "btree_cache.h"
#include "btree_journal_iter.h"
#include "journal_io.h"
#include <linux/sort.h>
static inline size_t idx_to_pos(struct journal_keys *keys, size_t idx)
{ … }
static inline struct journal_key *idx_to_key(struct journal_keys *keys, size_t idx)
{ … }
static size_t __bch2_journal_key_search(struct journal_keys *keys,
enum btree_id id, unsigned level,
struct bpos pos)
{ … }
static size_t bch2_journal_key_search(struct journal_keys *keys,
enum btree_id id, unsigned level,
struct bpos pos)
{ … }
struct bkey_i *bch2_journal_keys_peek_upto(struct bch_fs *c, enum btree_id btree_id,
unsigned level, struct bpos pos,
struct bpos end_pos, size_t *idx)
{ … }
struct bkey_i *bch2_journal_keys_peek_slot(struct bch_fs *c, enum btree_id btree_id,
unsigned level, struct bpos pos)
{ … }
static void journal_iter_verify(struct journal_iter *iter)
{ … }
static void journal_iters_fix(struct bch_fs *c)
{ … }
static void journal_iters_move_gap(struct bch_fs *c, size_t old_gap, size_t new_gap)
{ … }
int bch2_journal_key_insert_take(struct bch_fs *c, enum btree_id id,
unsigned level, struct bkey_i *k)
{ … }
int bch2_journal_key_insert(struct bch_fs *c, enum btree_id id,
unsigned level, struct bkey_i *k)
{ … }
int bch2_journal_key_delete(struct bch_fs *c, enum btree_id id,
unsigned level, struct bpos pos)
{ … }
bool bch2_key_deleted_in_journal(struct btree_trans *trans, enum btree_id btree,
unsigned level, struct bpos pos)
{ … }
void bch2_journal_key_overwritten(struct bch_fs *c, enum btree_id btree,
unsigned level, struct bpos pos)
{ … }
static void bch2_journal_iter_advance(struct journal_iter *iter)
{ … }
static struct bkey_s_c bch2_journal_iter_peek(struct journal_iter *iter)
{ … }
static void bch2_journal_iter_exit(struct journal_iter *iter)
{ … }
static void bch2_journal_iter_init(struct bch_fs *c,
struct journal_iter *iter,
enum btree_id id, unsigned level,
struct bpos pos)
{ … }
static struct bkey_s_c bch2_journal_iter_peek_btree(struct btree_and_journal_iter *iter)
{ … }
static void bch2_journal_iter_advance_btree(struct btree_and_journal_iter *iter)
{ … }
void bch2_btree_and_journal_iter_advance(struct btree_and_journal_iter *iter)
{ … }
static void btree_and_journal_iter_prefetch(struct btree_and_journal_iter *_iter)
{ … }
struct bkey_s_c bch2_btree_and_journal_iter_peek(struct btree_and_journal_iter *iter)
{ … }
void bch2_btree_and_journal_iter_exit(struct btree_and_journal_iter *iter)
{ … }
void __bch2_btree_and_journal_iter_init_node_iter(struct btree_trans *trans,
struct btree_and_journal_iter *iter,
struct btree *b,
struct btree_node_iter node_iter,
struct bpos pos)
{ … }
void bch2_btree_and_journal_iter_init_node_iter(struct btree_trans *trans,
struct btree_and_journal_iter *iter,
struct btree *b)
{ … }
void bch2_journal_entries_free(struct bch_fs *c)
{ … }
static int journal_sort_key_cmp(const void *_l, const void *_r)
{ … }
void bch2_journal_keys_put(struct bch_fs *c)
{ … }
static void __journal_keys_sort(struct journal_keys *keys)
{ … }
int bch2_journal_keys_sort(struct bch_fs *c)
{ … }
void bch2_shoot_down_journal_keys(struct bch_fs *c, enum btree_id btree,
unsigned level_min, unsigned level_max,
struct bpos start, struct bpos end)
{ … }
void bch2_journal_keys_dump(struct bch_fs *c)
{ … }