]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/move.h
Update bcachefs sources to e57b5958cf bcachefs: fix for building in userspace
[bcachefs-tools-debian] / libbcachefs / move.h
1 #ifndef _BCACHEFS_MOVE_H
2 #define _BCACHEFS_MOVE_H
3
4 #include "buckets.h"
5 #include "io_types.h"
6
7 struct bch_read_bio;
8 struct moving_context;
9
10 struct migrate_write {
11         struct moving_context   *ctxt;
12
13         /* what we read: */
14         struct bch_extent_ptr   ptr;
15         u64                     offset;
16
17         int                     move_dev;
18         int                     btree_insert_flags;
19         struct bch_write_op     op;
20 };
21
22 void bch2_migrate_write_init(struct migrate_write *, struct bch_read_bio *);
23
24 #define SECTORS_IN_FLIGHT_PER_DEVICE    2048
25
26 typedef bool (*move_pred_fn)(void *, struct bkey_s_c_extent);
27
28 int bch2_move_data(struct bch_fs *, struct bch_ratelimit *,
29                    unsigned, struct bch_devs_mask *,
30                    struct write_point_specifier,
31                    int, int, move_pred_fn, void *,
32                    u64 *, u64 *);
33
34 #endif /* _BCACHEFS_MOVE_H */