]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/ocf/src/metadata/metadata_raw_dynamic.h
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 struct ocf_metadata_raw
*raw
);
21 * RAW DYNAMIC - De-Initialize
23 int raw_dynamic_deinit(ocf_cache_t cache
,
24 struct ocf_metadata_raw
*raw
);
27 * RAW DYNAMIC - Get size of memory footprint of this RAW metadata container
29 size_t raw_dynamic_size_of(ocf_cache_t cache
,
30 struct ocf_metadata_raw
*raw
);
33 * RAW DYNAMIC Implementation - Size on SSD
35 uint32_t raw_dynamic_size_on_ssd(struct ocf_metadata_raw
*raw
);
38 * RAW DYNAMIC Implementation - Checksum
40 uint32_t raw_dynamic_checksum(ocf_cache_t cache
,
41 struct ocf_metadata_raw
*raw
);
44 * RAW DYNAMIC - Get specified entry
46 int raw_dynamic_get(ocf_cache_t cache
,
47 struct ocf_metadata_raw
*raw
, ocf_cache_line_t line
,
48 void *data
, uint32_t size
);
51 * RAW DYNAMIC - Set specified entry
53 int raw_dynamic_set(ocf_cache_t cache
,
54 struct ocf_metadata_raw
*raw
, ocf_cache_line_t line
,
55 void *data
, uint32_t size
);
58 * RAW DYNAMIC - Read only access for specified entry
60 const void *raw_dynamic_rd_access(ocf_cache_t cache
,
61 struct ocf_metadata_raw
*raw
, ocf_cache_line_t line
,
65 * RAW DYNAMIC - Write access for specified entry
67 void *raw_dynamic_wr_access(ocf_cache_t cache
,
68 struct ocf_metadata_raw
*raw
, ocf_cache_line_t line
,
72 * RAW DYNAMIC - Load all metadata of this RAW metadata container
75 void raw_dynamic_load_all(ocf_cache_t cache
, struct ocf_metadata_raw
*raw
,
76 ocf_metadata_end_t cmpl
, void *priv
);
79 * RAW DYNAMIC - Flush all metadata of this RAW metadata container
82 void raw_dynamic_flush_all(ocf_cache_t cache
, struct ocf_metadata_raw
*raw
,
83 ocf_metadata_end_t cmpl
, void *priv
);
86 * RAW DYNAMIC - Mark specified entry to be flushed
88 void 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
);
92 * DYNAMIC Implementation - Do Flush Asynchronously
94 int raw_dynamic_flush_do_asynch(ocf_cache_t cache
, struct ocf_request
*req
,
95 struct ocf_metadata_raw
*raw
, ocf_req_end_t complete
);
98 #endif /* METADATA_RAW_H_ */