#ifdef CONFIG_BCACHEFS_TESTS
#include "bcachefs.h"
#include "btree_update.h"
#include "journal_reclaim.h"
#include "snapshot.h"
#include "tests.h"
#include "linux/kthread.h"
#include "linux/random.h"
static void delete_test_keys(struct bch_fs *c)
{ … }
static int test_delete(struct bch_fs *c, u64 nr)
{ … }
static int test_delete_written(struct bch_fs *c, u64 nr)
{ … }
static int test_iterate(struct bch_fs *c, u64 nr)
{ … }
static int test_iterate_extents(struct bch_fs *c, u64 nr)
{ … }
static int test_iterate_slots(struct bch_fs *c, u64 nr)
{ … }
static int test_iterate_slots_extents(struct bch_fs *c, u64 nr)
{ … }
static int test_peek_end(struct bch_fs *c, u64 nr)
{ … }
static int test_peek_end_extents(struct bch_fs *c, u64 nr)
{ … }
static u64 test_version;
static int insert_test_extent(struct bch_fs *c,
u64 start, u64 end)
{ … }
static int __test_extent_overwrite(struct bch_fs *c,
u64 e1_start, u64 e1_end,
u64 e2_start, u64 e2_end)
{ … }
static int test_extent_overwrite_front(struct bch_fs *c, u64 nr)
{ … }
static int test_extent_overwrite_back(struct bch_fs *c, u64 nr)
{ … }
static int test_extent_overwrite_middle(struct bch_fs *c, u64 nr)
{ … }
static int test_extent_overwrite_all(struct bch_fs *c, u64 nr)
{ … }
static int insert_test_overlapping_extent(struct bch_fs *c, u64 inum, u64 start, u32 len, u32 snapid)
{ … }
static int test_extent_create_overlapping(struct bch_fs *c, u64 inum)
{ … }
static int test_snapshot_filter(struct bch_fs *c, u32 snapid_lo, u32 snapid_hi)
{ … }
static int test_snapshots(struct bch_fs *c, u64 nr)
{ … }
static u64 test_rand(void)
{ … }
static int rand_insert(struct bch_fs *c, u64 nr)
{ … }
static int rand_insert_multi(struct bch_fs *c, u64 nr)
{ … }
static int rand_lookup(struct bch_fs *c, u64 nr)
{ … }
static int rand_mixed_trans(struct btree_trans *trans,
struct btree_iter *iter,
struct bkey_i_cookie *cookie,
u64 i, u64 pos)
{ … }
static int rand_mixed(struct bch_fs *c, u64 nr)
{ … }
static int __do_delete(struct btree_trans *trans, struct bpos pos)
{ … }
static int rand_delete(struct bch_fs *c, u64 nr)
{ … }
static int seq_insert(struct bch_fs *c, u64 nr)
{ … }
static int seq_lookup(struct bch_fs *c, u64 nr)
{ … }
static int seq_overwrite(struct bch_fs *c, u64 nr)
{ … }
static int seq_delete(struct bch_fs *c, u64 nr)
{ … }
perf_test_fn;
struct test_job { … };
static int btree_perf_test_thread(void *data)
{ … }
int bch2_btree_perf_test(struct bch_fs *c, const char *testname,
u64 nr, unsigned nr_threads)
{ … }
#endif