Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
IO allocation

Functions

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_get_instance (ocs_t *ocs, uint32_t index)
 return pointer to IO object given instance index More...
 

Function Details

ocs_io_t* ocs_io_get_instance ( ocs_t *  ocs,
uint32_t  index 
)

return pointer to IO object given instance index

A pointer to to an IO object is returned given an instance index.

Parameters
ocsdriver instance context
indexinstance index
Returns
returns pointer to IO object or NULL

Definition at line 301 of file ocs_io.c.

ocs_io_t* ocs_io_pool_io_alloc ( ocs_io_pool_t *  io_pool)

Allocate an object used to track an IO.

The algorithm locklessly allocates IO objects using an atomic increment with the following rules

  • at most check each object once for availability
  • IO objects are allocated sequentially
  • once the index is out of range, all callers will wait on the top level lock to serialize resetting the counter
  • objects are not required to complete in order
Parameters
io_poolpointer to IO Pool object
Returns
pointer to a new object, NULL if none available

Definition at line 242 of file ocs_io.c.

void ocs_io_pool_io_free ( ocs_io_pool_t *  io_pool,
ocs_io_t *  io 
)

Free an object used to track an IO.

Parameters
io_poolpointer to the IO Pool object
iopointer to the IO object

Definition at line 272 of file ocs_io.c.