Open CAS Framework
Open source framework of Cache Acceleration Software
|
OCF cache API. More...
Go to the source code of this file.
Data Structures | |
struct | ocf_cache_info |
Cache info: configuration, status. More... | |
Functions | |
ocf_volume_t | ocf_cache_get_volume (ocf_cache_t cache) |
Obtain volume from cache. More... | |
const char * | ocf_cache_get_name (ocf_cache_t cache) |
Get name of given cache object. More... | |
bool | ocf_cache_is_incomplete (ocf_cache_t cache) |
Check is cache in incomplete state. More... | |
bool | ocf_cache_is_device_attached (ocf_cache_t cache) |
Check if caching device is attached. More... | |
bool | ocf_cache_is_running (ocf_cache_t cache) |
Check if cache object is running. More... | |
ocf_cache_mode_t | ocf_cache_get_mode (ocf_cache_t cache) |
Get cache mode of given cache object. More... | |
ocf_cache_line_size_t | ocf_cache_get_line_size (ocf_cache_t cache) |
Get cache line size of given cache object. More... | |
uint64_t | ocf_cache_bytes_2_lines (ocf_cache_t cache, uint64_t bytes) |
Convert bytes to cache lines. More... | |
uint32_t | ocf_cache_get_core_count (ocf_cache_t cache) |
Get core count of given cache object. More... | |
int | ocf_cache_get_info (ocf_cache_t cache, struct ocf_cache_info *info) |
Get cache mode of given cache object. More... | |
const struct ocf_volume_uuid * | ocf_cache_get_uuid (ocf_cache_t cache) |
Get UUID of volume associated with cache. More... | |
ocf_ctx_t | ocf_cache_get_ctx (ocf_cache_t cache) |
Get OCF context of given cache object. More... | |
uint8_t | ocf_cache_get_type_id (ocf_cache_t cache) |
Get volume type id of given cache object. More... | |
void | ocf_cache_set_priv (ocf_cache_t cache, void *priv) |
Set cache private data. More... | |
void * | ocf_cache_get_priv (ocf_cache_t cache) |
Get cache private data. More... | |
OCF cache API.
uint64_t ocf_cache_bytes_2_lines | ( | ocf_cache_t | cache, |
uint64_t | bytes | ||
) |
Convert bytes to cache lines.
[in] | cache | Cache object |
[in] | bytes | Number of bytes |
Cache | lines count |
uint32_t ocf_cache_get_core_count | ( | ocf_cache_t | cache | ) |
Get core count of given cache object.
[in] | cache | Cache object |
Core | count |
ocf_ctx_t ocf_cache_get_ctx | ( | ocf_cache_t | cache | ) |
Get OCF context of given cache object.
[in] | cache | Cache object |
OCF | context |
int ocf_cache_get_info | ( | ocf_cache_t | cache, |
struct ocf_cache_info * | info | ||
) |
Get cache mode of given cache object.
[in] | cache | Cache object |
[out] | info | Cache info structure |
0 | Success |
Non-zero | Fail |
ocf_cache_line_size_t ocf_cache_get_line_size | ( | ocf_cache_t | cache | ) |
Get cache line size of given cache object.
[in] | cache | Cache object |
Cache | line size |
ocf_cache_mode_t ocf_cache_get_mode | ( | ocf_cache_t | cache | ) |
Get cache mode of given cache object.
[in] | cache | Cache object |
Cache | mode |
const char* ocf_cache_get_name | ( | ocf_cache_t | cache | ) |
Get name of given cache object.
[in] | cache | Cache object |
Cache | name |
void* ocf_cache_get_priv | ( | ocf_cache_t | cache | ) |
Get cache private data.
[in] | cache | Cache object |
Private | data |
uint8_t ocf_cache_get_type_id | ( | ocf_cache_t | cache | ) |
Get volume type id of given cache object.
[in] | cache | Cache object |
volume | type id, -1 if device detached |
const struct ocf_volume_uuid* ocf_cache_get_uuid | ( | ocf_cache_t | cache | ) |
Get UUID of volume associated with cache.
[in] | cache | Cache object |
Volume | UUID, NULL if detached. |
ocf_volume_t ocf_cache_get_volume | ( | ocf_cache_t | cache | ) |
Obtain volume from cache.
[in] | cache | Cache object |
Volume,NULL | if dettached. |
bool ocf_cache_is_device_attached | ( | ocf_cache_t | cache | ) |
Check if caching device is attached.
[in] | cache | Cache object |
1 | Caching device is attached |
0 | Caching device is detached |
bool ocf_cache_is_incomplete | ( | ocf_cache_t | cache | ) |
Check is cache in incomplete state.
[in] | cache | Cache object |
1 | Cache is in incomplete state |
0 | Cache is in complete state |
bool ocf_cache_is_running | ( | ocf_cache_t | cache | ) |
Check if cache object is running.
[in] | cache | Cache object |
1 | Caching device is being stopped |
0 | Caching device is being stopped |
void ocf_cache_set_priv | ( | ocf_cache_t | cache, |
void * | priv | ||
) |
Set cache private data.
[in] | cache | Cache object |
[in] | priv | Private data |