2 * Copyright(c) 2012-2018 Intel Corporation
3 * SPDX-License-Identifier: BSD-3-Clause-Clear
6 #ifndef __METADATA_RAW_DYNAMIC_H__
7 #define __METADATA_RAW_DYNAMIC_H__
10 * @file metadata_raw_dynamic.h
11 * @brief Metadata RAW container implementation for dynamic numbers of elements
15 * RAW DYNAMIC - Initialize
17 int raw_dynamic_init(ocf_cache_t cache
,
18 ocf_flush_page_synch_t lock_page_pfn
,
19 ocf_flush_page_synch_t unlock_page_pfn
,
20 struct ocf_metadata_raw
*raw
);
23 * RAW DYNAMIC - De-Initialize
25 int raw_dynamic_deinit(ocf_cache_t cache
,
26 struct ocf_metadata_raw
*raw
);
29 * RAW DYNAMIC - Get size of memory footprint of this RAW metadata container
31 size_t raw_dynamic_size_of(ocf_cache_t cache
,
32 struct ocf_metadata_raw
*raw
);
35 * RAW DYNAMIC Implementation - Size on SSD
37 uint32_t raw_dynamic_size_on_ssd(struct ocf_metadata_raw
*raw
);
40 * RAW DYNAMIC Implementation - Checksum
42 uint32_t raw_dynamic_checksum(ocf_cache_t cache
,
43 struct ocf_metadata_raw
*raw
);
46 * RAM DYNAMIC Implementation - Entry page number
48 uint32_t raw_dynamic_page(struct ocf_metadata_raw
*raw
, uint32_t entry
);
51 * RAW DYNAMIC - Get specified entry
53 int raw_dynamic_get(ocf_cache_t cache
, struct ocf_metadata_raw
*raw
,
54 uint32_t entry
, void *data
);
57 * RAW DYNAMIC - Set specified entry
59 int raw_dynamic_set(ocf_cache_t cache
, struct ocf_metadata_raw
*raw
,
60 uint32_t entry
, void *data
);
63 * RAW DYNAMIC - Write access for specified entry
65 void *raw_dynamic_access(ocf_cache_t cache
,
66 struct ocf_metadata_raw
*raw
, uint32_t entry
);
69 * RAW DYNAMIC - Load all metadata of this RAW metadata container
72 void raw_dynamic_load_all(ocf_cache_t cache
, struct ocf_metadata_raw
*raw
,
73 ocf_metadata_end_t cmpl
, void *priv
);
76 * RAW DYNAMIC - Flush all metadata of this RAW metadata container
79 void raw_dynamic_flush_all(ocf_cache_t cache
, struct ocf_metadata_raw
*raw
,
80 ocf_metadata_end_t cmpl
, void *priv
);
83 * RAW DYNAMIC - Mark specified entry to be flushed
85 void raw_dynamic_flush_mark(ocf_cache_t cache
, struct ocf_request
*req
,
86 uint32_t map_idx
, int to_state
, uint8_t start
, uint8_t stop
);
89 * DYNAMIC Implementation - Do Flush Asynchronously
91 int raw_dynamic_flush_do_asynch(ocf_cache_t cache
, struct ocf_request
*req
,
92 struct ocf_metadata_raw
*raw
, ocf_req_end_t complete
);
95 #endif /* METADATA_RAW_H_ */