2023-11-16 19:47:35 -05:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
|
|
|
* Copyright 2023 Red Hat
|
|
|
|
*/
|
|
|
|
|
2024-02-09 14:04:34 -06:00
|
|
|
#ifndef VDO_THREAD_REGISTRY_H
|
|
|
|
#define VDO_THREAD_REGISTRY_H
|
2023-11-16 19:47:35 -05: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 14:04:34 -06:00
|
|
|
void vdo_initialize_thread_registry(struct thread_registry *registry);
|
2023-11-16 19:47:35 -05:00
|
|
|
|
2024-02-09 14:04:34 -06:00
|
|
|
void vdo_register_thread(struct thread_registry *registry,
|
2023-11-16 19:47:35 -05:00
|
|
|
struct registered_thread *new_thread, const void *pointer);
|
|
|
|
|
2024-02-09 14:04:34 -06:00
|
|
|
void vdo_unregister_thread(struct thread_registry *registry);
|
2023-11-16 19:47:35 -05:00
|
|
|
|
2024-02-09 14:04:34 -06:00
|
|
|
const void *vdo_lookup_thread(struct thread_registry *registry);
|
2023-11-16 19:47:35 -05:00
|
|
|
|
2024-02-09 14:04:34 -06:00
|
|
|
#endif /* VDO_THREAD_REGISTRY_H */
|