Open CAS Framework
Open source framework of Cache Acceleration Software
Data Structures | Typedefs | Functions
ocf_io.h File Reference

OCF IO definitions. More...

#include "ocf_types.h"

Go to the source code of this file.

Data Structures

struct  ocf_io
 OCF IO main structure. More...
 
struct  ocf_io_ops
 OCF IO operations set structure. More...
 

Typedefs

typedef void(* ocf_start_io_t) (struct ocf_io *io)
 OCF IO start. More...
 
typedef void(* ocf_handle_io_t) (struct ocf_io *io, void *opaque)
 OCF IO handle. More...
 
typedef void(* ocf_end_io_t) (struct ocf_io *io, int error)
 OCF IO completion. More...
 

Functions

void * ocf_io_get_priv (struct ocf_io *io)
 Get IO private context structure. More...
 
void ocf_io_get (struct ocf_io *io)
 Increase reference counter in OCF IO. More...
 
void ocf_io_put (struct ocf_io *io)
 Decrease reference counter in OCF IO. More...
 
int ocf_io_set_data (struct ocf_io *io, ctx_data_t *data, uint32_t offset)
 Set up data vector in OCF IO. More...
 
ctx_data_tocf_io_get_data (struct ocf_io *io)
 Get data vector from OCF IO. More...
 
void ocf_io_handle (struct ocf_io *io, void *opaque)
 Handle IO in cache engine. More...
 
ocf_volume_t ocf_io_get_volume (struct ocf_io *io)
 Get volume associated with io. More...
 

Detailed Description

OCF IO definitions.

Typedef Documentation

◆ ocf_end_io_t

typedef void(* ocf_end_io_t) (struct ocf_io *io, int error)

OCF IO completion.

Note
Completion function for OCF IO
Parameters
[in]ioOCF IO being completed
[in]errorCompletion status code

◆ ocf_handle_io_t

typedef void(* ocf_handle_io_t) (struct ocf_io *io, void *opaque)

OCF IO handle.

Note
OCF IO handle callback
Parameters
[in]ioOCF IO to handle

◆ ocf_start_io_t

typedef void(* ocf_start_io_t) (struct ocf_io *io)

OCF IO start.

Note
OCF IO start notification callback
Parameters
[in]ioOCF IO being started

Function Documentation

◆ ocf_io_get()

void ocf_io_get ( struct ocf_io io)

Increase reference counter in OCF IO.

Note
Wrapper for get IO operation
Parameters
[in]ioOCF IO

◆ ocf_io_get_data()

ctx_data_t* ocf_io_get_data ( struct ocf_io io)

Get data vector from OCF IO.

Note
Wrapper for get data vector function
Parameters
[in]ioOCF IO to get data
Returns
Data vector from IO

◆ ocf_io_get_priv()

void* ocf_io_get_priv ( struct ocf_io io)

Get IO private context structure.

Parameters
[in]ioOCF IO
Returns
IO private context structure

◆ ocf_io_get_volume()

ocf_volume_t ocf_io_get_volume ( struct ocf_io io)

Get volume associated with io.

Parameters
[in]ioOCF IO to be handled

◆ ocf_io_handle()

void ocf_io_handle ( struct ocf_io io,
void *  opaque 
)

Handle IO in cache engine.

Parameters
[in]ioOCF IO to be handled
[in]opaqueOCF opaque

◆ ocf_io_put()

void ocf_io_put ( struct ocf_io io)

Decrease reference counter in OCF IO.

Note
If IO don't have any reference - deallocate it
Parameters
[in]ioOCF IO

◆ ocf_io_set_data()

int ocf_io_set_data ( struct ocf_io io,
ctx_data_t data,
uint32_t  offset 
)

Set up data vector in OCF IO.

Note
Wrapper for set up data vector function
Parameters
[in]ioOCF IO to set up
[in]dataSource data vector
[in]offsetData offset in source data vector
Return values
0Data set up successfully
Non-zeroData set up failure