
static void io_sq_thread_stop(struct io_sq_data *sqd)
{
	if (test_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state))
		return;
	mutex_lock(&sqd->lock);
	if (sqd->thread) {
		set_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state);
		WARN_ON_ONCE(test_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state));
		wake_up_process(sqd->thread);
		mutex_unlock(&sqd->lock);
		wait_for_completion(&sqd->exited);
		WARN_ON_ONCE(sqd->thread);
	} else {
		mutex_unlock(&sqd->lock);
	}

static void io_sq_thread_stop(struct io_sq_data *sqd)
{
	if (test_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state))
		return;
	mutex_lock(&sqd->lock);
	if (sqd->thread) {
		set_bit(IO_SQ_THREAD_SHOULD_STOP, &sqd->state);
		WARN_ON_ONCE(test_bit(IO_SQ_THREAD_SHOULD_PARK, &sqd->state));
		wake_up_process(sqd->thread);
		mutex_unlock(&sqd->lock);
		wait_for_completion(&sqd->exited);
		WARN_ON_ONCE(sqd->thread);
	} else {
		mutex_unlock(&sqd->lock);
	}