summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-08-12 15:08:17 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2020-10-21 15:33:14 -0400
commitc7d28a28723b51d93266c4e55423a467fbc45a74 (patch)
tree199a943f017810348da6b701731faead3059e9e3
parentd3e7c7a9dac411c2be338a35d77bdd534158a985 (diff)
bcachefs: Add a cond_resched() to bch2_alloc_write()
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/alloc_background.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/alloc_background.c b/fs/bcachefs/alloc_background.c
index 43b9f99194b9..9aa0b42b26b6 100644
--- a/fs/bcachefs/alloc_background.c
+++ b/fs/bcachefs/alloc_background.c
@@ -350,6 +350,8 @@ int bch2_alloc_write(struct bch_fs *c, unsigned flags, bool *wrote)
bch2_btree_iter_set_pos(iter, POS(i, first_bucket));
while (1) {
+ bch2_trans_cond_resched(&trans);
+
ret = bch2_alloc_write_key(&trans, iter, flags);
if (ret < 0 || ret == ALLOC_END)
break;