Whamcloud - gitweb
LU-12780 ofd: don't use ptlrpc_thread for consistency verification
The ofd module runs a consistency verification thread to verify parent
FID. Rather than using ptlrpc_thread to manage this, use native
kthreads functionality.
- startup-up code is moved out of the thread to before the
thread is started, which make error handling clearer.
As part of this, the lfsck_req_local struct is combined with
an lu_env and ofd_device pointer into a new oivm_args
which is passed to the thread a arguments - now it doesn't need
to allocate anything itself.
- Cleanup remains in the thread, so we add a completion to be
sure the thread has started before there is any chance of
kthread_stop() being called.
- kthread_stop() and kthread_should_stop() are used for stopping
the thread. wake_up_process() is used to wake it.
The thread sets TASK_IDLE at the top of the loop, and sets
TASK_RUNNING if anything is found to do. At the bottom of
the loop the 'schedule()' will only block if nothing was found
to be done.
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Iec1de307ea48f7d26c60edf5d86eb0b7bf78f49a
Reviewed-on: https://review.whamcloud.com/36262
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>