bcachefs: move_data_phys: stats are not required
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 4 Apr 2025 00:56:09 +0000 (20:56 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 22 May 2025 00:14:05 +0000 (20:14 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/move.c

index fe2fa665150bebde130747d744f959a1cb3c1442..a4678a205da640c5ba294424e375e7ac6617853a 100644 (file)
@@ -916,8 +916,10 @@ static int bch2_move_data_phys(struct bch_fs *c,
        bch2_trans_run(c, bch2_btree_write_buffer_flush_sync(trans));
 
        bch2_moving_ctxt_init(&ctxt, c, rate, stats, wp, wait_on_copygc);
-       ctxt.stats->phys = true;
-       ctxt.stats->data_type = (int) DATA_PROGRESS_DATA_TYPE_phys;
+       if (ctxt.stats) {
+               ctxt.stats->phys = true;
+               ctxt.stats->data_type = (int) DATA_PROGRESS_DATA_TYPE_phys;
+       }
 
        int ret = __bch2_move_data_phys(&ctxt, NULL, dev, start, end, data_types, pred, arg);
        bch2_moving_ctxt_exit(&ctxt);