staging: lustre: change sai_thread to sai_task.
authorNeilBrown <neilb@suse.com>
Thu, 1 Mar 2018 23:31:25 +0000 (10:31 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Mar 2018 12:20:23 +0000 (04:20 -0800)
commit165020462d26d6925cbd2d25dfbd4ff1a8fba103
treed5b64c70824e91118eedf3ed48f6aea607dcaa0f
parentc044fb0f835c6afe10d10b6cf4f2c5a154b1489d
staging: lustre: change sai_thread to sai_task.

Rather than allocating a ptlrpc_thread for the
stat-ahead thread, just use the task_struct provided
by kthreads directly.

As nothing ever waits for the sai_task, it must call do_exit()
directly rather than simply return from the function.
Also it cannot use kthread_should_stop() to know when to stop.

There is one caller which can ask it to stop so we need a simple
signaling mechanism.  I've chosen to set ->sai_task to NULL
when the thread should finish up.  The thread notices this and
cleans up and exits.
lli_sa_lock is used to avoid races between waking up the process
and the process exiting.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/llite_internal.h
drivers/staging/lustre/lustre/llite/statahead.c