1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_MOVE_H
3 #define _BCACHEFS_MOVE_H
5 #include "btree_iter.h"
8 #include "move_types.h"
11 struct moving_context;
24 int btree_insert_flags;
27 struct migrate_write {
28 enum btree_id btree_id;
29 enum data_cmd data_cmd;
30 struct data_opts data_opts;
32 unsigned nr_ptrs_reserved;
34 struct moving_context *ctxt;
37 struct bch_extent_ptr ptr;
40 struct bch_write_op op;
43 void bch2_migrate_read_done(struct migrate_write *, struct bch_read_bio *);
44 int bch2_migrate_write_init(struct bch_fs *, struct migrate_write *,
45 struct write_point_specifier,
47 enum data_cmd, struct data_opts,
48 enum btree_id, struct bkey_s_c);
50 typedef enum data_cmd (*move_pred_fn)(struct bch_fs *, void *,
52 struct bch_io_opts *, struct data_opts *);
54 int bch2_move_data(struct bch_fs *, struct bch_ratelimit *,
55 struct write_point_specifier,
56 struct bpos, struct bpos,
58 struct bch_move_stats *);
60 int bch2_data_job(struct bch_fs *,
61 struct bch_move_stats *,
62 struct bch_ioctl_data);
64 #endif /* _BCACHEFS_MOVE_H */