From a104f0407b7f5de54972389ef10e11dd8c525a96 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 9 Feb 2023 18:34:08 -0500 Subject: Update bcachefs sources to ea93c26e98 fixup! bcachefs: We can handle missing btree roots for all alloc btrees Signed-off-by: Kent Overstreet --- libbcachefs/move.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libbcachefs/move.h') diff --git a/libbcachefs/move.h b/libbcachefs/move.h index b14f679f..aef61380 100644 --- a/libbcachefs/move.h +++ b/libbcachefs/move.h @@ -24,10 +24,26 @@ struct moving_context { /* in flight sectors: */ atomic_t read_sectors; atomic_t write_sectors; + atomic_t read_ios; + atomic_t write_ios; wait_queue_head_t wait; }; +#define move_ctxt_wait_event(_ctxt, _trans, _cond) \ +do { \ + bool cond_finished = false; \ + bch2_moving_ctxt_do_pending_writes(_ctxt, _trans); \ + \ + if (_cond) \ + break; \ + __wait_event((_ctxt)->wait, \ + bch2_moving_ctxt_next_pending_write(_ctxt) || \ + (cond_finished = (_cond))); \ + if (cond_finished) \ + break; \ +} while (1) + typedef bool (*move_pred_fn)(struct bch_fs *, void *, struct bkey_s_c, struct bch_io_opts *, struct data_update_opts *); @@ -35,6 +51,9 @@ void bch2_moving_ctxt_exit(struct moving_context *); void bch2_moving_ctxt_init(struct moving_context *, struct bch_fs *, struct bch_ratelimit *, struct bch_move_stats *, struct write_point_specifier, bool); +struct moving_io *bch2_moving_ctxt_next_pending_write(struct moving_context *); +void bch2_moving_ctxt_do_pending_writes(struct moving_context *, + struct btree_trans *); int bch2_scan_old_btree_nodes(struct bch_fs *, struct bch_move_stats *); -- cgit v1.2.3