Request Queues

Name

Request Queues -- IO Request Queue Handling.

Synopsis


typedef     io_queue_t;
#define     DECLARE_IO_QUEUE                (queue)
#define     io_queue_empty                  (queue)
#define     io_request_data                 (element)
#define     io_queue_next                   (element)
#define     io_queue_len                    (queue)
#define     io_queue_init                   (queue)
#define     io_queue_foreach                (queue, func, data)
#define     io_queue_concat                 (dest, orig1, orig2)
#define     io_queue_remove                 (queue, request)
#define     io_queue_append                 (queue, request)
#define     io_queue_end                    (element)

Description

This are the functions to use when working with any queue of requests in the IO subsystem.

Details

io_queue_t


DECLARE_IO_QUEUE()

#define     DECLARE_IO_QUEUE(queue)

Declares a new and empty request queue with name queue.

queue : name for the queue.


io_queue_empty()

#define     io_queue_empty(queue)

Is queue empty?

queue : request queue involved.


io_request_data()

#define     io_request_data(element)

Retrives the request data from the queue element.

element : request queue element involved.


io_queue_next()

#define     io_queue_next(element)

Gets the next element on the queue starting at element.

element : request queue element involved.


io_queue_len()

#define     io_queue_len(queue)

Calculate the number of elements on queue.

queue : request queue involved.


io_queue_init()

#define     io_queue_init(queue)

Initializes request queue queue.

Note: applyed to a non empty queue will loose all its elements.

queue : request queue involved.


io_queue_foreach()

#define     io_queue_foreach(queue, func, data)

Will call func for every request on queue using the request pointer as the first arguemt and data as the second.

queue : request queue involved.
func : function to be called.
data : second argument to func.


io_queue_concat()

#define     io_queue_concat(dest, orig1, orig2)

Concatenates orig1 and orig2 into dest.

dest : Target queue.
orig1 : First source queue.
orig2 : Second source queue.


io_queue_remove()

#define     io_queue_remove(queue, request)

Remove request from queue.

queue : request queue involved.
request : request to be removed.


io_queue_append()

#define     io_queue_append(queue, request)

Append request to queue.

queue : request queue involved.
request : request to be appended.


io_queue_end()

#define io_queue_end(element) io_queue_empty(element)

Is this element the end of the queue?

element : request queue element involved.