]> git.proxmox.com Git - ceph.git/blame - ceph/src/spdk/ocf/src/metadata/metadata_raw_dynamic.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / spdk / ocf / src / metadata / metadata_raw_dynamic.h
CommitLineData
9f95a23c
TL
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 */
17int raw_dynamic_init(ocf_cache_t cache,
18 struct ocf_metadata_raw *raw);
19
20/*
21 * RAW DYNAMIC - De-Initialize
22 */
23int raw_dynamic_deinit(ocf_cache_t cache,
24 struct ocf_metadata_raw *raw);
25
26/*
27 * RAW DYNAMIC - Get size of memory footprint of this RAW metadata container
28 */
29size_t raw_dynamic_size_of(ocf_cache_t cache,
30 struct ocf_metadata_raw *raw);
31
32/*
33 * RAW DYNAMIC Implementation - Size on SSD
34 */
35uint32_t raw_dynamic_size_on_ssd(struct ocf_metadata_raw *raw);
36
37/*
38 * RAW DYNAMIC Implementation - Checksum
39 */
40uint32_t raw_dynamic_checksum(ocf_cache_t cache,
41 struct ocf_metadata_raw *raw);
42
43/*
44 * RAW DYNAMIC - Get specified entry
45 */
46int raw_dynamic_get(ocf_cache_t cache,
47 struct ocf_metadata_raw *raw, ocf_cache_line_t line,
48 void *data, uint32_t size);
49
50/*
51 * RAW DYNAMIC - Set specified entry
52 */
53int raw_dynamic_set(ocf_cache_t cache,
54 struct ocf_metadata_raw *raw, ocf_cache_line_t line,
55 void *data, uint32_t size);
56
57/*
58 * RAW DYNAMIC - Read only access for specified entry
59 */
60const void *raw_dynamic_rd_access(ocf_cache_t cache,
61 struct ocf_metadata_raw *raw, ocf_cache_line_t line,
62 uint32_t size);
63
64/*
65 * RAW DYNAMIC - Write access for specified entry
66 */
67void *raw_dynamic_wr_access(ocf_cache_t cache,
68 struct ocf_metadata_raw *raw, ocf_cache_line_t line,
69 uint32_t size);
70
71/*
72 * RAW DYNAMIC - Load all metadata of this RAW metadata container
73 * from cache device
74 */
75void raw_dynamic_load_all(ocf_cache_t cache, struct ocf_metadata_raw *raw,
76 ocf_metadata_end_t cmpl, void *priv);
77
78/*
79 * RAW DYNAMIC - Flush all metadata of this RAW metadata container
80 * to cache device
81 */
82void raw_dynamic_flush_all(ocf_cache_t cache, struct ocf_metadata_raw *raw,
83 ocf_metadata_end_t cmpl, void *priv);
84
85/*
86 * RAW DYNAMIC - Mark specified entry to be flushed
87 */
88void raw_dynamic_flush_mark(ocf_cache_t cache, struct ocf_request *req,
89 uint32_t map_idx, int to_state, uint8_t start, uint8_t stop);
90
91/*
92 * DYNAMIC Implementation - Do Flush Asynchronously
93 */
94int raw_dynamic_flush_do_asynch(ocf_cache_t cache, struct ocf_request *req,
95 struct ocf_metadata_raw *raw, ocf_req_end_t complete);
96
97
98#endif /* METADATA_RAW_H_ */