mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
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:
parent
2d8c0da1a7
commit
f9adbb7d5d
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue