#include "bcachefs.h"
#include "alloc_background.h"
#include "alloc_foreground.h"
#include "btree_iter.h"
#include "btree_update.h"
#include "btree_write_buffer.h"
#include "buckets.h"
#include "clock.h"
#include "errcode.h"
#include "error.h"
#include "lru.h"
#include "move.h"
#include "movinggc.h"
#include "trace.h"
#include <linux/freezer.h>
#include <linux/kthread.h>
#include <linux/math64.h>
#include <linux/sched/task.h>
#include <linux/wait.h>
struct buckets_in_flight { … };
static const struct rhashtable_params bch_move_bucket_params = …;
static struct move_bucket_in_flight *
move_bucket_in_flight_add(struct buckets_in_flight *list, struct move_bucket b)
{ … }
static int bch2_bucket_is_movable(struct btree_trans *trans,
struct move_bucket *b, u64 time)
{ … }
static void move_buckets_wait(struct moving_context *ctxt,
struct buckets_in_flight *list,
bool flush)
{ … }
static bool bucket_in_flight(struct buckets_in_flight *list,
struct move_bucket_key k)
{ … }
move_buckets;
static int bch2_copygc_get_buckets(struct moving_context *ctxt,
struct buckets_in_flight *buckets_in_flight,
move_buckets *buckets)
{ … }
noinline
static int bch2_copygc(struct moving_context *ctxt,
struct buckets_in_flight *buckets_in_flight,
bool *did_work)
{ … }
unsigned long bch2_copygc_wait_amount(struct bch_fs *c)
{ … }
void bch2_copygc_wait_to_text(struct printbuf *out, struct bch_fs *c)
{ … }
static int bch2_copygc_thread(void *arg)
{ … }
void bch2_copygc_stop(struct bch_fs *c)
{ … }
int bch2_copygc_start(struct bch_fs *c)
{ … }
void bch2_fs_copygc_init(struct bch_fs *c)
{ … }