bcachefs-tools/libbcachefs/move.h

45 lines
935 B
C
Raw Normal View History

#ifndef _BCACHEFS_MOVE_H
#define _BCACHEFS_MOVE_H
2017-01-08 12:13:18 +03:00
#include "btree_iter.h"
2017-01-08 12:13:18 +03:00
#include "buckets.h"
#include "io_types.h"
struct bch_read_bio;
struct moving_context;
2017-01-08 12:13:18 +03:00
struct migrate_write {
struct moving_context *ctxt;
2017-01-08 12:13:18 +03:00
/* what we read: */
struct bch_extent_ptr ptr;
u64 offset;
2017-01-08 12:13:18 +03:00
int move_dev;
int btree_insert_flags;
struct bch_write_op op;
2017-01-08 12:13:18 +03:00
};
void bch2_migrate_write_init(struct migrate_write *, struct bch_read_bio *);
2017-01-08 12:13:18 +03:00
#define SECTORS_IN_FLIGHT_PER_DEVICE 2048
2017-01-08 12:13:18 +03:00
typedef bool (*move_pred_fn)(void *, struct bkey_s_c_extent);
2017-01-08 12:13:18 +03:00
struct bch_move_stats {
struct btree_iter iter;
atomic64_t keys_moved;
atomic64_t sectors_moved;
atomic64_t sectors_seen;
atomic64_t sectors_raced;
};
int bch2_move_data(struct bch_fs *, struct bch_ratelimit *,
unsigned, struct bch_devs_mask *,
struct write_point_specifier,
int, int, move_pred_fn, void *,
struct bch_move_stats *);
2017-01-08 12:13:18 +03:00
#endif /* _BCACHEFS_MOVE_H */