From c2fcff5973c93af7ffa87ad28eca2fddd2be83c5 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 25 Sep 2018 23:27:57 -0400 Subject: bcachefs: Fix suspend when moving data faster than ratelimit Signed-off-by: Kent Overstreet --- fs/bcachefs/util.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'fs/bcachefs/util.c') diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index 6666c3aed05f..75053322d0f0 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -424,27 +424,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: */ /* -- cgit v1.2.3