#include "bcachefs.h"
#include "btree_cache.h"
#include "btree_io.h"
#include "btree_journal_iter.h"
#include "btree_node_scan.h"
#include "btree_update_interior.h"
#include "buckets.h"
#include "error.h"
#include "journal_io.h"
#include "recovery_passes.h"
#include <linux/kthread.h>
#include <linux/sort.h>
struct find_btree_nodes_worker { … };
static void found_btree_node_to_text(struct printbuf *out, struct bch_fs *c, const struct found_btree_node *n)
{ … }
static void found_btree_nodes_to_text(struct printbuf *out, struct bch_fs *c, found_btree_nodes nodes)
{ … }
static void found_btree_node_to_key(struct bkey_i *k, const struct found_btree_node *f)
{ … }
static inline u64 bkey_journal_seq(struct bkey_s_c k)
{ … }
static bool found_btree_node_is_readable(struct btree_trans *trans,
struct found_btree_node *f)
{ … }
static int found_btree_node_cmp_cookie(const void *_l, const void *_r)
{ … }
static int found_btree_node_cmp_time(const struct found_btree_node *l,
const struct found_btree_node *r)
{ … }
static int found_btree_node_cmp_pos(const void *_l, const void *_r)
{ … }
static void try_read_btree_node(struct find_btree_nodes *f, struct bch_dev *ca,
struct bio *bio, struct btree_node *bn, u64 offset)
{ … }
static int read_btree_nodes_worker(void *p)
{ … }
static int read_btree_nodes(struct find_btree_nodes *f)
{ … }
static void bubble_up(struct found_btree_node *n, struct found_btree_node *end)
{ … }
static int handle_overwrites(struct bch_fs *c,
struct found_btree_node *start,
struct found_btree_node *end)
{ … }
int bch2_scan_for_btree_nodes(struct bch_fs *c)
{ … }
static int found_btree_node_range_start_cmp(const void *_l, const void *_r)
{ … }
#define for_each_found_btree_node_in_range(_f, _search, _idx) …
bool bch2_btree_node_is_stale(struct bch_fs *c, struct btree *b)
{ … }
bool bch2_btree_has_scanned_nodes(struct bch_fs *c, enum btree_id btree)
{ … }
int bch2_get_scanned_nodes(struct bch_fs *c, enum btree_id btree,
unsigned level, struct bpos node_min, struct bpos node_max)
{ … }
void bch2_find_btree_nodes_exit(struct find_btree_nodes *f)
{ … }