Motr  M0
ad_xc.c
Go to the documentation of this file.
1 /* This file is automatically generated from stob/ad.h */
2 
3 #include "lib/misc.h" /* offsetof */
4 #include "lib/assert.h"
5 #include "xcode/xcode.h"
6 
7 #include "stob/ad.h"
8 #include "stob/ad_xc.h"
9 
10 #if !defined(__KERNEL__)
12 #endif
13 #if !defined(__KERNEL__)
15 #endif
16 
17 #if !defined(__KERNEL__)
18 static struct _m0_ad_balloc_s {
21 } _m0_ad_balloc = {
22  ._type = {
24  .xct_name = "m0_ad_balloc",
25  .xct_sizeof = sizeof (struct m0_ad_balloc),
26  .xct_nr = 1,
27  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
28  }
29 };
30 
32 M0_BASSERT(offsetof(struct _m0_ad_balloc_s, _child[0]) ==
33  offsetof(struct m0_xcode_type, xct_child[0]));
34 #endif
35 
36 #if !defined(__KERNEL__)
37 static struct _m0_stob_ad_domain_s {
39  struct m0_xcode_field _child[17];
41  ._type = {
43  .xct_name = "m0_stob_ad_domain",
44  .xct_sizeof = sizeof (struct m0_stob_ad_domain),
45  .xct_nr = 17,
46  .xct_flags = M0_XCODE_TYPE_FLAG_DOM_BE,
47  }
48 };
49 
51 M0_BASSERT(offsetof(struct _m0_stob_ad_domain_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_ad_balloc) == 8U);
58 #endif
59 
60 #if !defined(__KERNEL__)
61 M0_BASSERT(sizeof ((struct m0_ad_balloc *)0)->ab_ops == 8U);
62 M0_BASSERT(offsetof(struct m0_ad_balloc, ab_ops) == 0U);
63 #endif
64 
65 #if !defined(__KERNEL__)
66 M0_BASSERT(sizeof(struct m0_stob_ad_domain) == 4840U);
67 #endif
68 
69 #if !defined(__KERNEL__)
70 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_header == 16U);
72 #endif
73 #if !defined(__KERNEL__)
74 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_dom_key == 8U);
76 #endif
77 #if !defined(__KERNEL__)
78 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_bstore_id == 32U);
80 #endif
81 #if !defined(__KERNEL__)
82 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_ballroom == 8U);
84 #endif
85 #if !defined(__KERNEL__)
86 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_container_size == 8U);
88 #endif
89 #if !defined(__KERNEL__)
90 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_bshift == 4U);
92 #endif
93 #if !defined(__KERNEL__)
94 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_babshift == 4U);
96 #endif
97 #if !defined(__KERNEL__)
98 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_blocks_per_group == 8U);
100 #endif
101 #if !defined(__KERNEL__)
102 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_spare_blocks_per_group == 8U);
104 #endif
105 #if !defined(__KERNEL__)
106 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_path == 4096U);
108 #endif
109 #if !defined(__KERNEL__)
110 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_overwrite == 1U);
112 #endif
113 #if !defined(__KERNEL__)
114 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_pad == 7U);
115 M0_BASSERT(offsetof(struct m0_stob_ad_domain, sad_pad) == 4193U);
116 #endif
117 #if !defined(__KERNEL__)
118 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_footer == 16U);
120 #endif
121 #if !defined(__KERNEL__)
122 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_adata == 600U);
124 #endif
125 #if !defined(__KERNEL__)
126 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_bstore == 8U);
128 #endif
129 #if !defined(__KERNEL__)
130 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_be_seg == 8U);
132 #endif
133 #if !defined(__KERNEL__)
134 M0_BASSERT(sizeof ((struct m0_stob_ad_domain *)0)->sad_magix == 8U);
136 #endif
137 
138 
139 
140 #if !defined(__KERNEL__)
141 M0_INTERNAL void m0_xc_m0_ad_balloc_struct_init(void)
142 {
143  _m0_ad_balloc._child[0] = (struct m0_xcode_field) {
144  .xf_name = "ab_ops",
145 
146  .xf_type = &M0_XT_U64,
147 
148  .xf_tag = 0,
149  .xf_opaque = NULL,
150  .xf_offset = offsetof(struct m0_ad_balloc, ab_ops),
151  .xf_read = NULL,
152  .xf_decor = {
154  }
155  };
156  m0_xc_u64_init();
157 
159 }
160 #endif
161 
162 #if !defined(__KERNEL__)
164 {
166  .xf_name = "sad_header",
167 
168  .xf_type = m0_format_header_xc,
169 
170  .xf_tag = 0,
171  .xf_opaque = NULL,
172  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_header),
173  .xf_read = NULL,
174  .xf_decor = {
176  }
177  };
179 
181  .xf_name = "sad_dom_key",
182 
183  .xf_type = &M0_XT_U64,
184 
185  .xf_tag = 0,
186  .xf_opaque = NULL,
187  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_dom_key),
188  .xf_read = NULL,
189  .xf_decor = {
191  }
192  };
193  m0_xc_u64_init();
194 
196  .xf_name = "sad_bstore_id",
197 
198  .xf_type = m0_stob_id_xc,
199 
200  .xf_tag = 0,
201  .xf_opaque = NULL,
202  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_bstore_id),
203  .xf_read = NULL,
204  .xf_decor = {
206  }
207  };
209 
211  .xf_name = "sad_ballroom",
212 #ifdef __KERNEL__
213  .xf_type = &M0_XT_VOID,
214 #else
215 
216  .xf_type = &M0_XT_U64,
217 #endif
218  .xf_tag = 0,
219  .xf_opaque = NULL,
220  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_ballroom),
221  .xf_read = NULL,
222  .xf_decor = {
224  }
225  };
226 #if !defined(__KERNEL__)
227  m0_xc_u64_init();
228 #endif
229 
231  .xf_name = "sad_container_size",
232 
233  .xf_type = &M0_XT_U64,
234 
235  .xf_tag = 0,
236  .xf_opaque = NULL,
237  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_container_size),
238  .xf_read = NULL,
239  .xf_decor = {
241  }
242  };
243  m0_xc_u64_init();
244 
246  .xf_name = "sad_bshift",
247 
248  .xf_type = &M0_XT_U32,
249 
250  .xf_tag = 0,
251  .xf_opaque = NULL,
252  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_bshift),
253  .xf_read = NULL,
254  .xf_decor = {
256  }
257  };
258  m0_xc_u32_init();
259 
261  .xf_name = "sad_babshift",
262 
263  .xf_type = &M0_XT_U32,
264 
265  .xf_tag = 0,
266  .xf_opaque = NULL,
267  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_babshift),
268  .xf_read = NULL,
269  .xf_decor = {
271  }
272  };
273  m0_xc_u32_init();
274 
276  .xf_name = "sad_blocks_per_group",
277 
278  .xf_type = &M0_XT_U64,
279 
280  .xf_tag = 0,
281  .xf_opaque = NULL,
282  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_blocks_per_group),
283  .xf_read = NULL,
284  .xf_decor = {
286  }
287  };
288  m0_xc_u64_init();
289 
291  .xf_name = "sad_spare_blocks_per_group",
292 
293  .xf_type = &M0_XT_U64,
294 
295  .xf_tag = 0,
296  .xf_opaque = NULL,
298  .xf_read = NULL,
299  .xf_decor = {
301  }
302  };
303  m0_xc_u64_init();
304 
306  .xf_name = "sad_path",
307 
308  .xf_type = &M0_XT_U8,
309 
310  .xf_tag = 4096,
311  .xf_opaque = NULL,
312  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_path),
313  .xf_read = NULL,
314  .xf_decor = {
316  }
317  };
318  m0_xc_u8_init();
319 
320  _m0_stob_ad_domain._child[10] = (struct m0_xcode_field) {
321  .xf_name = "sad_overwrite",
322 
323  .xf_type = &M0_XT_U8,
324 
325  .xf_tag = 0,
326  .xf_opaque = NULL,
327  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_overwrite),
328  .xf_read = NULL,
329  .xf_decor = {
331  }
332  };
333  m0_xc_u8_init();
334 
335  _m0_stob_ad_domain._child[11] = (struct m0_xcode_field) {
336  .xf_name = "sad_pad",
337 
338  .xf_type = &M0_XT_U8,
339 
340  .xf_tag = 7,
341  .xf_opaque = NULL,
342  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_pad),
343  .xf_read = NULL,
344  .xf_decor = {
346  }
347  };
348  m0_xc_u8_init();
349 
350  _m0_stob_ad_domain._child[12] = (struct m0_xcode_field) {
351  .xf_name = "sad_footer",
352 
353  .xf_type = m0_format_footer_xc,
354 
355  .xf_tag = 0,
356  .xf_opaque = NULL,
357  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_footer),
358  .xf_read = NULL,
359  .xf_decor = {
361  }
362  };
364 
365  _m0_stob_ad_domain._child[13] = (struct m0_xcode_field) {
366  .xf_name = "sad_adata",
367 #ifdef __KERNEL__
368  .xf_type = &M0_XT_VOID,
369 #else
370 
371  .xf_type = m0_be_emap_xc,
372 #endif
373  .xf_tag = 0,
374  .xf_opaque = NULL,
375  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_adata),
376  .xf_read = NULL,
377  .xf_decor = {
379  }
380  };
381 #if !defined(__KERNEL__)
383 #endif
384 
385  _m0_stob_ad_domain._child[14] = (struct m0_xcode_field) {
386  .xf_name = "sad_bstore",
387 
388  .xf_type = &M0_XT_U64,
389 
390  .xf_tag = 0,
391  .xf_opaque = NULL,
392  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_bstore),
393  .xf_read = NULL,
394  .xf_decor = {
396  }
397  };
398  m0_xc_u64_init();
399 
400  _m0_stob_ad_domain._child[15] = (struct m0_xcode_field) {
401  .xf_name = "sad_be_seg",
402 
403  .xf_type = &M0_XT_U64,
404 
405  .xf_tag = 0,
406  .xf_opaque = NULL,
407  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_be_seg),
408  .xf_read = NULL,
409  .xf_decor = {
411  }
412  };
413  m0_xc_u64_init();
414 
415  _m0_stob_ad_domain._child[16] = (struct m0_xcode_field) {
416  .xf_name = "sad_magix",
417 
418  .xf_type = &M0_XT_U64,
419 
420  .xf_tag = 0,
421  .xf_opaque = NULL,
422  .xf_offset = offsetof(struct m0_stob_ad_domain, sad_magix),
423  .xf_read = NULL,
424  .xf_decor = {
426  }
427  };
428  m0_xc_u64_init();
429 
431 }
432 #endif
433 
434 M0_INTERNAL void m0_xc_stob_ad_init(void)
435 {
436 #if !defined(__KERNEL__)
438 #endif
439 #if !defined(__KERNEL__)
441 #endif
442 }
443 
444 M0_INTERNAL void m0_xc_stob_ad_fini(void)
445 {
446 }
uint32_t sad_bshift
Definition: ad.h:1516
#define NULL
Definition: misc.h:38
M0_INTERNAL void m0_xc_m0_stob_id_struct_init(void)
Definition: stob_xc.c:39
M0_INTERNAL void m0_xc_m0_format_footer_struct_init(void)
Definition: format_xc.c:226
uint64_t sad_dom_key
Definition: ad.h:1512
M0_INTERNAL void m0_xc_m0_be_emap_struct_init(void)
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
bool sad_overwrite
Definition: ad.h:1521
M0_INTERNAL void m0_xc_m0_stob_ad_domain_struct_init(void)
Definition: ad_xc.c:163
struct m0_xcode_type * m0_stob_id_xc
Definition: stob_xc.c:10
M0_INTERNAL void m0_xc_stob_ad_init(void)
Definition: ad_xc.c:434
m0_bcount_t sad_spare_blocks_per_group
Definition: ad.h:1519
struct m0_be_seg * sad_be_seg
Definition: ad.h:1533
struct m0_xcode_field _child[1]
Definition: ad_xc.c:20
struct m0_xcode_type _type
Definition: ad_xc.c:38
struct m0_xcode_type * m0_ad_balloc_xc
Definition: ad_xc.c:11
struct m0_be_emap sad_adata
Definition: ad.h:1528
const struct m0_xcode_type M0_XT_VOID
Definition: xcode.c:916
struct m0_xcode_type _type
Definition: ad_xc.c:19
struct m0_stob_id sad_bstore_id
Definition: ad.h:1513
struct m0_xcode_type * m0_stob_ad_domain_xc
Definition: ad_xc.c:14
#define M0_POST(cond)
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
m0_bcount_t sad_blocks_per_group
Definition: ad.h:1518
M0_INTERNAL void m0_xc_stob_ad_fini(void)
Definition: ad_xc.c:444
void m0_xc_u64_init(void)
Definition: xcode.c:904
struct m0_format_footer sad_footer
Definition: ad.h:1523
struct m0_xcode_field _child[17]
Definition: ad_xc.c:39
static struct _m0_stob_ad_domain_s _m0_stob_ad_domain
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
int32_t sad_babshift
Definition: ad.h:1517
enum m0_xcode_aggr xct_aggr
Definition: xcode.h:316
struct m0_xcode_type * m0_format_header_xc
Definition: format_xc.c:10
struct m0_format_header sad_header
Definition: ad.h:1511
m0_bcount_t sad_container_size
Definition: ad.h:1515
struct m0_xcode_type * m0_be_emap_xc
uint64_t sad_magix
Definition: ad.h:1534
static struct _m0_ad_balloc_s _m0_ad_balloc
const struct m0_xcode_type M0_XT_U8
Definition: xcode.c:924
const struct m0_ad_balloc_ops * ab_ops
Definition: ad.h:1511
void m0_xc_u8_init(void)
Definition: xcode.c:892
void m0_xc_u32_init(void)
Definition: xcode.c:900
struct m0_ad_balloc * sad_ballroom
Definition: ad.h:1514
M0_INTERNAL void m0_xc_m0_ad_balloc_struct_init(void)
Definition: ad_xc.c:141
const char * xf_name
Definition: xcode.h:251
char sad_pad[7]
Definition: ad.h:1522
struct m0_stob * sad_bstore
Definition: ad.h:1532
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
M0_BASSERT(offsetof(struct _m0_ad_balloc_s, _child[0])==offsetof(struct m0_xcode_type, xct_child[0]))
#define offsetof(typ, memb)
Definition: misc.h:29
char sad_path[AD_PATHLEN]
Definition: ad.h:1520
struct m0_xcode_type * m0_format_footer_xc
Definition: format_xc.c:11