OCF library context API.  
More...
Go to the source code of this file.
◆ ctx_data_seek_t
Seeking start position in environment data buffer. 
| Enumerator | 
|---|
| ctx_data_seek_begin  | Seeking from the beginning of environment data buffer  
 | 
| ctx_data_seek_current  | Seeking from current position in environment data buffer  
 | 
 
 
◆ ocf_ctx_create()
Create and initialize OCF context. 
- Parameters
 - 
  
    | [out] | ctx | OCF context  | 
    | [in] | ops | OCF context operations | 
  
   
- Returns
 - Zero when success, otherwise an error 
 
 
 
◆ ocf_ctx_get()
Increase reference counter of ctx. 
- Parameters
 - 
  
  
 
 
 
◆ ocf_ctx_get_volume_type()
Get volume type operations by type id. 
- Parameters
 - 
  
    | [in] | ctx | OCF context  | 
    | [in] | type_id | Type id of volume operations which were registered | 
  
   
- Returns
 - Volume type 
 
- Return values
 - 
  
    | NULL | When volume operations were not registered for requested type  | 
  
   
 
 
◆ ocf_ctx_get_volume_type_id()
Get volume type id by type. 
- Parameters
 - 
  
    | [in] | ctx | OCF context  | 
    | [in] | type | Type of volume operations which were registered | 
  
   
- Returns
 - Volume type id 
 
- Return values
 - 
  
    | -1 | When volume operations were not registered for requested type  | 
  
   
 
 
◆ ocf_ctx_put()
Decrease reference counter of ctx. 
- Parameters
 - 
  
  
 
 
 
◆ ocf_ctx_register_volume_type()
Register volume interface. 
- Note
 - Type of volume operations is unique and cannot be repeated.
 
- Parameters
 - 
  
    | [in] | ctx | OCF context  | 
    | [in] | properties | Reference to volume properties  | 
    | [in] | type_id | Type id of volume operations | 
  
   
- Return values
 - 
  
    | 0 | Volume operations registered successfully  | 
    | Non-zero | Volume registration failure  | 
  
   
 
 
◆ ocf_ctx_unregister_volume_type()
      
        
          | void ocf_ctx_unregister_volume_type  | 
          ( | 
          ocf_ctx_t  | 
          ctx,  | 
        
        
           | 
           | 
          uint8_t  | 
          type_id  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Unregister volume interface. 
- Parameters
 - 
  
    | [in] | ctx | OCF context  | 
    | [in] | type_id | Type id of volume operations  | 
  
   
 
 
◆ ocf_ctx_volume_create()
Create volume of given type. 
- Parameters
 - 
  
    | [in] | ctx | handle to object designating ocf context  | 
    | [out] | volume | volume handle  | 
    | [in] | uuid | OCF volume UUID  | 
    | [in] | type_id | cache/core volume type id | 
  
   
- Returns
 - Zero when success, othewise en error