/* * Processing thread. * Currently one thread per tpg. */ int ft_thread(void *arg) { struct ft_tpg *tpg = arg; struct se_queue_obj *qobj = &tpg->qobj; struct ft_cmd *cmd; while (!kthread_should_stop()) { schedule_timeout_interruptible(MAX_SCHEDULE_TIMEOUT); if (kthread_should_stop()) goto out; cmd = ft_dequeue_cmd(qobj); if (cmd) ft_exec_req(cmd); } out: return 0; }
/* * Processing thread. * Currently one thread per tpg. */ int ft_thread(void *arg) { struct ft_tpg *tpg = arg; struct se_queue_obj *qobj = &tpg->qobj; struct ft_cmd *cmd; int ret; set_user_nice(current, -20); while (!kthread_should_stop()) { ret = wait_event_interruptible(qobj->thread_wq, atomic_read(&qobj->queue_cnt) || kthread_should_stop()); if (ret < 0 || kthread_should_stop()) goto out; cmd = ft_dequeue_cmd(qobj); if (cmd) ft_exec_req(cmd); } out: return 0; }