Motr  M0
extmap_internal.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #pragma once
24 
25 #ifndef __MOTR_BE_EXTMAP_INTERNAL_H__
26 #define __MOTR_BE_EXTMAP_INTERNAL_H__
27 
39 #include "lib/buf.h" /* m0_buf */
40 #include "lib/buf_xc.h"
41 #include "lib/types.h" /* m0_uint128 */
42 #include "lib/types_xc.h"
43 #include "be/btree.h" /* m0_btree */
44 #include "be/btree_xc.h"
45 
48 
49  /* future versions, uncomment and update M0_BE_EMAP_KEY_FORMAT_VERSION */
50  /*M0_BE_EMAP_KEY_FORMAT_VERSION_2,*/
51  /*M0_BE_EMAP_KEY_FORMAT_VERSION_3,*/
52 
55 };
56 
66 
78 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
79 
82 
83  /* future versions, uncomment and update M0_BE_EMAP_REC_FORMAT_VERSION */
84  /*M0_BE_EMAP_REC_FORMAT_VERSION_2,*/
85  /*M0_BE_EMAP_REC_FORMAT_VERSION_3,*/
86 
89 };
90 
110  uint64_t er_value;
113 
114  /* Note: Layout/format of emap-record (if checksum is present):
115  * - [Hdr| Balloc-Ext-Start| Balloc-Ext-Value| CS-nob| CS-Array[...]| Ftr]
116  * Record gets stored as contigious buffer
117  * ***** ChecksumArray[0...(er_cksum_nob -1)] *****
118  */
120  uint32_t er_cksum_nob;
122 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
123 
126 
127  /* future versions, uncomment and update M0_BE_EMAP_FORMAT_VERSION */
128  /*M0_BE_EMAP_FORMAT_VERSION_2,*/
129  /*M0_BE_EMAP_FORMAT_VERSION_3,*/
130 
133 };
134 
141 struct m0_be_emap {
144  /*
145  * m0_be_btree has it's own volatile-only fields, so it can't be placed
146  * before the m0_format_footer, where only persistent fields allowed
147  */
149  /*
150  * volatile-only fields
151  */
152  uint64_t em_version;
154  struct m0_be_seg *em_seg;
160 } M0_XCA_RECORD M0_XCA_DOMAIN(be);
161 
164 /* __MOTR_BE_EXTMAP_INTERNAL_H__ */
165 #endif
166 
167 /*
168  * Local variables:
169  * c-indentation-style: "K&R"
170  * c-basic-offset: 8
171  * tab-width: 8
172  * fill-column: 80
173  * scroll-step: 1
174  * End:
175  */
struct m0_format_header er_header
struct m0_be_emap_key em_key
m0_bindex_t ek_offset
struct m0_format_header ek_header
struct m0_format_footer ek_footer
struct m0_be_emap_rec em_rec
struct m0_be_rwlock em_lock
uint64_t m0_bindex_t
Definition: types.h:80
m0_bindex_t er_unit_size
uint32_t er_cksum_nob
struct m0_buf em_key_buf
Definition: buf.h:37
enum m0_be_emap_rec_format_version M0_XCA_DOMAIN
uint64_t em_version
m0_be_emap_rec_format_version
struct m0_uint128 ek_prefix
struct m0_be_seg * em_seg
Definition: seg.h:66
m0_be_emap_key_format_version
struct m0_be_btree em_mapping
m0_be_emap_format_version
struct m0_format_header em_header
struct m0_buf em_val_buf
struct m0_format_footer em_footer
struct m0_format_footer er_footer
m0_bindex_t er_start
static struct m0_be_ut_backend be
Definition: service_ut.c:59