]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/ocf/src/metadata/metadata_raw_dynamic.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / ocf / src / metadata / metadata_raw_dynamic.h
1 /*
2 * Copyright(c) 2012-2018 Intel Corporation
3 * SPDX-License-Identifier: BSD-3-Clause-Clear
4 */
5
6 #ifndef __METADATA_RAW_DYNAMIC_H__
7 #define __METADATA_RAW_DYNAMIC_H__
8
9 /**
10 * @file metadata_raw_dynamic.h
11 * @brief Metadata RAW container implementation for dynamic numbers of elements
12 */
13
14 /*
15 * RAW DYNAMIC - Initialize
16 */
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);
21
22 /*
23 * RAW DYNAMIC - De-Initialize
24 */
25 int raw_dynamic_deinit(ocf_cache_t cache,
26 struct ocf_metadata_raw *raw);
27
28 /*
29 * RAW DYNAMIC - Get size of memory footprint of this RAW metadata container
30 */
31 size_t raw_dynamic_size_of(ocf_cache_t cache,
32 struct ocf_metadata_raw *raw);
33
34 /*
35 * RAW DYNAMIC Implementation - Size on SSD
36 */
37 uint32_t raw_dynamic_size_on_ssd(struct ocf_metadata_raw *raw);
38
39 /*
40 * RAW DYNAMIC Implementation - Checksum
41 */
42 uint32_t raw_dynamic_checksum(ocf_cache_t cache,
43 struct ocf_metadata_raw *raw);
44
45 /*
46 * RAM DYNAMIC Implementation - Entry page number
47 */
48 uint32_t raw_dynamic_page(struct ocf_metadata_raw *raw, uint32_t entry);
49
50 /*
51 * RAW DYNAMIC - Get specified entry
52 */
53 int raw_dynamic_get(ocf_cache_t cache, struct ocf_metadata_raw *raw,
54 uint32_t entry, void *data);
55
56 /*
57 * RAW DYNAMIC - Set specified entry
58 */
59 int raw_dynamic_set(ocf_cache_t cache, struct ocf_metadata_raw *raw,
60 uint32_t entry, void *data);
61
62 /*
63 * RAW DYNAMIC - Write access for specified entry
64 */
65 void *raw_dynamic_access(ocf_cache_t cache,
66 struct ocf_metadata_raw *raw, uint32_t entry);
67
68 /*
69 * RAW DYNAMIC - Load all metadata of this RAW metadata container
70 * from cache device
71 */
72 void raw_dynamic_load_all(ocf_cache_t cache, struct ocf_metadata_raw *raw,
73 ocf_metadata_end_t cmpl, void *priv);
74
75 /*
76 * RAW DYNAMIC - Flush all metadata of this RAW metadata container
77 * to cache device
78 */
79 void raw_dynamic_flush_all(ocf_cache_t cache, struct ocf_metadata_raw *raw,
80 ocf_metadata_end_t cmpl, void *priv);
81
82 /*
83 * RAW DYNAMIC - Mark specified entry to be flushed
84 */
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);
87
88 /*
89 * DYNAMIC Implementation - Do Flush Asynchronously
90 */
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);
93
94
95 #endif /* METADATA_RAW_H_ */