Signed-off-by: Kent Overstreet <[email protected]>
---
 fs/bcachefs/move.c      | 20 +++++++++++---------
 fs/bcachefs/move.h      |  2 +-
 fs/bcachefs/rebalance.c |  2 +-
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/fs/bcachefs/move.c b/fs/bcachefs/move.c
index 983dbba2d3c4..f41913ea85e4 100644
--- a/fs/bcachefs/move.c
+++ b/fs/bcachefs/move.c
@@ -667,7 +667,7 @@ static int bch2_move_data_btree(struct moving_context *ctxt,
                        continue;
 
                memset(&data_opts, 0, sizeof(data_opts));
-               if (!pred(c, arg, k, io_opts, &data_opts))
+               if (!pred(c, arg, extent_iter->btree_id, k, io_opts, 
&data_opts))
                        goto next;
 
                /*
@@ -850,7 +850,7 @@ static int __bch2_move_data_phys(struct moving_context 
*ctxt,
                }
 
                struct data_update_opts data_opts = {};
-               if (!pred(c, arg, k, &io_opts, &data_opts)) {
+               if (!pred(c, arg, bp.v->btree_id, k, &io_opts, &data_opts)) {
                        bch2_trans_iter_exit(trans, &iter);
                        goto next;
                }
@@ -933,7 +933,8 @@ struct evacuate_bucket_arg {
        struct data_update_opts data_opts;
 };
 
-static bool evacuate_bucket_pred(struct bch_fs *c, void *_arg, struct bkey_s_c 
k,
+static bool evacuate_bucket_pred(struct bch_fs *c, void *_arg,
+                                enum btree_id btree, struct bkey_s_c k,
                                 struct bch_io_opts *io_opts,
                                 struct data_update_opts *data_opts)
 {
@@ -1047,7 +1048,7 @@ static int bch2_move_btree(struct bch_fs *c,
 }
 
 static bool rereplicate_pred(struct bch_fs *c, void *arg,
-                            struct bkey_s_c k,
+                            enum btree_id btree, struct bkey_s_c k,
                             struct bch_io_opts *io_opts,
                             struct data_update_opts *data_opts)
 {
@@ -1079,7 +1080,7 @@ static bool rereplicate_pred(struct bch_fs *c, void *arg,
 }
 
 static bool migrate_pred(struct bch_fs *c, void *arg,
-                        struct bkey_s_c k,
+                        enum btree_id btree, struct bkey_s_c k,
                         struct bch_io_opts *io_opts,
                         struct data_update_opts *data_opts)
 {
@@ -1106,7 +1107,7 @@ static bool rereplicate_btree_pred(struct bch_fs *c, void 
*arg,
                                   struct bch_io_opts *io_opts,
                                   struct data_update_opts *data_opts)
 {
-       return rereplicate_pred(c, arg, bkey_i_to_s_c(&b->key), io_opts, 
data_opts);
+       return rereplicate_pred(c, arg, b->c.btree_id, bkey_i_to_s_c(&b->key), 
io_opts, data_opts);
 }
 
 /*
@@ -1162,7 +1163,7 @@ int bch2_scan_old_btree_nodes(struct bch_fs *c, struct 
bch_move_stats *stats)
 }
 
 static bool drop_extra_replicas_pred(struct bch_fs *c, void *arg,
-                            struct bkey_s_c k,
+                            enum btree_id btree, struct bkey_s_c k,
                             struct bch_io_opts *io_opts,
                             struct data_update_opts *data_opts)
 {
@@ -1195,11 +1196,12 @@ static bool drop_extra_replicas_btree_pred(struct 
bch_fs *c, void *arg,
                                   struct bch_io_opts *io_opts,
                                   struct data_update_opts *data_opts)
 {
-       return drop_extra_replicas_pred(c, arg, bkey_i_to_s_c(&b->key), 
io_opts, data_opts);
+       return drop_extra_replicas_pred(c, arg, b->c.btree_id, 
bkey_i_to_s_c(&b->key),
+                                       io_opts, data_opts);
 }
 
 static bool scrub_pred(struct bch_fs *c, void *_arg,
-                      struct bkey_s_c k,
+                      enum btree_id btree, struct bkey_s_c k,
                       struct bch_io_opts *io_opts,
                       struct data_update_opts *data_opts)
 {
diff --git a/fs/bcachefs/move.h b/fs/bcachefs/move.h
index 1ab6dd4621d6..9c6c229e583e 100644
--- a/fs/bcachefs/move.h
+++ b/fs/bcachefs/move.h
@@ -72,7 +72,7 @@ do {                                                          
        \
                break;                                                  \
 } while (1)
 
-typedef bool (*move_pred_fn)(struct bch_fs *, void *, struct bkey_s_c,
+typedef bool (*move_pred_fn)(struct bch_fs *, void *, enum btree_id, struct 
bkey_s_c,
                             struct bch_io_opts *, struct data_update_opts *);
 
 extern const char * const bch2_data_ops_strs[];
diff --git a/fs/bcachefs/rebalance.c b/fs/bcachefs/rebalance.c
index d63de50f6323..2f0f8782105e 100644
--- a/fs/bcachefs/rebalance.c
+++ b/fs/bcachefs/rebalance.c
@@ -454,7 +454,7 @@ static int do_rebalance_extent(struct moving_context *ctxt,
 }
 
 static bool rebalance_pred(struct bch_fs *c, void *arg,
-                          struct bkey_s_c k,
+                          enum btree_id btree, struct bkey_s_c k,
                           struct bch_io_opts *io_opts,
                           struct data_update_opts *data_opts)
 {
-- 
2.49.0


Reply via email to