{
struct btrfs_root *root = arg;
+ set_freezable();
+
do {
int again = 0;
if (!try_to_freeze() && !again) {
set_current_state(TASK_INTERRUPTIBLE);
- if (!kthread_should_stop())
+ if (!kthread_freezable_should_stop(NULL))
schedule();
__set_current_state(TASK_RUNNING);
}
- } while (!kthread_should_stop());
+ } while (!kthread_freezable_should_stop(NULL));
return 0;
}
unsigned long delay;
bool cannot_commit;
+ set_freezable();
+
do {
cannot_commit = false;
delay = HZ * 30;
if (!try_to_freeze()) {
set_current_state(TASK_INTERRUPTIBLE);
- if (!kthread_should_stop() &&
+ if (!kthread_freezable_should_stop(NULL) &&
(!btrfs_transaction_blocked(root->fs_info) ||
cannot_commit))
schedule_timeout(delay);
__set_current_state(TASK_RUNNING);
}
- } while (!kthread_should_stop());
+ } while (!kthread_freezable_should_stop(NULL));
return 0;
}