summaryrefslogtreecommitdiff
path: root/fs/bcachefs/move.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-06-20 22:40:26 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:35 +0300
commit0337cc7eeed19e81e50414b5199bb65029ca0ed5 (patch)
tree8b40f9191ccfa8adef47e178ffafa7149b77b69c /fs/bcachefs/move.h
parentc91996c50a9ad6569cf9cb52e79c171f0d34814d (diff)
downloadlinux-0337cc7eeed19e81e50414b5199bb65029ca0ed5.tar.xz
bcachefs: move.c refactoring
- add bch2_moving_ctxt_(init|exit) - split out __bch2_evacutae_bucket() which takes an existing moving_ctxt, this will be used for improving copygc performance by pipelining across multiple buckets Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/move.h')
-rw-r--r--fs/bcachefs/move.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/fs/bcachefs/move.h b/fs/bcachefs/move.h
index d362cb545c0b..6250c75618c4 100644
--- a/fs/bcachefs/move.h
+++ b/fs/bcachefs/move.h
@@ -10,11 +10,14 @@
struct bch_read_bio;
struct moving_context {
- /* Closure for waiting on all reads and writes to complete */
- struct closure cl;
-
+ struct bch_fs *c;
+ struct bch_ratelimit *rate;
struct bch_move_stats *stats;
+ struct write_point_specifier wp;
+ bool wait_on_copygc;
+ /* For waiting on outstanding reads and writes: */
+ struct closure cl;
struct list_head reads;
/* in flight sectors: */
@@ -25,7 +28,12 @@ struct moving_context {
};
typedef bool (*move_pred_fn)(struct bch_fs *, void *, struct bkey_s_c,
- struct bch_io_opts *, struct data_update_opts *);
+ struct bch_io_opts *, struct data_update_opts *);
+
+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);
int bch2_scan_old_btree_nodes(struct bch_fs *, struct bch_move_stats *);
@@ -33,10 +41,10 @@ int bch2_move_data(struct bch_fs *,
enum btree_id, struct bpos,
enum btree_id, struct bpos,
struct bch_ratelimit *,
- struct write_point_specifier,
- move_pred_fn, void *,
struct bch_move_stats *,
- bool);
+ struct write_point_specifier,
+ bool,
+ move_pred_fn, void *);
int bch2_data_job(struct bch_fs *,
struct bch_move_stats *,