Open CAS Framework
Open source framework of Cache Acceleration Software
ocf_queue.h
Go to the documentation of this file.
1 /*
2  * Copyright(c) 2012-2020 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause-Clear
4  */
5 
6 #ifndef OCF_QUEUE_H_
7 #define OCF_QUEUE_H_
8 
17 struct ocf_queue_ops {
28  void (*kick)(ocf_queue_t q);
29 
40  void (*kick_sync)(ocf_queue_t q);
41 
47  void (*stop)(ocf_queue_t q);
48 };
49 
59 int ocf_queue_create(ocf_cache_t cache, ocf_queue_t *queue,
60  const struct ocf_queue_ops *ops);
61 
68 void ocf_queue_get(ocf_queue_t queue);
69 
78 void ocf_queue_put(ocf_queue_t queue);
79 
86 
93 
100 void ocf_queue_set_priv(ocf_queue_t q, void *priv);
101 
110 
119 
128 
129 #endif
struct ocf_cache * ocf_cache_t
handle to object designating ocf cache device
Definition: ocf_types.h:44
void ocf_queue_put(ocf_queue_t queue)
Decrease reference counter in queue.
void ocf_queue_run(ocf_queue_t q)
Run queue processing.
uint32_t ocf_queue_pending_io(ocf_queue_t q)
Get number of pending requests in I/O queue.
void * ocf_queue_get_priv(ocf_queue_t q)
Get queue private data.
void(* kick)(ocf_queue_t q)
Kick I/O queue processing.
Definition: ocf_queue.h:28
void ocf_queue_set_priv(ocf_queue_t q, void *priv)
Set queue private data.
void ocf_queue_get(ocf_queue_t queue)
Increase reference counter in queue.
struct ocf_queue * ocf_queue_t
handle to I/O queue
Definition: ocf_types.h:78
I/O queue operations.
Definition: ocf_queue.h:17
void(* stop)(ocf_queue_t q)
Stop I/O queue.
Definition: ocf_queue.h:47
ocf_cache_t ocf_queue_get_cache(ocf_queue_t q)
Get cache instance to which I/O queue belongs.
void ocf_queue_run_single(ocf_queue_t q)
Process single request from queue.
int ocf_queue_create(ocf_cache_t cache, ocf_queue_t *queue, const struct ocf_queue_ops *ops)
Allocate IO queue and add it to list in cache.
void(* kick_sync)(ocf_queue_t q)
Kick I/O queue processing.
Definition: ocf_queue.h:40