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

IO class API. More...

Go to the source code of this file.

Data Structures

struct  ocf_io_class_info
 OCF IO class information. More...
 

Typedefs

typedef int(* ocf_io_class_visitor_t) (ocf_cache_t cache, uint32_t io_class_id, void *cntx)
 helper function for ocf_io_class_visit More...
 

Functions

int ocf_cache_io_class_get_info (ocf_cache_t cache, uint32_t io_class, struct ocf_io_class_info *info)
 retrieve io class info More...
 
int ocf_io_class_visit (ocf_cache_t cache, ocf_io_class_visitor_t visitor, void *cntx)
 enumerate all of the available IO classes. More...
 

Detailed Description

IO class API.

File contains structures and methods for handling IO Class differentiation features

Typedef Documentation

◆ ocf_io_class_visitor_t

typedef int(* ocf_io_class_visitor_t) (ocf_cache_t cache, uint32_t io_class_id, void *cntx)

helper function for ocf_io_class_visit

This function is called back from ocf_io_class_visit for each valid configured io class; henceforth all parameters are input parameters, no exceptions. It is usable to enumerate all the io classes.

Parameters
[in]cachecache id of cache for which data is being retrieved
[in]io_class_idid of an io class for which callback herein is invoked.
[in]cntxa context pointer passed herein from within ocf_io_class_visit down to this callback.
Returns
0 upon success; Nonzero upon failure (when nonzero is returned, this callback won't be invoked for any more io classes)

Function Documentation

◆ ocf_cache_io_class_get_info()

int ocf_cache_io_class_get_info ( ocf_cache_t  cache,
uint32_t  io_class,
struct ocf_io_class_info info 
)

retrieve io class info

function meant to retrieve information pertaining to particular IO class, specifically to fill ocf_io_class_info structure based on input parameters.

Parameters
[in]cachecache handle, to which specified request pertains.
[in]io_classid of an io class which shall be retreived.
[out]infoio class info structures to be filled as a result of this function call.
Returns
function returns 0 upon successful completion; appropriate error code is returned otherwise

◆ ocf_io_class_visit()

int ocf_io_class_visit ( ocf_cache_t  cache,
ocf_io_class_visitor_t  visitor,
void *  cntx 
)

enumerate all of the available IO classes.

This function allows enumeration and retrieval of all io class id's that are valid for given cache id via visiting all those with callback function that is supplied by caller.

Parameters
[in]cachecache id to which given call pertains
[in]visitora callback function that will be issued for each and every IO class that is configured and valid within given cache instance
[in]cntxa context variable - structure that shall be passed to a callback function for every call
Returns
0 upon successful completion of the function; otherwise nonzero result shall be returned