thread-registry.h 729 B

1234567891011121314151617181920212223242526272829303132
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright 2023 Red Hat
  4. */
  5. #ifndef VDO_THREAD_REGISTRY_H
  6. #define VDO_THREAD_REGISTRY_H
  7. #include <linux/list.h>
  8. #include <linux/spinlock.h>
  9. struct thread_registry {
  10. struct list_head links;
  11. spinlock_t lock;
  12. };
  13. struct registered_thread {
  14. struct list_head links;
  15. const void *pointer;
  16. struct task_struct *task;
  17. };
  18. void vdo_initialize_thread_registry(struct thread_registry *registry);
  19. void vdo_register_thread(struct thread_registry *registry,
  20. struct registered_thread *new_thread, const void *pointer);
  21. void vdo_unregister_thread(struct thread_registry *registry);
  22. const void *vdo_lookup_thread(struct thread_registry *registry);
  23. #endif /* VDO_THREAD_REGISTRY_H */