Motr  M0
format_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from format/format.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "format/format.h"
8 #include "format/format_xc.h"
9 
12 #if !defined(__KERNEL__)
14 #endif
15 #if !defined(__KERNEL__)
17 #endif
18 #if !defined(__KERNEL__)
20 #endif
21 #if !defined(__KERNEL__)
23 #endif
24 
25 static struct _m0_format_header_s {
29  ._type = {
31  .xct_name = "m0_format_header",
32  .xct_sizeof = sizeof (struct m0_format_header),
33  .xct_nr = 2,
35  }
36 };
37 
39 M0_BASSERT(offsetof(struct _m0_format_header_s, _child[0]) ==
40  offsetof(struct m0_xcode_type, xct_child[0]));
41 
42 static struct _m0_format_footer_s {
46  ._type = {
48  .xct_name = "m0_format_footer",
49  .xct_sizeof = sizeof (struct m0_format_footer),
50  .xct_nr = 2,
52  }
53 };
54 
56 M0_BASSERT(offsetof(struct _m0_format_footer_s, _child[0]) ==
57  offsetof(struct m0_xcode_type, xct_child[0]));
58 
59 #if !defined(__KERNEL__)
60 static struct _m0_be_mutex_s {
63 } _m0_be_mutex = {
64  ._type = {
66  .xct_name = "m0_be_mutex",
67  .xct_sizeof = sizeof (struct m0_be_mutex),
68  .xct_nr = 1,
69  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
70  }
71 };
72 
74 M0_BASSERT(offsetof(struct _m0_be_mutex_s, _child[0]) ==
75  offsetof(struct m0_xcode_type, xct_child[0]));
76 #endif
77 
78 #if !defined(__KERNEL__)
79 static struct _m0_be_rwlock_s {
82 } _m0_be_rwlock = {
83  ._type = {
85  .xct_name = "m0_be_rwlock",
86  .xct_sizeof = sizeof (struct m0_be_rwlock),
87  .xct_nr = 1,
88  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
89  }
90 };
91 
93 M0_BASSERT(offsetof(struct _m0_be_rwlock_s, _child[0]) ==
94  offsetof(struct m0_xcode_type, xct_child[0]));
95 #endif
96 
97 #if !defined(__KERNEL__)
98 static struct _m0_be_clink_s {
101 } _m0_be_clink = {
102  ._type = {
104  .xct_name = "m0_be_clink",
105  .xct_sizeof = sizeof (struct m0_be_clink),
106  .xct_nr = 1,
107  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
108  }
109 };
110 
112 M0_BASSERT(offsetof(struct _m0_be_clink_s, _child[0]) ==
113  offsetof(struct m0_xcode_type, xct_child[0]));
114 #endif
115 
116 #if !defined(__KERNEL__)
117 static struct _m0_be_chan_s {
120 } _m0_be_chan = {
121  ._type = {
123  .xct_name = "m0_be_chan",
124  .xct_sizeof = sizeof (struct m0_be_chan),
125  .xct_nr = 1,
126  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
127  }
128 };
129 
131 M0_BASSERT(offsetof(struct _m0_be_chan_s, _child[0]) ==
132  offsetof(struct m0_xcode_type, xct_child[0]));
133 #endif
134 
135 
136 M0_BASSERT(sizeof(struct m0_format_header) == 16U);
137 
138 M0_BASSERT(sizeof ((struct m0_format_header *)0)->hd_magic == 8U);
140 M0_BASSERT(sizeof ((struct m0_format_header *)0)->hd_bits == 8U);
142 
143 M0_BASSERT(sizeof(struct m0_format_footer) == 16U);
144 
145 M0_BASSERT(sizeof ((struct m0_format_footer *)0)->ft_magic == 8U);
147 M0_BASSERT(sizeof ((struct m0_format_footer *)0)->ft_checksum == 8U);
149 
150 #if !defined(__KERNEL__)
151 M0_BASSERT(sizeof(struct m0_be_mutex) == 168U);
152 #endif
153 
154 
156  { .xev_idx = 0, .xev_name = "M0_FORMAT_TYPE_BEGIN", .xev_val = 1 },
157  { .xev_idx = 1, .xev_name = "M0_FORMAT_TYPE_RPC_PACKET", .xev_val = 1 },
158  { .xev_idx = 2, .xev_name = "M0_FORMAT_TYPE_RPC_ITEM", .xev_val = 2 },
159  { .xev_idx = 3, .xev_name = "M0_FORMAT_TYPE_BE_BTREE", .xev_val = 3 },
160  { .xev_idx = 4, .xev_name = "M0_FORMAT_TYPE_BE_BNODE", .xev_val = 4 },
161  { .xev_idx = 5, .xev_name = "M0_FORMAT_TYPE_BE_EMAP_KEY", .xev_val = 5 },
162  { .xev_idx = 6, .xev_name = "M0_FORMAT_TYPE_BE_EMAP_REC", .xev_val = 6 },
163  { .xev_idx = 7, .xev_name = "M0_FORMAT_TYPE_BE_EMAP", .xev_val = 7 },
164  { .xev_idx = 8, .xev_name = "M0_FORMAT_TYPE_BE_LIST", .xev_val = 8 },
165  { .xev_idx = 9, .xev_name = "M0_FORMAT_TYPE_BE_SEG_HDR", .xev_val = 9 },
166  { .xev_idx = 10, .xev_name = "M0_FORMAT_TYPE_BALLOC", .xev_val = 10 },
167  { .xev_idx = 11, .xev_name = "M0_FORMAT_TYPE_ADDB2_FRAME_HEADER", .xev_val = 11 },
168  { .xev_idx = 12, .xev_name = "M0_FORMAT_TYPE_STOB_AD_0TYPE_REC", .xev_val = 12 },
169  { .xev_idx = 13, .xev_name = "M0_FORMAT_TYPE_STOB_AD_DOMAIN", .xev_val = 13 },
170  { .xev_idx = 14, .xev_name = "M0_FORMAT_TYPE_COB_DOMAIN", .xev_val = 14 },
171  { .xev_idx = 15, .xev_name = "M0_FORMAT_TYPE_COB_NSREC", .xev_val = 15 },
172  { .xev_idx = 16, .xev_name = "M0_FORMAT_TYPE_BALLOC_GROUP_DESC", .xev_val = 16 },
173  { .xev_idx = 17, .xev_name = "M0_FORMAT_TYPE_EXT", .xev_val = 17 },
174  { .xev_idx = 18, .xev_name = "M0_FORMAT_TYPE_CAS_INDEX", .xev_val = 18 },
175  { .xev_idx = 19, .xev_name = "M0_FORMAT_TYPE_POOLNODE", .xev_val = 19 },
176  { .xev_idx = 20, .xev_name = "M0_FORMAT_TYPE_POOLDEV", .xev_val = 20 },
177  { .xev_idx = 21, .xev_name = "M0_FORMAT_TYPE_POOL_SPARE_USAGE", .xev_val = 21 },
178  { .xev_idx = 22, .xev_name = "M0_FORMAT_TYPE_CAS_STATE", .xev_val = 22 },
179  { .xev_idx = 23, .xev_name = "M0_FORMAT_TYPE_CAS_CTG", .xev_val = 23 },
180  { .xev_idx = 24, .xev_name = "M0_FORMAT_TYPE_NR", .xev_val = 24 },
181  { .xev_idx = -1, .xev_name = "Invalid value of enum 'm0_format_type'." }
182 };
183 
185  .xe_name = "m0_format_type",
186  .xe_nr = 25,
187  .xe_val = m0_format_type_data,
188  .xe_maxlen = 33
189 };
190 
192 {
193  _m0_format_header._child[0] = (struct m0_xcode_field) {
194  .xf_name = "hd_magic",
195 
196  .xf_type = &M0_XT_U64,
197 
198  .xf_tag = 0,
199  .xf_opaque = NULL,
200  .xf_offset = offsetof(struct m0_format_header, hd_magic),
201  .xf_read = NULL,
202  .xf_decor = {
204  }
205  };
206  m0_xc_u64_init();
207 
208  _m0_format_header._child[1] = (struct m0_xcode_field) {
209  .xf_name = "hd_bits",
210 
211  .xf_type = &M0_XT_U64,
212 
213  .xf_tag = 0,
214  .xf_opaque = NULL,
215  .xf_offset = offsetof(struct m0_format_header, hd_bits),
216  .xf_read = NULL,
217  .xf_decor = {
219  }
220  };
221  m0_xc_u64_init();
222 
224 }
225 
227 {
228  _m0_format_footer._child[0] = (struct m0_xcode_field) {
229  .xf_name = "ft_magic",
230 
231  .xf_type = &M0_XT_U64,
232 
233  .xf_tag = 0,
234  .xf_opaque = NULL,
235  .xf_offset = offsetof(struct m0_format_footer, ft_magic),
236  .xf_read = NULL,
237  .xf_decor = {
239  }
240  };
241  m0_xc_u64_init();
242 
243  _m0_format_footer._child[1] = (struct m0_xcode_field) {
244  .xf_name = "ft_checksum",
245 
246  .xf_type = &M0_XT_U64,
247 
248  .xf_tag = 0,
249  .xf_opaque = NULL,
250  .xf_offset = offsetof(struct m0_format_footer, ft_checksum),
251  .xf_read = NULL,
252  .xf_decor = {
254  }
255  };
256  m0_xc_u64_init();
257 
259 }
260 
261 #if !defined(__KERNEL__)
262 M0_INTERNAL void m0_xc_m0_be_mutex_struct_init(void)
263 {
264  _m0_be_mutex._child[0] = (struct m0_xcode_field) {
265  .xf_name = "blob",
266 
267  .xf_type = &M0_XT_U8,
268 
269  .xf_tag = 168,
270  .xf_opaque = NULL,
271  .xf_offset = 0,
272  .xf_read = NULL,
273  .xf_decor = {
275  }
276  };
277  m0_xc_u8_init();
278 
280 }
281 #endif
282 
283 #if !defined(__KERNEL__)
284 M0_INTERNAL void m0_xc_m0_be_rwlock_struct_init(void)
285 {
286  _m0_be_rwlock._child[0] = (struct m0_xcode_field) {
287  .xf_name = "blob",
288 
289  .xf_type = &M0_XT_U8,
290 
291  .xf_tag = 144,
292  .xf_opaque = NULL,
293  .xf_offset = 0,
294  .xf_read = NULL,
295  .xf_decor = {
297  }
298  };
299  m0_xc_u8_init();
300 
302 }
303 #endif
304 
305 #if !defined(__KERNEL__)
306 M0_INTERNAL void m0_xc_m0_be_clink_struct_init(void)
307 {
308  _m0_be_clink._child[0] = (struct m0_xcode_field) {
309  .xf_name = "blob",
310 
311  .xf_type = &M0_XT_U8,
312 
313  .xf_tag = 88,
314  .xf_opaque = NULL,
315  .xf_offset = 0,
316  .xf_read = NULL,
317  .xf_decor = {
319  }
320  };
321  m0_xc_u8_init();
322 
324 }
325 #endif
326 
327 #if !defined(__KERNEL__)
328 M0_INTERNAL void m0_xc_m0_be_chan_struct_init(void)
329 {
330  _m0_be_chan._child[0] = (struct m0_xcode_field) {
331  .xf_name = "blob",
332 
333  .xf_type = &M0_XT_U8,
334 
335  .xf_tag = 48,
336  .xf_opaque = NULL,
337  .xf_offset = 0,
338  .xf_read = NULL,
339  .xf_decor = {
341  }
342  };
343  m0_xc_u8_init();
344 
346 }
347 #endif
348 
349 M0_INTERNAL void m0_xc_format_format_init(void)
350 {
353 #if !defined(__KERNEL__)
355 #endif
356 #if !defined(__KERNEL__)
358 #endif
359 #if !defined(__KERNEL__)
361 #endif
362 #if !defined(__KERNEL__)
364 #endif
365 }
366 
367 M0_INTERNAL void m0_xc_format_format_fini(void)
368 {
369 }
M0_INTERNAL void m0_xc_m0_be_rwlock_struct_init(void)
Definition: format_xc.c:284
#define NULL
Definition: misc.h:38
static struct _m0_be_rwlock_s _m0_be_rwlock
M0_BASSERT(offsetof(struct _m0_format_header_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
M0_INTERNAL void m0_xc_m0_format_footer_struct_init(void)
Definition: format_xc.c:226
struct m0_xcode_field _child[1]
Definition: format_xc.c:62
struct m0_xcode_type _type
Definition: format_xc.c:80
static struct _m0_format_footer_s _m0_format_footer
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
M0_INTERNAL void m0_xc_format_format_fini(void)
Definition: format_xc.c:367
struct m0_xcode_type * m0_be_clink_xc
Definition: format_xc.c:19
const char * xe_name
Definition: enum.h:58
static struct _m0_be_mutex_s _m0_be_mutex
struct m0_xcode_type _type
Definition: format_xc.c:61
M0_INTERNAL void m0_xc_m0_be_chan_struct_init(void)
Definition: format_xc.c:328
static struct _m0_format_header_s _m0_format_header
struct m0_xcode_field _child[1]
Definition: format_xc.c:81
static struct _m0_be_clink_s _m0_be_clink
M0_INTERNAL void m0_xc_format_format_init(void)
Definition: format_xc.c:349
uint64_t hd_bits
Definition: format.h:164
#define M0_POST(cond)
uint64_t ft_checksum
Definition: format.h:151
struct m0_xcode_field _child[1]
Definition: format_xc.c:119
bool m0_xcode_type_invariant(const struct m0_xcode_type *xt)
Definition: xcode.c:74
struct m0_xcode_type * m0_be_chan_xc
Definition: format_xc.c:22
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
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
uint64_t ft_magic
Definition: format.h:150
struct m0_xcode_type * m0_format_header_xc
Definition: format_xc.c:10
uint64_t hd_magic
Definition: format.h:154
struct m0_xcode_type _type
Definition: format_xc.c:118
struct m0_xcode_field _child[2]
Definition: format_xc.c:27
const struct m0_xcode_type M0_XT_U8
Definition: xcode.c:924
struct m0_xcode_type * m0_be_mutex_xc
Definition: format_xc.c:13
void m0_xc_u8_init(void)
Definition: xcode.c:892
const struct m0_xcode_enum_val m0_format_type_data[]
Definition: format_xc.c:155
const char * xf_name
Definition: xcode.h:251
M0_INTERNAL void m0_xc_m0_be_mutex_struct_init(void)
Definition: format_xc.c:262
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
struct m0_xcode_enum m0_xc_m0_format_type_enum
Definition: format_xc.c:184
#define offsetof(typ, memb)
Definition: misc.h:29
M0_INTERNAL void m0_xc_m0_be_clink_struct_init(void)
Definition: format_xc.c:306
struct m0_xcode_type * m0_be_rwlock_xc
Definition: format_xc.c:16
static struct _m0_be_chan_s _m0_be_chan
struct m0_xcode_type _type
Definition: format_xc.c:26
struct m0_xcode_type * m0_format_footer_xc
Definition: format_xc.c:11