59 static inline void ocf_mngt_core_config_set_default(
64 cfg->user_metadata.data = NULL;
65 cfg->user_metadata.size = 0;
126 void *priv,
int error);
265 bool metadata_volatile;
271 uint32_t max_queue_size;
272 uint32_t queue_unblock_size;
302 static inline void ocf_mngt_cache_config_set_default(
310 cfg->metadata_volatile =
false;
311 cfg->
backfill.max_queue_size = 65536;
312 cfg->
backfill.queue_unblock_size = 60000;
350 void *priv,
int error);
430 static inline void ocf_mngt_cache_device_config_set_default(
462 void *priv,
int error);
484 void *priv,
int error);
504 void *priv,
int error);
589 void *priv,
int error);
627 void *priv,
int error);
647 void *priv,
int error);
667 void *priv,
int error);
694 void *priv,
int error);
715 static inline bool ocf_mngt_cache_mode_has_lazy_write(
ocf_cache_mode_t mode)
774 uint32_t param_id, uint32_t param_value);
788 uint32_t param_id, uint32_t *param_value);
825 uint8_t param_id, uint32_t param_value);
839 uint8_t param_id, uint32_t *param_value);
1028 uint32_t threshold);
1040 uint32_t *threshold);
1095 int (*visitor)(
ocf_uuid_t,
void *),
void *visitor_ctx);
struct ocf_cache * ocf_cache_t
handle to object designating ocf cache device
Definition: ocf_types.h:44
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.
ocf_promotion_t
Definition: ocf_def.h:214
Definition: ocf_mngt.h:876
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.
ocf_metadata_layout_t
Definition: ocf_def.h:293
void(* ocf_mngt_cache_purge_end_t)(ocf_cache_t cache, void *priv, int error)
Completion callback of cache purge operation.
Definition: ocf_mngt.h:646
struct ocf_mngt_cache_config::@6 backfill
Backfill configuration.
uint8_t volume_type
Cache volume type.
Definition: ocf_mngt.h:374
int ocf_mngt_cache_reset_fallback_pt_error_counter(ocf_cache_t cache)
Reset cache fallback Pass Through error counter.
void ocf_mngt_cache_flush_interrupt(ocf_cache_t cache)
Interrupt existing flushing of cache or core.
Cache attach configuration.
Definition: ocf_mngt.h:365
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.
bool pt_unaligned_io
Use pass-through mode for I/O requests unaligned to 4KiB.
Definition: ocf_mngt.h:286
void ocf_mngt_cache_put(ocf_cache_t cache)
Decrease reference counter in cache.
uint32_t ocf_mngt_cache_get_count(ocf_ctx_t ctx)
Get number of OCF caches.
ocf_seq_cutoff_policy
Definition: ocf_def.h:180
const char * name
IO class name.
Definition: ocf_mngt.h:853
void * volume_params
Optional opaque volume parameters, passed down to cache volume open callback.
Definition: ocf_mngt.h:419
ocf_eviction_t eviction_policy
Eviction policy type.
Definition: ocf_mngt.h:248
void ocf_mngt_cache_purge(ocf_cache_t cache, ocf_mngt_cache_purge_end_t cmpl, void *priv)
Purge data from given cache.
void(* ocf_mngt_core_flush_end_t)(ocf_core_t core, void *priv, int error)
Completion callback of core flush operation.
Definition: ocf_mngt.h:626
#define OCF_CACHE_NAME_SIZE
Definition: ocf_def.h:38
void(* ocf_mngt_cache_attach_end_t)(ocf_cache_t cache, void *priv, int error)
Completion callback of cache attach operation.
Definition: ocf_mngt.h:461
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.
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.
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.
int ocf_mngt_cache_set_mngt_queue(ocf_cache_t cache, ocf_queue_t queue)
Set queue to be used during management operations.
bool ocf_mngt_core_is_dirty(ocf_core_t core)
Check if core is dirty.
bool discard_on_start
If set, cache device will be discarded on cache start.
Definition: ocf_mngt.h:413
ocf_eviction_t
Definition: ocf_def.h:200
struct ocf_volume_type * ocf_volume_type_t
handle to volume type
Definition: ocf_types.h:63
int ocf_mngt_core_set_seq_cutoff_policy(ocf_core_t core, ocf_seq_cutoff_policy policy)
Set core sequential cutoff policy.
struct ocf_ctx * ocf_ctx_t
handle to object designating ocf context
Definition: ocf_types.h:38
int ocf_mngt_core_set_user_metadata(ocf_core_t core, void *data, size_t size)
Set persistent user metadata for given core.
void ocf_mngt_cache_unlock(ocf_cache_t cache)
Write-unlock cache.
int ocf_mngt_core_get_user_metadata(ocf_core_t core, void *data, size_t size)
Get persistent user metadata from given core.
int ocf_mngt_core_set_seq_cutoff_threshold(ocf_core_t core, uint32_t thresh)
Set core sequential cutoff threshold.
int ocf_mngt_cache_visit(ocf_ctx_t ctx, ocf_mngt_cache_visitor_t visitor, void *cntx)
Loop for each cache.
Definition: ocf_def.h:259
void ocf_mngt_core_flush(ocf_core_t core, ocf_mngt_core_flush_end_t cmpl, void *priv)
Flush data to given core.
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.
void(* ocf_mngt_cache_save_end_t)(ocf_cache_t cache, void *priv, int error)
Completion callback of save operation.
Definition: ocf_mngt.h:693
uint32_t min_size
IO class minimum size.
Definition: ocf_mngt.h:868
bool open_cores
Automatically open core volumes when loading cache.
Definition: ocf_mngt.h:392
void ocf_mngt_core_pool_remove(ocf_ctx_t ctx, ocf_volume_t volume)
Remove volume from pool.
Core start configuration.
Definition: ocf_mngt.h:20
int ocf_mngt_cache_cleaning_set_policy(ocf_cache_t cache, ocf_cleaning_t type)
Set cleaning policy in given cache.
bool locked
Start cache and keep it locked.
Definition: ocf_mngt.h:281
int ocf_mngt_core_set_uuid(ocf_core_t core, const struct ocf_volume_uuid *uuid)
Asociate new UUID value with given core.
int ocf_mngt_core_pool_add(ocf_ctx_t ctx, ocf_uuid_t uuid, uint8_t type)
Add core to pool.
char name[OCF_CORE_NAME_SIZE]
OCF core name.
Definition: ocf_mngt.h:24
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.
int ocf_mngt_cache_set_fallback_pt_error_threshold(ocf_cache_t cache, uint32_t threshold)
Set cache fallback Pass Through error threshold.
ocf_cache_mode_t
Definition: ocf_def.h:149
int ocf_mngt_cache_trylock(ocf_cache_t cache)
Lock cache for management oparations (write lock, exclusive)
OCF volume UUID.
Definition: ocf_volume.h:28
void ocf_mngt_cache_read_unlock(ocf_cache_t cache)
Read-unlock cache.
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.
ocf_promotion_t promotion_policy
Promotion policy type.
Definition: ocf_mngt.h:253
ocf_cache_line_size_t
Definition: ocf_def.h:258
void ocf_mngt_cache_detach(ocf_cache_t cache, ocf_mngt_cache_detach_end_t cmpl, void *priv)
Detach caching cache.
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.
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)
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.
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.
int16_t prio
IO class eviction priority.
Definition: ocf_mngt.h:858
uint32_t seq_cutoff_threshold
Definition: ocf_mngt.h:42
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.
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.
ocf_cache_line_size_t cache_line_size
Cache line size.
Definition: ocf_mngt.h:258
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.
int ocf_mngt_cache_cleaning_get_policy(ocf_cache_t cache, ocf_cleaning_t *type)
Get current cleaning policy from given cache.
Definition: ocf_def.h:153
int ocf_mngt_core_get_seq_cutoff_threshold(ocf_core_t core, uint32_t *thresh)
Get core sequential cutoff threshold.
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.
void(* ocf_mngt_cache_detach_end_t)(ocf_cache_t cache, void *priv, int error)
Completion callback of cache detach operation.
Definition: ocf_mngt.h:483
void ocf_mngt_cache_flush(ocf_cache_t cache, ocf_mngt_cache_flush_end_t cmpl, void *priv)
Flush data from given cache.
int ocf_mngt_core_get_seq_cutoff_policy(ocf_core_t core, ocf_seq_cutoff_policy *policy)
Get core sequential cutoff policy.
ocf_cache_mode_t cache_mode
Cache mode.
Definition: ocf_mngt.h:243
uint32_t max_size
IO class maximum size.
Definition: ocf_mngt.h:873
int ocf_mngt_cache_get_fallback_pt_error_threshold(ocf_cache_t cache, uint32_t *threshold)
Get cache fallback Pass Through error threshold.
ocf_cache_line_size_t cache_line_size
Cache line size.
Definition: ocf_mngt.h:379
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.
int ocf_mngt_core_pool_get_count(ocf_ctx_t ctx)
Get core pool count.
int ocf_mngt_cache_get(ocf_cache_t cache)
Increment reference counter of cache.
struct ocf_volume * ocf_volume_t
handle to object designating ocf volume
Definition: ocf_types.h:56
struct ocf_queue * ocf_queue_t
handle to I/O queue
Definition: ocf_types.h:78
void(* ocf_mngt_core_purge_end_t)(ocf_core_t core, void *priv, int error)
Completion callback of core purge operation.
Definition: ocf_mngt.h:666
int(* ocf_mngt_cache_visitor_t)(ocf_cache_t cache, void *cntx)
Cache visitor function.
Definition: ocf_mngt.h:199
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.
Cache start configuration.
Definition: ocf_mngt.h:234
void ocf_mngt_core_purge(ocf_core_t core, ocf_mngt_core_purge_end_t cmpl, void *priv)
Purge data to given core.
Definition: ocf_def.h:224
uint32_t class_id
IO class ID.
Definition: ocf_mngt.h:848
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.
Definition: ocf_mngt.h:528
struct ocf_volume_uuid uuid
OCF core volume UUID.
Definition: ocf_mngt.h:29
void(* ocf_mngt_cache_load_end_t)(ocf_cache_t cache, void *priv, int error)
Completion callback of cache load operation.
Definition: ocf_mngt.h:503
int ocf_mngt_cache_start(ocf_ctx_t ctx, ocf_cache_t *cache, struct ocf_mngt_cache_config *cfg)
Start cache instance.
Definition: ocf_def.h:262
Definition: ocf_def.h:165
ocf_cleaning_t
Definition: ocf_def.h:231
ocf_cache_mode_t cache_mode
IO class cache mode.
Definition: ocf_mngt.h:863
ocf_metadata_layout_t metadata_layout
Metadata layout (stripping/sequential)
Definition: ocf_mngt.h:263
Definition: ocf_def.h:171
IO class configuration.
Definition: ocf_mngt.h:844
int ocf_mngt_cache_set_mode(ocf_cache_t cache, ocf_cache_mode_t mode)
Set cache mode in given cache.
void(* ocf_mngt_cache_flush_end_t)(ocf_cache_t cache, void *priv, int error)
Completion callback of cache flush operation.
Definition: ocf_mngt.h:588
bool use_submit_io_fast
If set, try to submit all I/O in fast path.
Definition: ocf_mngt.h:291
void(* ocf_mngt_cache_stop_end_t)(ocf_cache_t cache, void *priv, int error)
Completion callback of cache stop operation.
Definition: ocf_mngt.h:349
int ocf_mngt_cache_visit_reverse(ocf_ctx_t ctx, ocf_mngt_cache_visitor_t visitor, void *cntx)
Loop for each cache reverse.
ocf_promotion_t ocf_mngt_cache_promotion_get_policy(ocf_cache_t cache)
Get promotion policy in given cache.
#define OCF_CORE_NAME_SIZE
Definition: ocf_def.h:78
struct ocf_core * ocf_core_t
handle to object designating ocf core object
Definition: ocf_types.h:50
uint8_t volume_type
OCF core volume type.
Definition: ocf_mngt.h:34
Definition: ocf_def.h:207
void(* ocf_mngt_cache_remove_core_end_t)(void *priv, int error)
Completion callback of remove core operation.
Definition: ocf_mngt.h:549
bool force
Ignore warnings and initialize new cache instance.
Definition: ocf_mngt.h:402
void(* ocf_mngt_cache_detach_core_end_t)(void *priv, int error)
Completion callback of detach core operation.
Definition: ocf_mngt.h:567
int ocf_mngt_cache_promotion_set_policy(ocf_cache_t cache, ocf_promotion_t type)
Set promotion policy in given cache.
void ocf_mngt_cache_stop(ocf_cache_t cache, ocf_mngt_cache_stop_end_t cmpl, void *priv)
Stop cache instance.
bool ocf_mngt_cache_is_dirty(ocf_cache_t cache)
Check if cache is dirty.
bool perform_test
If set, cache features (like discard) are tested before starting cache.
Definition: ocf_mngt.h:408
bool try_add
Add core to pool if cache isn't present or add core to earlier loaded cache.
Definition: ocf_mngt.h:40
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.
void(* ocf_mngt_cache_lock_end_t)(ocf_cache_t cache, void *priv, int error)
Lock cache for management oparations (write lock, exclusive)
Definition: ocf_mngt.h:125