Handle metadata asynchronously

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga
2019-03-19 15:27:11 +01:00
parent 8998e145f2
commit 6cd84476f6
21 changed files with 1149 additions and 1427 deletions

View File

@@ -14,91 +14,85 @@
/*
* RAW DYNAMIC - Initialize
*/
int raw_dynamic_init(struct ocf_cache *cache,
int raw_dynamic_init(ocf_cache_t cache,
struct ocf_metadata_raw *raw);
/*
* RAW DYNAMIC - De-Initialize
*/
int raw_dynamic_deinit(struct ocf_cache *cache,
int raw_dynamic_deinit(ocf_cache_t cache,
struct ocf_metadata_raw *raw);
/*
* RAW DYNAMIC - Get size of memory footprint of this RAW metadata container
*/
size_t raw_dynamic_size_of(struct ocf_cache *cache,
size_t raw_dynamic_size_of(ocf_cache_t cache,
struct ocf_metadata_raw *raw);
/*
* RAW DYNAMIC Implementation - Size on SSD
*/
uint32_t raw_dynamic_size_on_ssd(struct ocf_cache *cache,
uint32_t raw_dynamic_size_on_ssd(ocf_cache_t cache,
struct ocf_metadata_raw *raw);
/*
* RAW DYNAMIC Implementation - Checksum
*/
uint32_t raw_dynamic_checksum(struct ocf_cache *cache,
uint32_t raw_dynamic_checksum(ocf_cache_t cache,
struct ocf_metadata_raw *raw);
/*
* RAW DYNAMIC - Get specified entry
*/
int raw_dynamic_get(struct ocf_cache *cache,
int raw_dynamic_get(ocf_cache_t cache,
struct ocf_metadata_raw *raw, ocf_cache_line_t line,
void *data, uint32_t size);
/*
* RAW DYNAMIC - Set specified entry
*/
int raw_dynamic_set(struct ocf_cache *cache,
int raw_dynamic_set(ocf_cache_t cache,
struct ocf_metadata_raw *raw, ocf_cache_line_t line,
void *data, uint32_t size);
/*
* RAW DYNAMIC - Read only access for specified entry
*/
const void *raw_dynamic_rd_access(struct ocf_cache *cache,
const void *raw_dynamic_rd_access(ocf_cache_t cache,
struct ocf_metadata_raw *raw, ocf_cache_line_t line,
uint32_t size);
/*
* RAW DYNAMIC - Write access for specified entry
*/
void *raw_dynamic_wr_access(struct ocf_cache *cache,
void *raw_dynamic_wr_access(ocf_cache_t cache,
struct ocf_metadata_raw *raw, ocf_cache_line_t line,
uint32_t size);
/*
* RAW DYNAMIC - Flush specified entry
*/
int raw_dynamic_flush(struct ocf_cache *cache,
struct ocf_metadata_raw *raw, ocf_cache_line_t line);
/*
* RAW DYNAMIC - Load all metadata of this RAW metadata container
* from cache device
*/
int raw_dynamic_load_all(struct ocf_cache *cache,
struct ocf_metadata_raw *raw);
void raw_dynamic_load_all(ocf_cache_t cache, struct ocf_metadata_raw *raw,
ocf_metadata_end_t cmpl, void *priv);
/*
* RAW DYNAMIC - Flush all metadata of this RAW metadata container
* to cache device
*/
int raw_dynamic_flush_all(struct ocf_cache *cache,
struct ocf_metadata_raw *raw);
void raw_dynamic_flush_all(ocf_cache_t cache, struct ocf_metadata_raw *raw,
ocf_metadata_end_t cmpl, void *priv);
/*
* RAW DYNAMIC - Mark specified entry to be flushed
*/
void raw_dynamic_flush_mark(struct ocf_cache *cache, struct ocf_request *req,
void raw_dynamic_flush_mark(ocf_cache_t cache, struct ocf_request *req,
uint32_t map_idx, int to_state, uint8_t start, uint8_t stop);
/*
* DYNAMIC Implementation - Do Flush Asynchronously
*/
int raw_dynamic_flush_do_asynch(struct ocf_cache *cache, struct ocf_request *req,
int raw_dynamic_flush_do_asynch(ocf_cache_t cache, struct ocf_request *req,
struct ocf_metadata_raw *raw, ocf_req_end_t complete);