Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / md / dm-vdo / funnel-workqueue.h
blobb5be6e9e83bca158fb536a2e9a9cc12767765098
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright 2023 Red Hat
4 */
6 #ifndef VDO_WORK_QUEUE_H
7 #define VDO_WORK_QUEUE_H
9 #include <linux/sched.h> /* for TASK_COMM_LEN */
11 #include "types.h"
13 enum {
14 MAX_VDO_WORK_QUEUE_NAME_LEN = TASK_COMM_LEN,
17 struct vdo_work_queue_type {
18 void (*start)(void *context);
19 void (*finish)(void *context);
20 enum vdo_completion_priority max_priority;
21 enum vdo_completion_priority default_priority;
24 struct vdo_completion;
25 struct vdo_thread;
26 struct vdo_work_queue;
28 int vdo_make_work_queue(const char *thread_name_prefix, const char *name,
29 struct vdo_thread *owner, const struct vdo_work_queue_type *type,
30 unsigned int thread_count, void *thread_privates[],
31 struct vdo_work_queue **queue_ptr);
33 void vdo_enqueue_work_queue(struct vdo_work_queue *queue, struct vdo_completion *completion);
35 void vdo_finish_work_queue(struct vdo_work_queue *queue);
37 void vdo_free_work_queue(struct vdo_work_queue *queue);
39 void vdo_dump_work_queue(struct vdo_work_queue *queue);
41 void vdo_dump_completion_to_buffer(struct vdo_completion *completion, char *buffer,
42 size_t length);
44 void *vdo_get_work_queue_private_data(void);
45 struct vdo_work_queue *vdo_get_current_work_queue(void);
46 struct vdo_thread *vdo_get_work_queue_owner(struct vdo_work_queue *queue);
48 bool __must_check vdo_work_queue_type_is(struct vdo_work_queue *queue,
49 const struct vdo_work_queue_type *type);
51 #endif /* VDO_WORK_QUEUE_H */