summaryrefslogtreecommitdiff
path: root/fs/bcachefs/move.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-03-18 00:42:09 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:51 -0400
commit8e3f913e2ab6ac2cb9e75a0a8635d0b44f838c33 (patch)
tree935cb6aa90e9ef93b1508be5f0c81f2f06ad8c3f /fs/bcachefs/move.h
parenta8c752bb1d93a24a0de753e209d4f4d58d65c878 (diff)
downloadlwn-8e3f913e2ab6ac2cb9e75a0a8635d0b44f838c33.tar.gz
lwn-8e3f913e2ab6ac2cb9e75a0a8635d0b44f838c33.zip
bcachefs: Copygc now uses backpointers
Previously, copygc needed to walk the entire extents & reflink btrees to find extents that needed to be moved. Now that we have backpointers, this patch implements bch2_evacuate_bucket() in the move code, which copygc now uses for evacuating mostly empty buckets. Also, thanks to the new backpointers code, copygc can now move btree nodes. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/move.h')
-rw-r--r--fs/bcachefs/move.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/bcachefs/move.h b/fs/bcachefs/move.h
index 2eb6a15542e0..b14f679f6904 100644
--- a/fs/bcachefs/move.h
+++ b/fs/bcachefs/move.h
@@ -15,6 +15,7 @@ struct moving_context {
struct bch_move_stats *stats;
struct write_point_specifier wp;
bool wait_on_copygc;
+ bool write_error;
/* For waiting on outstanding reads and writes: */
struct closure cl;
@@ -46,6 +47,15 @@ int bch2_move_data(struct bch_fs *,
bool,
move_pred_fn, void *);
+int __bch2_evacuate_bucket(struct moving_context *,
+ struct bpos, int,
+ struct data_update_opts);
+int bch2_evacuate_bucket(struct bch_fs *, struct bpos, int,
+ struct data_update_opts,
+ struct bch_ratelimit *,
+ struct bch_move_stats *,
+ struct write_point_specifier,
+ bool);
int bch2_data_job(struct bch_fs *,
struct bch_move_stats *,
struct bch_ioctl_data);