summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/move.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-10-20 13:32:42 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-31 12:18:37 -0400
commit633169035a7ccdfe3a9eba0202dc2135baa07c72 (patch)
tree720bc1d2c5d7cf425db7a606c26b64669fe6c4f2 /fs/bcachefs/move.h
parenta0bfe3b065cabc669933063cb5a9066b104be406 (diff)
downloadlinux-633169035a7ccdfe3a9eba0202dc2135baa07c72.tar.gz
linux-633169035a7ccdfe3a9eba0202dc2135baa07c72.tar.bz2
linux-633169035a7ccdfe3a9eba0202dc2135baa07c72.zip
bcachefs: moving_context now owns a btree_trans
btree_trans and moving_context are used together, and having the moving_context owns the transaction object reduces some plumbing. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/move.h')
-rw-r--r--fs/bcachefs/move.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/fs/bcachefs/move.h b/fs/bcachefs/move.h
index 67ca13f7e772..39e762b103ca 100644
--- a/fs/bcachefs/move.h
+++ b/fs/bcachefs/move.h
@@ -12,7 +12,7 @@
struct bch_read_bio;
struct moving_context {
- struct bch_fs *c;
+ struct btree_trans *trans;
struct list_head list;
void *fn;
@@ -38,10 +38,10 @@ struct moving_context {
wait_queue_head_t wait;
};
-#define move_ctxt_wait_event(_ctxt, _trans, _cond) \
+#define move_ctxt_wait_event(_ctxt, _cond) \
do { \
bool cond_finished = false; \
- bch2_moving_ctxt_do_pending_writes(_ctxt, _trans); \
+ bch2_moving_ctxt_do_pending_writes(_ctxt); \
\
if (_cond) \
break; \
@@ -60,11 +60,9 @@ 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 *);
-void bch2_move_ctxt_wait_for_io(struct moving_context *,
- struct btree_trans *);
-int bch2_move_ratelimit(struct btree_trans *, struct moving_context *);
+void bch2_moving_ctxt_do_pending_writes(struct moving_context *);
+void bch2_move_ctxt_wait_for_io(struct moving_context *);
+int bch2_move_ratelimit(struct moving_context *);
/* Inodes in different snapshots may have different IO options: */
struct snapshot_io_opts_entry {
@@ -95,16 +93,14 @@ int bch2_move_get_io_opts_one(struct btree_trans *, struct bch_io_opts *, struct
int bch2_scan_old_btree_nodes(struct bch_fs *, struct bch_move_stats *);
-int bch2_move_extent(struct btree_trans *,
- struct btree_iter *,
- struct moving_context *,
+int bch2_move_extent(struct moving_context *,
struct move_bucket_in_flight *,
- struct bch_io_opts,
+ struct btree_iter *,
struct bkey_s_c,
+ struct bch_io_opts,
struct data_update_opts);
-int __bch2_move_data(struct btree_trans *,
- struct moving_context *,
+int __bch2_move_data(struct moving_context *,
struct bbpos,
struct bbpos,
move_pred_fn, void *);
@@ -117,8 +113,7 @@ int bch2_move_data(struct bch_fs *,
bool,
move_pred_fn, void *);
-int __bch2_evacuate_bucket(struct btree_trans *,
- struct moving_context *,
+int __bch2_evacuate_bucket(struct moving_context *,
struct move_bucket_in_flight *,
struct bpos, int,
struct data_update_opts);