Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_io.h File Reference

Go to the source code of this file.

Detailed Description

OCS linux driver IO declarations

Definition in file ocs_io.h.

Data Structures

struct  ocs_io_t
 

Macros

#define io_error_log(io, fmt,...)
 

Functions

static int32_t ocs_io_busy (ocs_io_t *io)
 Test if IO object is busy. More...
 
ocs_io_pool_t * ocs_io_pool_create (ocs_t *ocs, uint32_t num_io, uint32_t num_sgl)
 Create a pool of IO objects. More...
 
int32_t ocs_io_pool_free (ocs_io_pool_t *io_pool)
 Free IO objects pool. More...
 
uint32_t ocs_io_pool_allocated (ocs_io_pool_t *io_pool)
 
ocs_io_t * ocs_io_get_instance (ocs_t *ocs, uint32_t instance_idx)
 return pointer to IO object given instance index More...
 
ocs_io_t * ocs_io_pool_io_alloc (ocs_io_pool_t *io_pool)
 Allocate an object used to track an IO. More...
 
void ocs_io_pool_io_free (ocs_io_pool_t *io_pool, ocs_io_t *io)
 Free an object used to track an IO. More...
 
ocs_io_t * ocs_io_find (ocs_t *ocs, ocs_node_t *node, uint32_t ox_id)
 
void ocs_ddump_io (ocs_textbuf_t *textbuf, ocs_io_t *io)
 generate IO context ddump data More...
 

Macro Details

#define io_error_log (   io,
  fmt,
  ... 
)
Value:
do { \
if (OCS_LOG_ENABLE_IO_ERRORS(io->ocs)) \
ocs_log_warn(io->ocs, fmt, ##__VA_ARGS__); \
} while (0)
#define OCS_LOG_ENABLE_IO_ERRORS(ocs)
Definition: ocs_debug.h:75
const char const char * fmt
Definition: ocs_ddump.h:54

Definition at line 41 of file ocs_io.h.

Function Details

void ocs_ddump_io ( ocs_textbuf_t *  textbuf,
ocs_io_t *  io 
)

generate IO context ddump data

The ddump data for an IO context is generated

Parameters
textbufpointer to text buffer
iopointer to IO context
Returns
none

Definition at line 330 of file ocs_io.c.

static int32_t ocs_io_busy ( ocs_io_t *  io)
inlinestatic

Test if IO object is busy.

Return True if IO object is busy. Busy is defined as the IO object not being on the free list (io->io_alloc_link not being on any list)

Parameters
ioPointer to IO object
Returns
returns True if IO is busy

Definition at line 129 of file ocs_io.h.

ocs_io_t* ocs_io_find ( ocs_t *  ocs,
ocs_node_t *  node,
uint32_t  ox_id 
)
uint32_t ocs_io_pool_allocated ( ocs_io_pool_t *  io_pool)

Definition at line 220 of file ocs_io.c.

ocs_io_pool_t* ocs_io_pool_create ( ocs_t *  ocs,
uint32_t  num_io,
uint32_t  num_sgl 
)

Create a pool of IO objects.

Parameters
ocsthe driver instance's software context
num_ionumber of IO context's to allocate
num_sglnumber of SGL entries to allocate for each IO
Returns
0 on success, non-zero otherwise

Definition at line 90 of file ocs_io.c.

int32_t ocs_io_pool_free ( ocs_io_pool_t *  io_pool)

Free IO objects pool.

The pool of IO objects are freed

Parameters
io_poolpointer to IO Pool object
Returns
returns 0 for success, a negative error code value for failure.

Definition at line 181 of file ocs_io.c.