#include "funnel-workqueue.h"
#include <linux/atomic.h>
#include <linux/cache.h>
#include <linux/completion.h>
#include <linux/err.h>
#include <linux/kthread.h>
#include <linux/percpu.h>
#include "funnel-queue.h"
#include "logger.h"
#include "memory-alloc.h"
#include "numeric.h"
#include "permassert.h"
#include "string-utils.h"
#include "completion.h"
#include "status-codes.h"
static DEFINE_PER_CPU(unsigned int, service_queue_rotor);
struct vdo_work_queue { … };
struct simple_work_queue { … };
struct round_robin_work_queue { … };
static inline struct simple_work_queue *as_simple_work_queue(struct vdo_work_queue *queue)
{ … }
static inline struct round_robin_work_queue *as_round_robin_work_queue(struct vdo_work_queue *queue)
{ … }
static struct vdo_completion *poll_for_completion(struct simple_work_queue *queue)
{ … }
static void enqueue_work_queue_completion(struct simple_work_queue *queue,
struct vdo_completion *completion)
{ … }
static void run_start_hook(struct simple_work_queue *queue)
{ … }
static void run_finish_hook(struct simple_work_queue *queue)
{ … }
static struct vdo_completion *wait_for_next_completion(struct simple_work_queue *queue)
{ … }
static void process_completion(struct simple_work_queue *queue,
struct vdo_completion *completion)
{ … }
static void service_work_queue(struct simple_work_queue *queue)
{ … }
static int work_queue_runner(void *ptr)
{ … }
static void free_simple_work_queue(struct simple_work_queue *queue)
{ … }
static void free_round_robin_work_queue(struct round_robin_work_queue *queue)
{ … }
void vdo_free_work_queue(struct vdo_work_queue *queue)
{ … }
static int make_simple_work_queue(const char *thread_name_prefix, const char *name,
struct vdo_thread *owner, void *private,
const struct vdo_work_queue_type *type,
struct simple_work_queue **queue_ptr)
{ … }
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)
{ … }
static void finish_simple_work_queue(struct simple_work_queue *queue)
{ … }
static void finish_round_robin_work_queue(struct round_robin_work_queue *queue)
{ … }
void vdo_finish_work_queue(struct vdo_work_queue *queue)
{ … }
static void dump_simple_work_queue(struct simple_work_queue *queue)
{ … }
void vdo_dump_work_queue(struct vdo_work_queue *queue)
{ … }
static void get_function_name(void *pointer, char *buffer, size_t buffer_length)
{ … }
void vdo_dump_completion_to_buffer(struct vdo_completion *completion, char *buffer,
size_t length)
{ … }
void vdo_enqueue_work_queue(struct vdo_work_queue *queue,
struct vdo_completion *completion)
{ … }
static struct simple_work_queue *get_current_thread_work_queue(void)
{ … }
struct vdo_work_queue *vdo_get_current_work_queue(void)
{ … }
struct vdo_thread *vdo_get_work_queue_owner(struct vdo_work_queue *queue)
{ … }
void *vdo_get_work_queue_private_data(void)
{ … }
bool vdo_work_queue_type_is(struct vdo_work_queue *queue,
const struct vdo_work_queue_type *type)
{ … }