1 #ifndef _BCACHEFS_MOVE_H
2 #define _BCACHEFS_MOVE_H
4 #include "btree_iter.h"
11 struct migrate_write {
12 struct moving_context *ctxt;
15 struct bch_extent_ptr ptr;
19 int btree_insert_flags;
20 struct bch_write_op op;
23 void bch2_migrate_write_init(struct migrate_write *, struct bch_read_bio *);
25 #define SECTORS_IN_FLIGHT_PER_DEVICE 2048
27 typedef bool (*move_pred_fn)(void *, struct bkey_s_c_extent);
29 struct bch_move_stats {
30 enum bch_data_type data_type;
31 struct btree_iter iter;
33 atomic64_t keys_moved;
34 atomic64_t sectors_moved;
35 atomic64_t sectors_seen;
36 atomic64_t sectors_raced;
39 int bch2_move_data(struct bch_fs *, struct bch_ratelimit *,
40 unsigned, struct bch_devs_mask *,
41 struct write_point_specifier,
42 int, int, struct bpos, struct bpos,
44 struct bch_move_stats *);
46 int bch2_data_job(struct bch_fs *,
47 struct bch_move_stats *,
48 struct bch_ioctl_data);
50 #endif /* _BCACHEFS_MOVE_H */