*/
static int capa_thread_main(void *unused)
{
- struct obd_capa *ocapa, *tmp, *next;
- struct inode *inode = NULL;
- struct l_wait_info lwi = { 0 };
- int rc;
- ENTRY;
-
- cfs_daemonize("ll_capa");
+ struct obd_capa *ocapa, *tmp, *next;
+ struct inode *inode = NULL;
+ struct l_wait_info lwi = { 0 };
+ int rc;
+ ENTRY;
- thread_set_flags(&ll_capa_thread, SVC_RUNNING);
- cfs_waitq_signal(&ll_capa_thread.t_ctl_waitq);
+ thread_set_flags(&ll_capa_thread, SVC_RUNNING);
+ wake_up(&ll_capa_thread.t_ctl_waitq);
- while (1) {
- l_wait_event(ll_capa_thread.t_ctl_waitq,
- !thread_is_running(&ll_capa_thread) ||
- have_expired_capa(),
- &lwi);
+ while (1) {
+ l_wait_event(ll_capa_thread.t_ctl_waitq,
+ !thread_is_running(&ll_capa_thread) ||
+ have_expired_capa(),
+ &lwi);
if (!thread_is_running(&ll_capa_thread))
break;
}
thread_set_flags(&ll_capa_thread, SVC_STOPPED);
- cfs_waitq_signal(&ll_capa_thread.t_ctl_waitq);
+ wake_up(&ll_capa_thread.t_ctl_waitq);
RETURN(0);
}
void ll_capa_timer_callback(unsigned long unused)
{
- cfs_waitq_signal(&ll_capa_thread.t_ctl_waitq);
+ wake_up(&ll_capa_thread.t_ctl_waitq);
}
int ll_capa_thread_start(void)
{
- int rc;
- ENTRY;
+ struct task_struct *task;
+ ENTRY;
- cfs_waitq_init(&ll_capa_thread.t_ctl_waitq);
+ init_waitqueue_head(&ll_capa_thread.t_ctl_waitq);
- rc = cfs_create_thread(capa_thread_main, NULL, 0);
- if (rc < 0) {
- CERROR("cannot start expired capa thread: rc %d\n", rc);
- RETURN(rc);
- }
- cfs_wait_event(ll_capa_thread.t_ctl_waitq,
- thread_is_running(&ll_capa_thread));
+ task = kthread_run(capa_thread_main, NULL, "ll_capa");
+ if (IS_ERR(task)) {
+ CERROR("cannot start expired capa thread: rc %ld\n",
+ PTR_ERR(task));
+ RETURN(PTR_ERR(task));
+ }
+ wait_event(ll_capa_thread.t_ctl_waitq,
+ thread_is_running(&ll_capa_thread));
- RETURN(0);
+ RETURN(0);
}
void ll_capa_thread_stop(void)
{
- thread_set_flags(&ll_capa_thread, SVC_STOPPING);
- cfs_waitq_signal(&ll_capa_thread.t_ctl_waitq);
- cfs_wait_event(ll_capa_thread.t_ctl_waitq,
- thread_is_stopped(&ll_capa_thread));
+ thread_set_flags(&ll_capa_thread, SVC_STOPPING);
+ wake_up(&ll_capa_thread.t_ctl_waitq);
+ wait_event(ll_capa_thread.t_ctl_waitq,
+ thread_is_stopped(&ll_capa_thread));
}
struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc)