diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-09-25 23:27:57 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2018-09-27 17:33:12 -0400 |
commit | 9c64d044ccd936574c668125a5c00be2d381c1ce (patch) | |
tree | f11af6d51ffe25ee4d6350bac5006d0769323621 /fs/bcachefs/util.c | |
parent | 2fe17e38d355271a8212a8123a9281e2f9df811f (diff) |
bcachefs: Fix suspend when moving data faster than ratelimit
Diffstat (limited to 'fs/bcachefs/util.c')
-rw-r--r-- | fs/bcachefs/util.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 1272ea7a7a28..5cfaed5b305c 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -421,27 +421,6 @@ void bch2_ratelimit_increment(struct bch_ratelimit *d, u64 done) d->next = now - NSEC_PER_SEC * 2; } -int bch2_ratelimit_wait_freezable_stoppable(struct bch_ratelimit *d) -{ - bool kthread = (current->flags & PF_KTHREAD) != 0; - - while (1) { - u64 delay = bch2_ratelimit_delay(d); - - if (delay) - set_current_state(TASK_INTERRUPTIBLE); - - if (kthread && kthread_should_stop()) - return 1; - - if (!delay) - return 0; - - schedule_timeout(delay); - try_to_freeze(); - } -} - /* pd controller: */ /* |