Motr  M0
btree_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from be/btree.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "be/btree.h"
8 #include "be/btree_xc.h"
9 
10 #if !defined(__KERNEL__)
12 #endif
13 #if !defined(__KERNEL__)
15 #endif
16 
17 #if !defined(__KERNEL__)
18 static struct _m0_be_btree_s {
21 } _m0_be_btree = {
22  ._type = {
24  .xct_name = "m0_be_btree",
25  .xct_sizeof = sizeof (struct m0_be_btree),
26  .xct_nr = 8,
27  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
28  }
29 };
30 
32 M0_BASSERT(offsetof(struct _m0_be_btree_s, _child[0]) ==
33  offsetof(struct m0_xcode_type, xct_child[0]));
34 #endif
35 
36 #if !defined(__KERNEL__)
37 static struct _m0_be_btree_backlink_s {
41  ._type = {
43  .xct_name = "m0_be_btree_backlink",
44  .xct_sizeof = sizeof (struct m0_be_btree_backlink),
45  .xct_nr = 4,
46  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
47  }
48 };
49 
51 M0_BASSERT(offsetof(struct _m0_be_btree_backlink_s, _child[0]) ==
52  offsetof(struct m0_xcode_type, xct_child[0]));
53 #endif
54 
55 
56 #if !defined(__KERNEL__)
57 M0_BASSERT(sizeof(struct m0_be_btree) == 256U);
58 #endif
59 
60 #if !defined(__KERNEL__)
61 M0_BASSERT(sizeof ((struct m0_be_btree *)0)->bb_header == 16U);
63 #endif
64 #if !defined(__KERNEL__)
65 M0_BASSERT(sizeof ((struct m0_be_btree *)0)->bb_cookie_gen == 8U);
67 #endif
68 #if !defined(__KERNEL__)
69 M0_BASSERT(sizeof ((struct m0_be_btree *)0)->bb_backlink == 48U);
71 #endif
72 #if !defined(__KERNEL__)
73 M0_BASSERT(sizeof ((struct m0_be_btree *)0)->bb_root == 8U);
74 M0_BASSERT(offsetof(struct m0_be_btree, bb_root) == 72U);
75 #endif
76 #if !defined(__KERNEL__)
77 M0_BASSERT(sizeof ((struct m0_be_btree *)0)->bb_footer == 16U);
78 M0_BASSERT(offsetof(struct m0_be_btree, bb_footer) == 80U);
79 #endif
80 #if !defined(__KERNEL__)
81 M0_BASSERT(sizeof ((struct m0_be_btree *)0)->bb_lock == 144U);
82 M0_BASSERT(offsetof(struct m0_be_btree, bb_lock) == 96U);
83 #endif
84 #if !defined(__KERNEL__)
85 M0_BASSERT(sizeof ((struct m0_be_btree *)0)->bb_seg == 8U);
86 M0_BASSERT(offsetof(struct m0_be_btree, bb_seg) == 240U);
87 #endif
88 #if !defined(__KERNEL__)
89 M0_BASSERT(sizeof ((struct m0_be_btree *)0)->bb_ops == 8U);
90 M0_BASSERT(offsetof(struct m0_be_btree, bb_ops) == 248U);
91 #endif
92 
93 #if !defined(__KERNEL__)
94 M0_BASSERT(sizeof(struct m0_be_btree_backlink) == 48U);
95 #endif
96 
97 #if !defined(__KERNEL__)
98 M0_BASSERT(sizeof ((struct m0_be_btree_backlink *)0)->bli_tree == 16U);
100 #endif
101 #if !defined(__KERNEL__)
102 M0_BASSERT(sizeof ((struct m0_be_btree_backlink *)0)->bli_type == 8U);
104 #endif
105 #if !defined(__KERNEL__)
106 M0_BASSERT(sizeof ((struct m0_be_btree_backlink *)0)->bli_gen == 8U);
108 #endif
109 #if !defined(__KERNEL__)
110 M0_BASSERT(sizeof ((struct m0_be_btree_backlink *)0)->bli_fid == 16U);
112 #endif
113 
114 
116  { .xev_idx = 0, .xev_name = "M0_BBT_INVALID", .xev_val = 1 },
117  { .xev_idx = 1, .xev_name = "M0_BBT_BALLOC_GROUP_EXTENTS", .xev_val = 2 },
118  { .xev_idx = 2, .xev_name = "M0_BBT_BALLOC_GROUP_DESC", .xev_val = 3 },
119  { .xev_idx = 3, .xev_name = "M0_BBT_EMAP_EM_MAPPING", .xev_val = 4 },
120  { .xev_idx = 4, .xev_name = "M0_BBT_CAS_CTG", .xev_val = 5 },
121  { .xev_idx = 5, .xev_name = "M0_BBT_COB_NAMESPACE", .xev_val = 6 },
122  { .xev_idx = 6, .xev_name = "M0_BBT_COB_OBJECT_INDEX", .xev_val = 7 },
123  { .xev_idx = 7, .xev_name = "M0_BBT_COB_FILEATTR_BASIC", .xev_val = 8 },
124  { .xev_idx = 8, .xev_name = "M0_BBT_COB_FILEATTR_EA", .xev_val = 9 },
125  { .xev_idx = 9, .xev_name = "M0_BBT_COB_FILEATTR_OMG", .xev_val = 10 },
126  { .xev_idx = 10, .xev_name = "M0_BBT_COB_BYTECOUNT", .xev_val = 11 },
127  { .xev_idx = 11, .xev_name = "M0_BBT_CONFDB", .xev_val = 12 },
128  { .xev_idx = 12, .xev_name = "M0_BBT_UT_KV_OPS", .xev_val = 13 },
129  { .xev_idx = 13, .xev_name = "M0_BBT_NR", .xev_val = 14 },
130  { .xev_idx = -1, .xev_name = "Invalid value of enum 'm0_be_btree_type'." }
131 };
132 
134  .xe_name = "m0_be_btree_type",
135  .xe_nr = 14,
136  .xe_val = m0_be_btree_type_data,
137  .xe_maxlen = 27
138 };
139 
140 #if !defined(__KERNEL__)
141 M0_INTERNAL void m0_xc_m0_be_btree_struct_init(void)
142 {
143  _m0_be_btree._child[0] = (struct m0_xcode_field) {
144  .xf_name = "bb_header",
145 
146  .xf_type = m0_format_header_xc,
147 
148  .xf_tag = 0,
149  .xf_opaque = NULL,
150  .xf_offset = offsetof(struct m0_be_btree, bb_header),
151  .xf_read = NULL,
152  .xf_decor = {
154  }
155  };
157 
158  _m0_be_btree._child[1] = (struct m0_xcode_field) {
159  .xf_name = "bb_cookie_gen",
160 
161  .xf_type = &M0_XT_U64,
162 
163  .xf_tag = 0,
164  .xf_opaque = NULL,
165  .xf_offset = offsetof(struct m0_be_btree, bb_cookie_gen),
166  .xf_read = NULL,
167  .xf_decor = {
169  }
170  };
171  m0_xc_u64_init();
172 
173  _m0_be_btree._child[2] = (struct m0_xcode_field) {
174  .xf_name = "bb_backlink",
175 #ifdef __KERNEL__
176  .xf_type = &M0_XT_VOID,
177 #else
178 
179  .xf_type = m0_be_btree_backlink_xc,
180 #endif
181  .xf_tag = 0,
182  .xf_opaque = NULL,
183  .xf_offset = offsetof(struct m0_be_btree, bb_backlink),
184  .xf_read = NULL,
185  .xf_decor = {
187  }
188  };
189 #if !defined(__KERNEL__)
191 #endif
192 
193  _m0_be_btree._child[3] = (struct m0_xcode_field) {
194  .xf_name = "bb_root",
195 
196  .xf_type = &M0_XT_U64,
197 
198  .xf_tag = 0,
199  .xf_opaque = NULL,
200  .xf_offset = offsetof(struct m0_be_btree, bb_root),
201  .xf_read = NULL,
202  .xf_decor = {
204  }
205  };
206  m0_xc_u64_init();
207 
208  _m0_be_btree._child[4] = (struct m0_xcode_field) {
209  .xf_name = "bb_footer",
210 
211  .xf_type = m0_format_footer_xc,
212 
213  .xf_tag = 0,
214  .xf_opaque = NULL,
215  .xf_offset = offsetof(struct m0_be_btree, bb_footer),
216  .xf_read = NULL,
217  .xf_decor = {
219  }
220  };
222 
223  _m0_be_btree._child[5] = (struct m0_xcode_field) {
224  .xf_name = "bb_lock",
225 #ifdef __KERNEL__
226  .xf_type = &M0_XT_VOID,
227 #else
228 
229  .xf_type = m0_be_rwlock_xc,
230 #endif
231  .xf_tag = 0,
232  .xf_opaque = NULL,
233  .xf_offset = offsetof(struct m0_be_btree, bb_lock),
234  .xf_read = NULL,
235  .xf_decor = {
237  }
238  };
239 #if !defined(__KERNEL__)
241 #endif
242 
243  _m0_be_btree._child[6] = (struct m0_xcode_field) {
244  .xf_name = "bb_seg",
245 
246  .xf_type = &M0_XT_U64,
247 
248  .xf_tag = 0,
249  .xf_opaque = NULL,
250  .xf_offset = offsetof(struct m0_be_btree, bb_seg),
251  .xf_read = NULL,
252  .xf_decor = {
254  }
255  };
256  m0_xc_u64_init();
257 
258  _m0_be_btree._child[7] = (struct m0_xcode_field) {
259  .xf_name = "bb_ops",
260 
261  .xf_type = &M0_XT_U64,
262 
263  .xf_tag = 0,
264  .xf_opaque = NULL,
265  .xf_offset = offsetof(struct m0_be_btree, bb_ops),
266  .xf_read = NULL,
267  .xf_decor = {
269  }
270  };
271  m0_xc_u64_init();
272 
274 }
275 #endif
276 
277 #if !defined(__KERNEL__)
279 {
281  .xf_name = "bli_tree",
282 
283  .xf_type = m0_cookie_xc,
284 
285  .xf_tag = 0,
286  .xf_opaque = NULL,
287  .xf_offset = offsetof(struct m0_be_btree_backlink, bli_tree),
288  .xf_read = NULL,
289  .xf_decor = {
291  }
292  };
294 
296  .xf_name = "bli_type",
297 
298  .xf_type = &M0_XT_U64,
299 
300  .xf_tag = 0,
301  .xf_opaque = NULL,
302  .xf_offset = offsetof(struct m0_be_btree_backlink, bli_type),
303  .xf_read = NULL,
304  .xf_decor = {
306  }
307  };
308  m0_xc_u64_init();
309 
311  .xf_name = "bli_gen",
312 
313  .xf_type = &M0_XT_U64,
314 
315  .xf_tag = 0,
316  .xf_opaque = NULL,
317  .xf_offset = offsetof(struct m0_be_btree_backlink, bli_gen),
318  .xf_read = NULL,
319  .xf_decor = {
321  }
322  };
323  m0_xc_u64_init();
324 
326  .xf_name = "bli_fid",
327 
328  .xf_type = m0_fid_xc,
329 
330  .xf_tag = 0,
331  .xf_opaque = NULL,
332  .xf_offset = offsetof(struct m0_be_btree_backlink, bli_fid),
333  .xf_read = NULL,
334  .xf_decor = {
336  }
337  };
339 
341 }
342 #endif
343 
344 M0_INTERNAL void m0_xc_be_btree_init(void)
345 {
346 #if !defined(__KERNEL__)
348 #endif
349 #if !defined(__KERNEL__)
351 #endif
352 }
353 
354 M0_INTERNAL void m0_xc_be_btree_fini(void)
355 {
356 }
struct m0_xcode_type _type
Definition: btree_xc.c:19
M0_INTERNAL void m0_xc_m0_be_btree_backlink_struct_init(void)
Definition: btree_xc.c:278
uint64_t bb_cookie_gen
Definition: btree.h:59
M0_INTERNAL void m0_xc_m0_be_rwlock_struct_init(void)
Definition: format_xc.c:284
#define NULL
Definition: misc.h:38
M0_INTERNAL void m0_xc_m0_format_footer_struct_init(void)
Definition: format_xc.c:226
const struct m0_be_btree_kv_ops * bb_ops
Definition: btree.h:72
M0_INTERNAL void m0_xc_m0_cookie_struct_init(void)
Definition: cookie_xc.c:39
struct m0_xcode_type * m0_be_btree_xc
Definition: btree_xc.c:11
struct m0_cookie bli_tree
Definition: btree.h:55
struct m0_be_btree_backlink bb_backlink
Definition: btree.h:60
struct m0_xcode_field _child[8]
Definition: btree_xc.c:20
const struct m0_xcode_enum_val m0_be_btree_type_data[]
Definition: btree_xc.c:115
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
M0_INTERNAL void m0_xc_be_btree_fini(void)
Definition: btree_xc.c:354
M0_INTERNAL void m0_xc_m0_fid_struct_init(void)
Definition: fid_xc.c:64
M0_INTERNAL void m0_xc_m0_be_btree_struct_init(void)
Definition: btree_xc.c:141
struct m0_be_seg * bb_seg
Definition: btree.h:70
const char * xe_name
Definition: enum.h:58
struct m0_be_rwlock bb_lock
Definition: btree.h:68
struct m0_format_footer bb_footer
Definition: btree.h:63
uint64_t bli_type
Definition: btree.h:56
struct m0_xcode_type * m0_be_btree_backlink_xc
Definition: btree_xc.c:14
const struct m0_xcode_type M0_XT_VOID
Definition: xcode.c:916
struct m0_xcode_enum m0_xc_m0_be_btree_type_enum
Definition: btree_xc.c:133
#define M0_POST(cond)
M0_INTERNAL void m0_xc_be_btree_init(void)
Definition: btree_xc.c:344
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
M0_INTERNAL void m0_xc_m0_format_header_struct_init(void)
Definition: format_xc.c:191
void m0_xc_u64_init(void)
Definition: xcode.c:904
uint64_t bli_gen
Definition: btree.h:57
struct m0_fid bli_fid
Definition: btree.h:58
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
struct m0_format_header bb_header
Definition: btree.h:58
static struct _m0_be_btree_backlink_s _m0_be_btree_backlink
struct m0_xcode_type * m0_format_header_xc
Definition: format_xc.c:10
struct m0_xcode_type * m0_cookie_xc
Definition: cookie_xc.c:10
M0_BASSERT(offsetof(struct _m0_be_btree_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
const char * xf_name
Definition: xcode.h:251
struct m0_be_bnode * bb_root
Definition: btree.h:62
struct m0_xcode_type * m0_fid_xc
Definition: fid_xc.c:10
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
static struct _m0_be_btree_s _m0_be_btree
#define offsetof(typ, memb)
Definition: misc.h:29
struct m0_xcode_type * m0_be_rwlock_xc
Definition: format_xc.c:16
struct m0_xcode_type * m0_format_footer_xc
Definition: format_xc.c:11