2023-11-17 00:47:35 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
|
|
|
* Copyright 2023 Red Hat
|
|
|
|
*/
|
|
|
|
|
2024-02-09 20:04:34 +00:00
|
|
|
#ifndef VDO_THREAD_REGISTRY_H
|
|
|
|
#define VDO_THREAD_REGISTRY_H
|
2023-11-17 00:47:35 +00:00
|
|
|
|
|
|
|
#include <linux/list.h>
|
|
|
|
#include <linux/spinlock.h>
|
|
|
|
|
|
|
|
struct thread_registry {
|
|
|
|
struct list_head links;
|
|
|
|
spinlock_t lock;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct registered_thread {
|
|
|
|
struct list_head links;
|
|
|
|
const void *pointer;
|
|
|
|
struct task_struct *task;
|
|
|
|
};
|
|
|
|
|
2024-02-09 20:04:34 +00:00
|
|
|
void vdo_initialize_thread_registry(struct thread_registry *registry);
|
2023-11-17 00:47:35 +00:00
|
|
|
|
2024-02-09 20:04:34 +00:00
|
|
|
void vdo_register_thread(struct thread_registry *registry,
|
2023-11-17 00:47:35 +00:00
|
|
|
struct registered_thread *new_thread, const void *pointer);
|
|
|
|
|
2024-02-09 20:04:34 +00:00
|
|
|
void vdo_unregister_thread(struct thread_registry *registry);
|
2023-11-17 00:47:35 +00:00
|
|
|
|
2024-02-09 20:04:34 +00:00
|
|
|
const void *vdo_lookup_thread(struct thread_registry *registry);
|
2023-11-17 00:47:35 +00:00
|
|
|
|
2024-02-09 20:04:34 +00:00
|
|
|
#endif /* VDO_THREAD_REGISTRY_H */
|