bcachefs: Add a cond_resched() to bch2_alloc_write()

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2020-08-12 15:08:17 -04:00 committed by Kent Overstreet
parent 2d8c0da1a7
commit f9adbb7d5d

View file

@ -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;