File: funnel-workqueue.h

package info (click to toggle)
linux 6.18.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,742,096 kB
  • sloc: ansic: 26,781,576; asm: 272,087; sh: 148,750; python: 79,244; makefile: 57,741; perl: 36,527; xml: 19,542; cpp: 5,911; yacc: 4,939; lex: 2,950; awk: 1,607; sed: 30; ruby: 25
file content (51 lines) | stat: -rw-r--r-- 1,451 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright 2023 Red Hat
 */

#ifndef VDO_WORK_QUEUE_H
#define VDO_WORK_QUEUE_H

#include <linux/sched.h> /* for TASK_COMM_LEN */

#include "types.h"

enum {
	MAX_VDO_WORK_QUEUE_NAME_LEN = TASK_COMM_LEN,
};

struct vdo_work_queue_type {
	void (*start)(void *context);
	void (*finish)(void *context);
	enum vdo_completion_priority max_priority;
	enum vdo_completion_priority default_priority;
};

struct vdo_completion;
struct vdo_thread;
struct vdo_work_queue;

int vdo_make_work_queue(const char *thread_name_prefix, const char *name,
			struct vdo_thread *owner, const struct vdo_work_queue_type *type,
			unsigned int thread_count, void *thread_privates[],
			struct vdo_work_queue **queue_ptr);

void vdo_enqueue_work_queue(struct vdo_work_queue *queue, struct vdo_completion *completion);

void vdo_finish_work_queue(struct vdo_work_queue *queue);

void vdo_free_work_queue(struct vdo_work_queue *queue);

void vdo_dump_work_queue(struct vdo_work_queue *queue);

void vdo_dump_completion_to_buffer(struct vdo_completion *completion, char *buffer,
				   size_t length);

void *vdo_get_work_queue_private_data(void);
struct vdo_work_queue *vdo_get_current_work_queue(void);
struct vdo_thread *vdo_get_work_queue_owner(struct vdo_work_queue *queue);

bool __must_check vdo_work_queue_type_is(struct vdo_work_queue *queue,
					 const struct vdo_work_queue_type *type);

#endif /* VDO_WORK_QUEUE_H */