Open CAS Framework
Open source framework of Cache Acceleration Software
|
OCF management operations definitions. More...
Go to the source code of this file.
Data Structures | |
struct | ocf_mngt_core_config |
Core start configuration. More... | |
struct | ocf_mngt_cache_config |
Cache start configuration. More... | |
struct | ocf_mngt_cache_device_config |
Cache attach configuration. More... | |
struct | ocf_mngt_io_class_config |
IO class configuration. More... | |
struct | ocf_mngt_io_classes_config |
Typedefs | |
typedef void(* | ocf_mngt_cache_lock_end_t) (ocf_cache_t cache, void *priv, int error) |
Lock cache for management oparations (write lock, exclusive) More... | |
typedef int(* | ocf_mngt_cache_visitor_t) (ocf_cache_t cache, void *cntx) |
Cache visitor function. More... | |
typedef void(* | ocf_mngt_cache_stop_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache stop operation. More... | |
typedef void(* | ocf_mngt_cache_attach_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache attach operation. More... | |
typedef void(* | ocf_mngt_cache_detach_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache detach operation. More... | |
typedef void(* | ocf_mngt_cache_load_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache load operation. More... | |
typedef void(* | ocf_mngt_cache_add_core_end_t) (ocf_cache_t cache, ocf_core_t core, void *priv, int error) |
Completion callback of add core operation. More... | |
typedef void(* | ocf_mngt_cache_remove_core_end_t) (void *priv, int error) |
Completion callback of remove core operation. More... | |
typedef void(* | ocf_mngt_cache_detach_core_end_t) (void *priv, int error) |
Completion callback of detach core operation. More... | |
typedef void(* | ocf_mngt_cache_flush_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache flush operation. More... | |
typedef void(* | ocf_mngt_core_flush_end_t) (ocf_core_t core, void *priv, int error) |
Completion callback of core flush operation. More... | |
typedef void(* | ocf_mngt_cache_purge_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache purge operation. More... | |
typedef void(* | ocf_mngt_core_purge_end_t) (ocf_core_t core, void *priv, int error) |
Completion callback of core purge operation. More... | |
typedef void(* | ocf_mngt_cache_save_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of save operation. More... | |
Functions | |
uint32_t | ocf_mngt_cache_get_count (ocf_ctx_t ctx) |
Get number of OCF caches. More... | |
int | ocf_mngt_cache_get_by_name (ocf_ctx_t ctx, const char *name, size_t name_len, ocf_cache_t *cache) |
Get OCF cache by name. More... | |
int | ocf_mngt_cache_get (ocf_cache_t cache) |
Increment reference counter of cache. More... | |
void | ocf_mngt_cache_put (ocf_cache_t cache) |
Decrease reference counter in cache. More... | |
void | ocf_mngt_cache_lock (ocf_cache_t cache, ocf_mngt_cache_lock_end_t cmpl, void *priv) |
Lock cache for management oparations (write lock, exclusive) More... | |
void | ocf_mngt_cache_read_lock (ocf_cache_t cache, ocf_mngt_cache_lock_end_t cmpl, void *priv) |
Lock cache for read - assures cache config does not change while lock is being held, while allowing other users to acquire read lock in parallel. More... | |
int | ocf_mngt_cache_trylock (ocf_cache_t cache) |
Lock cache for management oparations (write lock, exclusive) More... | |
int | ocf_mngt_cache_read_trylock (ocf_cache_t cache) |
Lock cache for read - assures cache config does not change while lock is being held, while allowing other users to acquire read lock in parallel. More... | |
void | ocf_mngt_cache_unlock (ocf_cache_t cache) |
Write-unlock cache. More... | |
void | ocf_mngt_cache_read_unlock (ocf_cache_t cache) |
Read-unlock cache. More... | |
int | ocf_mngt_cache_visit (ocf_ctx_t ctx, ocf_mngt_cache_visitor_t visitor, void *cntx) |
Loop for each cache. More... | |
int | ocf_mngt_cache_visit_reverse (ocf_ctx_t ctx, ocf_mngt_cache_visitor_t visitor, void *cntx) |
Loop for each cache reverse. More... | |
int | ocf_mngt_cache_start (ocf_ctx_t ctx, ocf_cache_t *cache, struct ocf_mngt_cache_config *cfg) |
Start cache instance. More... | |
int | ocf_mngt_cache_set_mngt_queue (ocf_cache_t cache, ocf_queue_t queue) |
Set queue to be used during management operations. More... | |
void | ocf_mngt_cache_stop (ocf_cache_t cache, ocf_mngt_cache_stop_end_t cmpl, void *priv) |
Stop cache instance. More... | |
int | ocf_mngt_get_ram_needed (ocf_cache_t cache, struct ocf_mngt_cache_device_config *cfg, uint64_t *ram_needed) |
Get amount of free RAM needed to attach cache volume. More... | |
void | ocf_mngt_cache_attach (ocf_cache_t cache, struct ocf_mngt_cache_device_config *cfg, ocf_mngt_cache_attach_end_t cmpl, void *priv) |
Attach caching device to cache instance. More... | |
void | ocf_mngt_cache_detach (ocf_cache_t cache, ocf_mngt_cache_detach_end_t cmpl, void *priv) |
Detach caching cache. More... | |
void | ocf_mngt_cache_load (ocf_cache_t cache, struct ocf_mngt_cache_device_config *cfg, ocf_mngt_cache_load_end_t cmpl, void *priv) |
Load cache instance. More... | |
void | ocf_mngt_cache_add_core (ocf_cache_t cache, struct ocf_mngt_core_config *cfg, ocf_mngt_cache_add_core_end_t cmpl, void *priv) |
Add core to cache instance. More... | |
void | ocf_mngt_cache_remove_core (ocf_core_t core, ocf_mngt_cache_remove_core_end_t cmpl, void *priv) |
Remove core from cache instance. More... | |
void | ocf_mngt_cache_detach_core (ocf_core_t core, ocf_mngt_cache_detach_core_end_t cmpl, void *priv) |
Detach core from cache instance. More... | |
void | ocf_mngt_cache_flush (ocf_cache_t cache, ocf_mngt_cache_flush_end_t cmpl, void *priv) |
Flush data from given cache. More... | |
bool | ocf_mngt_core_is_dirty (ocf_core_t core) |
Check if core is dirty. More... | |
bool | ocf_mngt_cache_is_dirty (ocf_cache_t cache) |
Check if cache is dirty. More... | |
void | ocf_mngt_core_flush (ocf_core_t core, ocf_mngt_core_flush_end_t cmpl, void *priv) |
Flush data to given core. More... | |
void | ocf_mngt_cache_purge (ocf_cache_t cache, ocf_mngt_cache_purge_end_t cmpl, void *priv) |
Purge data from given cache. More... | |
void | ocf_mngt_core_purge (ocf_core_t core, ocf_mngt_core_purge_end_t cmpl, void *priv) |
Purge data to given core. More... | |
void | ocf_mngt_cache_flush_interrupt (ocf_cache_t cache) |
Interrupt existing flushing of cache or core. More... | |
void | ocf_mngt_cache_save (ocf_cache_t cache, ocf_mngt_cache_save_end_t cmpl, void *priv) |
Save cache configuration data on cache volume. More... | |
int | ocf_mngt_cache_set_mode (ocf_cache_t cache, ocf_cache_mode_t mode) |
Set cache mode in given cache. More... | |
int | ocf_mngt_cache_cleaning_set_policy (ocf_cache_t cache, ocf_cleaning_t type) |
Set cleaning policy in given cache. More... | |
int | ocf_mngt_cache_cleaning_get_policy (ocf_cache_t cache, ocf_cleaning_t *type) |
Get current cleaning policy from given cache. More... | |
int | ocf_mngt_cache_cleaning_set_param (ocf_cache_t cache, ocf_cleaning_t type, uint32_t param_id, uint32_t param_value) |
Set cleaning parameter in given cache. More... | |
int | ocf_mngt_cache_cleaning_get_param (ocf_cache_t cache, ocf_cleaning_t type, uint32_t param_id, uint32_t *param_value) |
Get cleaning parameter from given cache. More... | |
int | ocf_mngt_cache_promotion_set_policy (ocf_cache_t cache, ocf_promotion_t type) |
Set promotion policy in given cache. More... | |
ocf_promotion_t | ocf_mngt_cache_promotion_get_policy (ocf_cache_t cache) |
Get promotion policy in given cache. More... | |
int | ocf_mngt_cache_promotion_set_param (ocf_cache_t cache, ocf_promotion_t type, uint8_t param_id, uint32_t param_value) |
Set promotion policy parameter for given cache. More... | |
int | ocf_mngt_cache_promotion_get_param (ocf_cache_t cache, ocf_promotion_t type, uint8_t param_id, uint32_t *param_value) |
Get promotion policy parameter for given cache. More... | |
int | ocf_mngt_cache_io_classes_configure (ocf_cache_t cache, const struct ocf_mngt_io_classes_config *cfg) |
Configure IO classes in given cache. More... | |
int | ocf_mngt_core_set_uuid (ocf_core_t core, const struct ocf_volume_uuid *uuid) |
Asociate new UUID value with given core. More... | |
int | ocf_mngt_core_set_user_metadata (ocf_core_t core, void *data, size_t size) |
Set persistent user metadata for given core. More... | |
int | ocf_mngt_core_get_user_metadata (ocf_core_t core, void *data, size_t size) |
Get persistent user metadata from given core. More... | |
int | ocf_mngt_core_set_seq_cutoff_threshold (ocf_core_t core, uint32_t thresh) |
Set core sequential cutoff threshold. More... | |
int | ocf_mngt_core_set_seq_cutoff_threshold_all (ocf_cache_t cache, uint32_t thresh) |
Set sequential cutoff threshold for all cores in cache. More... | |
int | ocf_mngt_core_get_seq_cutoff_threshold (ocf_core_t core, uint32_t *thresh) |
Get core sequential cutoff threshold. More... | |
int | ocf_mngt_core_set_seq_cutoff_policy (ocf_core_t core, ocf_seq_cutoff_policy policy) |
Set core sequential cutoff policy. More... | |
int | ocf_mngt_core_set_seq_cutoff_policy_all (ocf_cache_t cache, ocf_seq_cutoff_policy policy) |
Set sequential cutoff policy for all cores in cache. More... | |
int | ocf_mngt_core_get_seq_cutoff_policy (ocf_core_t core, ocf_seq_cutoff_policy *policy) |
Get core sequential cutoff policy. More... | |
int | ocf_mngt_cache_set_fallback_pt_error_threshold (ocf_cache_t cache, uint32_t threshold) |
Set cache fallback Pass Through error threshold. More... | |
int | ocf_mngt_cache_get_fallback_pt_error_threshold (ocf_cache_t cache, uint32_t *threshold) |
Get cache fallback Pass Through error threshold. More... | |
int | ocf_mngt_cache_reset_fallback_pt_error_counter (ocf_cache_t cache) |
Reset cache fallback Pass Through error counter. More... | |
int | ocf_mngt_core_pool_get_count (ocf_ctx_t ctx) |
Get core pool count. More... | |
int | ocf_mngt_core_pool_add (ocf_ctx_t ctx, ocf_uuid_t uuid, uint8_t type) |
Add core to pool. More... | |
ocf_volume_t | ocf_mngt_core_pool_lookup (ocf_ctx_t ctx, ocf_uuid_t uuid, ocf_volume_type_t type) |
Add core to pool. More... | |
int | ocf_mngt_core_pool_visit (ocf_ctx_t ctx, int(*visitor)(ocf_uuid_t, void *), void *visitor_ctx) |
Iterate over all object in pool and call visitor callback. More... | |
void | ocf_mngt_core_pool_remove (ocf_ctx_t ctx, ocf_volume_t volume) |
Remove volume from pool. More... | |
OCF management operations definitions.
typedef void(* ocf_mngt_cache_add_core_end_t) (ocf_cache_t cache, ocf_core_t core, void *priv, int error) |
Completion callback of add core operation.
[in] | cache | Cache handle |
[in] | core | Core handle on success or NULL on failure |
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef void(* ocf_mngt_cache_attach_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache attach operation.
[in] | cache | Cache handle |
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef void(* ocf_mngt_cache_detach_core_end_t) (void *priv, int error) |
Completion callback of detach core operation.
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef void(* ocf_mngt_cache_detach_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache detach operation.
[in] | cache | Cache handle |
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef void(* ocf_mngt_cache_flush_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache flush operation.
[in] | cache | Cache handle |
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef void(* ocf_mngt_cache_load_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache load operation.
[in] | cache | Cache handle |
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef void(* ocf_mngt_cache_lock_end_t) (ocf_cache_t cache, void *priv, int error) |
Lock cache for management oparations (write lock, exclusive)
[in] | cache | Handle to cache |
[in] | error | Status error code. Can be one of the following: 0 Cache successfully locked -OCF_ERR_CACHE_NOT_EXIST Can not lock cache - cache is already stopping -OCF_ERR_NO_MEM Cannot allocate needed memory -OCF_ERR_INTR Wait operation interrupted |
typedef void(* ocf_mngt_cache_purge_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache purge operation.
[in] | cache | Cache handle |
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef void(* ocf_mngt_cache_remove_core_end_t) (void *priv, int error) |
Completion callback of remove core operation.
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef void(* ocf_mngt_cache_save_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of save operation.
[in] | cache | Cache handle |
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef void(* ocf_mngt_cache_stop_end_t) (ocf_cache_t cache, void *priv, int error) |
Completion callback of cache stop operation.
[in] | cache | Cache handle |
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef int(* ocf_mngt_cache_visitor_t) (ocf_cache_t cache, void *cntx) |
Cache visitor function.
[in] | cache | Handle to cache |
[in] | cntx | Visitor function context |
0 | Success |
Non-zero | Error |
typedef void(* ocf_mngt_core_flush_end_t) (ocf_core_t core, void *priv, int error) |
Completion callback of core flush operation.
[in] | core | Core handle |
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
typedef void(* ocf_mngt_core_purge_end_t) (ocf_core_t core, void *priv, int error) |
Completion callback of core purge operation.
[in] | core | Core handle |
[in] | priv | Callback context |
[in] | error | Error code (zero on success) |
void ocf_mngt_cache_add_core | ( | ocf_cache_t | cache, |
struct ocf_mngt_core_config * | cfg, | ||
ocf_mngt_cache_add_core_end_t | cmpl, | ||
void * | priv | ||
) |
Add core to cache instance.
[in] | cache | Cache handle |
[in] | cfg | Core configuration |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
void ocf_mngt_cache_attach | ( | ocf_cache_t | cache, |
struct ocf_mngt_cache_device_config * | cfg, | ||
ocf_mngt_cache_attach_end_t | cmpl, | ||
void * | priv | ||
) |
Attach caching device to cache instance.
[in] | cache | Cache handle |
[in] | cfg | Caching device configuration |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
int ocf_mngt_cache_cleaning_get_param | ( | ocf_cache_t | cache, |
ocf_cleaning_t | type, | ||
uint32_t | param_id, | ||
uint32_t * | param_value | ||
) |
Get cleaning parameter from given cache.
[in] | cache | Cache handle |
[in] | type | Cleaning policy type |
[in] | param_id | Cleaning policy parameter id |
[out] | param_value | Variable to store parameter value |
0 | Parameter has been get successfully |
Non-zero | Error occurred and parameter has not been get |
int ocf_mngt_cache_cleaning_get_policy | ( | ocf_cache_t | cache, |
ocf_cleaning_t * | type | ||
) |
Get current cleaning policy from given cache.
[in] | cache | Cache handle |
[out] | type | Variable to store current cleaning policy type |
0 | Policy has been get successfully |
Non-zero | Error occurred and policy has not been get |
int ocf_mngt_cache_cleaning_set_param | ( | ocf_cache_t | cache, |
ocf_cleaning_t | type, | ||
uint32_t | param_id, | ||
uint32_t | param_value | ||
) |
Set cleaning parameter in given cache.
[in] | cache | Cache handle |
[in] | type | Cleaning policy type |
[in] | param_id | Cleaning policy parameter id |
[in] | param_value | Cleaning policy parameter value |
0 | Parameter has been set successfully |
Non-zero | Error occurred and parameter has not been set |
int ocf_mngt_cache_cleaning_set_policy | ( | ocf_cache_t | cache, |
ocf_cleaning_t | type | ||
) |
Set cleaning policy in given cache.
[in] | cache | Cache handle |
[in] | type | Cleaning policy type |
0 | Policy has been set successfully |
Non-zero | Error occurred and policy has not been set |
void ocf_mngt_cache_detach | ( | ocf_cache_t | cache, |
ocf_mngt_cache_detach_end_t | cmpl, | ||
void * | priv | ||
) |
Detach caching cache.
[in] | cache | Cache handle |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
void ocf_mngt_cache_detach_core | ( | ocf_core_t | core, |
ocf_mngt_cache_detach_core_end_t | cmpl, | ||
void * | priv | ||
) |
Detach core from cache instance.
[in] | core | Core handle |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
void ocf_mngt_cache_flush | ( | ocf_cache_t | cache, |
ocf_mngt_cache_flush_end_t | cmpl, | ||
void * | priv | ||
) |
Flush data from given cache.
[in] | cache | Cache handle |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
void ocf_mngt_cache_flush_interrupt | ( | ocf_cache_t | cache | ) |
Interrupt existing flushing of cache or core.
[in] | cache | Cache instance |
int ocf_mngt_cache_get | ( | ocf_cache_t | cache | ) |
Increment reference counter of cache.
[in] | cache | OCF cache handle |
0 | Reference counter incremented |
-OCF_ERR_CACHE_NOT_AVAIL | cache isn't initialised yet |
int ocf_mngt_cache_get_by_name | ( | ocf_ctx_t | ctx, |
const char * | name, | ||
size_t | name_len, | ||
ocf_cache_t * | cache | ||
) |
Get OCF cache by name.
[in] | ctx | OCF context |
[in] | name | OCF cache name |
[in] | name_len | Cache name length |
[out] | cache | OCF cache handle |
0 | Get cache successfully |
-OCF_ERR_CACHE_NOT_EXIST | Cache with given name doesn't exist |
uint32_t ocf_mngt_cache_get_count | ( | ocf_ctx_t | ctx | ) |
Get number of OCF caches.
[in] | ctx | OCF context |
Number | of caches in given OCF instance |
int ocf_mngt_cache_get_fallback_pt_error_threshold | ( | ocf_cache_t | cache, |
uint32_t * | threshold | ||
) |
Get cache fallback Pass Through error threshold.
[in] | cache | Cache handle |
[out] | threshold | Fallback-PT threshold |
0 | Fallback-PT threshold have been get successfully |
Non-zero | Error occurred |
int ocf_mngt_cache_io_classes_configure | ( | ocf_cache_t | cache, |
const struct ocf_mngt_io_classes_config * | cfg | ||
) |
Configure IO classes in given cache.
[in] | cache | Cache handle |
[in] | cfg | IO class configuration |
0 | Configuration have been set successfully |
Non-zero | Error occurred and configuration not been set |
bool ocf_mngt_cache_is_dirty | ( | ocf_cache_t | cache | ) |
Check if cache is dirty.
[in] | cache | Cache handle |
true | if cache is dirty, false otherwise |
void ocf_mngt_cache_load | ( | ocf_cache_t | cache, |
struct ocf_mngt_cache_device_config * | cfg, | ||
ocf_mngt_cache_load_end_t | cmpl, | ||
void * | priv | ||
) |
Load cache instance.
[in] | cache | Cache handle |
[in] | cfg | Caching device configuration |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
void ocf_mngt_cache_lock | ( | ocf_cache_t | cache, |
ocf_mngt_cache_lock_end_t | cmpl, | ||
void * | priv | ||
) |
Lock cache for management oparations (write lock, exclusive)
[in] | cache | Handle to cache |
[in] | cmpl | Completion callback |
[in] | priv | Private context of completion callback |
int ocf_mngt_cache_promotion_get_param | ( | ocf_cache_t | cache, |
ocf_promotion_t | type, | ||
uint8_t | param_id, | ||
uint32_t * | param_value | ||
) |
Get promotion policy parameter for given cache.
[in] | cache | Cache handle |
[in] | type | Promotion policy type |
[in] | param_id | Promotion policy parameter id |
[out] | param_value | Variable to store parameter value |
0 | Parameter has been retrieved successfully |
Non-zero | Error occurred and parameter has not been retrieved |
ocf_promotion_t ocf_mngt_cache_promotion_get_policy | ( | ocf_cache_t | cache | ) |
Get promotion policy in given cache.
[in] | cache | Cache handle |
Currently | set promotion policy type |
int ocf_mngt_cache_promotion_set_param | ( | ocf_cache_t | cache, |
ocf_promotion_t | type, | ||
uint8_t | param_id, | ||
uint32_t | param_value | ||
) |
Set promotion policy parameter for given cache.
[in] | cache | Cache handle |
[in] | type | Promotion policy type |
[in] | param_id | Promotion policy parameter id |
[in] | param_value | Promotion policy parameter value |
0 | Parameter has been set successfully |
Non-zero | Error occurred and parameter has not been set |
int ocf_mngt_cache_promotion_set_policy | ( | ocf_cache_t | cache, |
ocf_promotion_t | type | ||
) |
Set promotion policy in given cache.
[in] | cache | Cache handle |
[in] | type | Promotion policy type |
0 | Policy has been set successfully |
Non-zero | Error occurred and policy has not been set |
void ocf_mngt_cache_purge | ( | ocf_cache_t | cache, |
ocf_mngt_cache_purge_end_t | cmpl, | ||
void * | priv | ||
) |
Purge data from given cache.
[in] | cache | Cache handle |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
void ocf_mngt_cache_put | ( | ocf_cache_t | cache | ) |
Decrease reference counter in cache.
[in] | cache | Handle to cache |
void ocf_mngt_cache_read_lock | ( | ocf_cache_t | cache, |
ocf_mngt_cache_lock_end_t | cmpl, | ||
void * | priv | ||
) |
Lock cache for read - assures cache config does not change while lock is being held, while allowing other users to acquire read lock in parallel.
[in] | cache | Handle to cache |
[in] | cmpl | Completion callback |
[in] | priv | Private context of completion callback |
int ocf_mngt_cache_read_trylock | ( | ocf_cache_t | cache | ) |
Lock cache for read - assures cache config does not change while lock is being held, while allowing other users to acquire read lock in parallel.
[in] | cache | Handle to cache |
0 | Cache successfully locked |
-OCF_ERR_CACHE_NOT_EXIST | Can not lock cache - cache is already stopping |
-OCF_ERR_NO_LOCK | Lock not acquired |
void ocf_mngt_cache_read_unlock | ( | ocf_cache_t | cache | ) |
Read-unlock cache.
[in] | cache | Handle to cache |
void ocf_mngt_cache_remove_core | ( | ocf_core_t | core, |
ocf_mngt_cache_remove_core_end_t | cmpl, | ||
void * | priv | ||
) |
Remove core from cache instance.
[in] | core | Core handle |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
int ocf_mngt_cache_reset_fallback_pt_error_counter | ( | ocf_cache_t | cache | ) |
Reset cache fallback Pass Through error counter.
[in] | cache | Cache handle |
0 | Threshold have been reset successfully |
void ocf_mngt_cache_save | ( | ocf_cache_t | cache, |
ocf_mngt_cache_save_end_t | cmpl, | ||
void * | priv | ||
) |
Save cache configuration data on cache volume.
This function should be called after changing cache or core parameters in order to make changes persistent.
[in] | cache | Cache handle |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
int ocf_mngt_cache_set_fallback_pt_error_threshold | ( | ocf_cache_t | cache, |
uint32_t | threshold | ||
) |
Set cache fallback Pass Through error threshold.
[in] | cache | Cache handle |
[in] | threshold | Value to be set as threshold |
0 | Fallback-PT threshold have been set successfully |
Non-zero | Error occurred |
int ocf_mngt_cache_set_mngt_queue | ( | ocf_cache_t | cache, |
ocf_queue_t | queue | ||
) |
Set queue to be used during management operations.
[in] | cache | Cache object |
[in] | queue | Queue object |
0 | Success |
Non-zero | Error occurred |
int ocf_mngt_cache_set_mode | ( | ocf_cache_t | cache, |
ocf_cache_mode_t | mode | ||
) |
Set cache mode in given cache.
[in] | cache | Cache handle |
[in] | mode | Cache mode to set |
0 | Cache mode have been set successfully |
Non-zero | Error occurred and cache mode not been set |
int ocf_mngt_cache_start | ( | ocf_ctx_t | ctx, |
ocf_cache_t * | cache, | ||
struct ocf_mngt_cache_config * | cfg | ||
) |
Start cache instance.
[in] | ctx | OCF context |
[out] | cache | Cache handle |
[in] | cfg | Starting cache configuration |
0 | Cache started successfully |
Non-zero | Error occurred and starting cache failed |
void ocf_mngt_cache_stop | ( | ocf_cache_t | cache, |
ocf_mngt_cache_stop_end_t | cmpl, | ||
void * | priv | ||
) |
Stop cache instance.
[in] | cache | Cache handle |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
int ocf_mngt_cache_trylock | ( | ocf_cache_t | cache | ) |
Lock cache for management oparations (write lock, exclusive)
[in] | cache | Handle to cache |
0 | Cache successfully locked |
-OCF_ERR_CACHE_NOT_EXIST | Can not lock cache - cache is already stopping |
-OCF_ERR_NO_LOCK | Lock not acquired |
void ocf_mngt_cache_unlock | ( | ocf_cache_t | cache | ) |
Write-unlock cache.
[in] | cache | Handle to cache |
int ocf_mngt_cache_visit | ( | ocf_ctx_t | ctx, |
ocf_mngt_cache_visitor_t | visitor, | ||
void * | cntx | ||
) |
Loop for each cache.
[in] | ctx | OCF context |
[in] | visitor | OCF cache visitor function |
[in] | cntx | Context for cache visitor function |
0 | Success |
Non-zero | Error |
int ocf_mngt_cache_visit_reverse | ( | ocf_ctx_t | ctx, |
ocf_mngt_cache_visitor_t | visitor, | ||
void * | cntx | ||
) |
Loop for each cache reverse.
[in] | ctx | OCF context |
[in] | visitor | OCF cache visitor function |
[in] | cntx | Context for cache visitor function |
0 | Success |
Non-zero | Error |
void ocf_mngt_core_flush | ( | ocf_core_t | core, |
ocf_mngt_core_flush_end_t | cmpl, | ||
void * | priv | ||
) |
Flush data to given core.
[in] | core | Core handle |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
int ocf_mngt_core_get_seq_cutoff_policy | ( | ocf_core_t | core, |
ocf_seq_cutoff_policy * | policy | ||
) |
Get core sequential cutoff policy.
[in] | core | Core handle |
[in] | policy | sequential cutoff policy |
0 | Sequential cutoff policy has been get successfully |
Non-zero | Error occured |
int ocf_mngt_core_get_seq_cutoff_threshold | ( | ocf_core_t | core, |
uint32_t * | thresh | ||
) |
Get core sequential cutoff threshold.
[in] | core | Core handle |
[in] | thresh | threshold in bytes for sequential cutoff |
0 | Sequential cutoff threshold has been get successfully |
Non-zero | Error occured |
int ocf_mngt_core_get_user_metadata | ( | ocf_core_t | core, |
void * | data, | ||
size_t | size | ||
) |
Get persistent user metadata from given core.
[in] | core | Core object |
[out] | data | User data buffer |
[in] | size | Size of user data buffer |
0 | Success |
Non-zero | Core getting failed |
bool ocf_mngt_core_is_dirty | ( | ocf_core_t | core | ) |
Check if core is dirty.
[in] | core | Core handle |
true | if core is dirty, false otherwise |
int ocf_mngt_core_pool_add | ( | ocf_ctx_t | ctx, |
ocf_uuid_t | uuid, | ||
uint8_t | type | ||
) |
Add core to pool.
[in] | ctx | OCF context |
[in] | uuid | Cache volume UUID |
[in] | type | OCF core volume type |
0 | Core added to pool successfully |
Non-zero | Error occurred and adding core to poll failed |
int ocf_mngt_core_pool_get_count | ( | ocf_ctx_t | ctx | ) |
Get core pool count.
[in] | ctx | OCF context |
Number | of cores in core pool |
ocf_volume_t ocf_mngt_core_pool_lookup | ( | ocf_ctx_t | ctx, |
ocf_uuid_t | uuid, | ||
ocf_volume_type_t | type | ||
) |
Add core to pool.
[in] | ctx | OCF context |
[in] | uuid | Cache volume UUID |
[in] | type | OCF core volume type |
Handler | to object with same UUID |
NULL | Not found object with that id |
void ocf_mngt_core_pool_remove | ( | ocf_ctx_t | ctx, |
ocf_volume_t | volume | ||
) |
Remove volume from pool.
Important: This function destroys volume instance but doesn't close it, so it should be either moved or closed before calling this function.
[in] | ctx | OCF context |
[in] | volume | Core volume |
int ocf_mngt_core_pool_visit | ( | ocf_ctx_t | ctx, |
int(*)(ocf_uuid_t, void *) | visitor, | ||
void * | visitor_ctx | ||
) |
Iterate over all object in pool and call visitor callback.
[in] | ctx | OCF context |
[in] | visitor | Visitor callback |
[in] | visior_ctx | CContext for visitor callback |
Handler | to object with same UUID |
NULL | Not found object with that id |
void ocf_mngt_core_purge | ( | ocf_core_t | core, |
ocf_mngt_core_purge_end_t | cmpl, | ||
void * | priv | ||
) |
Purge data to given core.
[in] | core | Core handle |
[in] | cmpl | Completion callback |
[in] | priv | Completion callback context |
int ocf_mngt_core_set_seq_cutoff_policy | ( | ocf_core_t | core, |
ocf_seq_cutoff_policy | policy | ||
) |
Set core sequential cutoff policy.
[in] | core | Core handle |
[in] | policy | sequential cutoff policy |
0 | Sequential cutoff policy has been set successfully |
Non-zero | Error occured and policy hasn't been updated |
int ocf_mngt_core_set_seq_cutoff_policy_all | ( | ocf_cache_t | cache, |
ocf_seq_cutoff_policy | policy | ||
) |
Set sequential cutoff policy for all cores in cache.
[in] | cache | Cache handle |
[in] | policy | sequential cutoff policy |
0 | Sequential cutoff policy has been set successfully |
Non-zero | Error occured and policy hasn't been updated |
int ocf_mngt_core_set_seq_cutoff_threshold | ( | ocf_core_t | core, |
uint32_t | thresh | ||
) |
Set core sequential cutoff threshold.
[in] | core | Core handle |
[in] | thresh | threshold in bytes for sequential cutoff |
0 | Sequential cutoff threshold has been set successfully |
Non-zero | Error occured and threshold hasn't been updated |
int ocf_mngt_core_set_seq_cutoff_threshold_all | ( | ocf_cache_t | cache, |
uint32_t | thresh | ||
) |
Set sequential cutoff threshold for all cores in cache.
[in] | cache | Cache handle |
[in] | thresh | threshold in bytes for sequential cutoff |
0 | Sequential cutoff threshold has been set successfully |
Non-zero | Error occured and threshold hasn't been updated |
int ocf_mngt_core_set_user_metadata | ( | ocf_core_t | core, |
void * | data, | ||
size_t | size | ||
) |
Set persistent user metadata for given core.
[in] | core | Core object |
[in] | data | User data buffer |
[in] | size | Size of user data buffer |
0 | Success |
Non-zero | Core getting failed |
int ocf_mngt_core_set_uuid | ( | ocf_core_t | core, |
const struct ocf_volume_uuid * | uuid | ||
) |
Asociate new UUID value with given core.
[in] | core | Core object |
[in] | uuid | new core uuid |
0 | Success |
Non-zero | Fail |
int ocf_mngt_get_ram_needed | ( | ocf_cache_t | cache, |
struct ocf_mngt_cache_device_config * | cfg, | ||
uint64_t * | ram_needed | ||
) |
Get amount of free RAM needed to attach cache volume.
[in] | cache | Cache handle |
[in] | cfg | Caching device configuration |
[out] | ram_needed | Amount of RAM needed in bytes |
0 | Success |
Non-zero | Error occurred |