Lines Matching defs:worker
832 struct loop_worker *cur_worker, *worker = NULL;
847 worker = cur_worker;
855 if (worker)
858 worker = kzalloc(sizeof(struct loop_worker), GFP_NOWAIT | __GFP_NOWARN);
860 * In the event we cannot allocate a worker, just queue on the
861 * rootcg worker and issue the I/O as the rootcg
863 if (!worker) {
871 worker->blkcg_css = cmd->blkcg_css;
872 css_get(worker->blkcg_css);
873 INIT_WORK(&worker->work, loop_workfn);
874 INIT_LIST_HEAD(&worker->cmd_list);
875 INIT_LIST_HEAD(&worker->idle_list);
876 worker->lo = lo;
877 rb_link_node(&worker->rb_node, parent, node);
878 rb_insert_color(&worker->rb_node, &lo->worker_tree);
880 if (worker) {
884 * free the worker
886 if (!list_empty(&worker->idle_list))
887 list_del_init(&worker->idle_list);
888 work = &worker->work;
889 cmd_list = &worker->cmd_list;
906 struct loop_worker *pos, *worker;
909 list_for_each_entry_safe(worker, pos, &lo->idle_worker_list,
912 time_is_after_jiffies(worker->last_ran_at +
915 list_del(&worker->idle_list);
916 rb_erase(&worker->rb_node, &lo->worker_tree);
917 css_put(worker->blkcg_css);
918 kfree(worker);
1934 static void loop_process_work(struct loop_worker *worker,
1956 * *and* the worker will not run again which ensures that it
1957 * is safe to free any worker on the idle list
1959 if (worker && !work_pending(&worker->work)) {
1960 worker->last_ran_at = jiffies;
1961 list_add_tail(&worker->idle_list, &lo->idle_worker_list);
1970 struct loop_worker *worker =
1972 loop_process_work(worker, &worker->cmd_list, worker->lo);