Lines Matching refs:works

171 	struct tsync_work **works;  member
199 ctx = s->works[s->size]; in tsync_works_provide()
222 struct tsync_work **works; in tsync_works_grow_by() local
232 works = krealloc_array(s->works, new_capacity, sizeof(s->works[0]), in tsync_works_grow_by()
234 if (!works) in tsync_works_grow_by()
237 s->works = works; in tsync_works_grow_by()
249 s->works[i] = work; in tsync_works_grow_by()
264 if (s->works[i]->task == task) in tsync_works_contains_task()
279 if (!s->works[i]->task) in tsync_works_release()
282 put_task_struct(s->works[i]->task); in tsync_works_release()
286 kfree(s->works[i]); in tsync_works_release()
287 kfree(s->works); in tsync_works_release()
288 s->works = NULL; in tsync_works_release()
296 static size_t count_additional_threads(const struct tsync_works *works) in count_additional_threads() argument
315 if (tsync_works_contains_task(works, thread)) in count_additional_threads()
333 static bool schedule_task_work(struct tsync_works *works, in schedule_task_work() argument
355 if (tsync_works_contains_task(works, thread)) in schedule_task_work()
365 ctx = tsync_works_provide(works, thread); in schedule_task_work()
409 static void cancel_tsync_works(struct tsync_works *works, in cancel_tsync_works() argument
414 for (i = 0; i < works->size; i++) { in cancel_tsync_works()
415 if (!task_work_cancel(works->works[i]->task, in cancel_tsync_works()
416 &works->works[i]->work)) in cancel_tsync_works()
437 struct tsync_works works = {}; in landlock_restrict_sibling_threads() local
488 newly_discovered_threads = count_additional_threads(&works); in landlock_restrict_sibling_threads()
493 err = tsync_works_grow_by(&works, newly_discovered_threads, in landlock_restrict_sibling_threads()
516 found_more_threads = schedule_task_work(&works, &shared_ctx); in landlock_restrict_sibling_threads()
533 cancel_tsync_works(&works, &shared_ctx); in landlock_restrict_sibling_threads()
558 tsync_works_release(&works); in landlock_restrict_sibling_threads()