Whamcloud - gitweb
b=24267 wirecheck fix for OBD_FL_MMAP
[fs/lustre-release.git] / lustre / utils / wirecheck.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * GPL HEADER START
5  *
6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 only,
10  * as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License version 2 for more details (a copy is included
16  * in the LICENSE file that accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License
19  * version 2 along with this program; If not, see
20  * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
21  *
22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23  * CA 95054 USA or visit www.sun.com if you need additional information or
24  * have any questions.
25  *
26  * GPL HEADER END
27  */
28 /*
29  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
30  * Use is subject to license terms.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  */
36
37 #include <stdio.h>
38 #include <sys/types.h>
39 #include <sys/wait.h>
40 #include <liblustre.h>
41 #include <lustre_lib.h>
42 #include <lustre/lustre_idl.h>
43 #include <lustre_disk.h>
44
45 #define BLANK_LINE()                                            \
46 do {                                                            \
47         printf("\n");                                           \
48 } while(0)
49
50 #define COMMENT(c)                                              \
51 do {                                                            \
52         printf("        /* "c" */\n");                          \
53 } while(0)
54
55 #define STRINGIFY(a) #a
56
57
58 #define CHECK_CDEFINE(a)                                        \
59         printf("        CLASSERT("#a" == "STRINGIFY(a) ");\n")
60
61 #define CHECK_CVALUE(a)                                         \
62         printf("        CLASSERT("#a" == %lld);\n", (long long)a)
63
64 #define CHECK_DEFINE(a)                                         \
65 do {                                                            \
66         printf("        LASSERTF("#a" == "STRINGIFY(a)          \
67                ",\" found %%lld\\n\",\n                 "       \
68                "(long long)"#a");\n");   \
69 } while(0)
70
71 #define CHECK_VALUE(a)                                          \
72 do {                                                            \
73         printf("        LASSERTF("#a                            \
74                " == %lld, \" found %%lld\\n\",\n                 "\
75                "(long long)"#a");\n", (long long)a);            \
76 } while(0)
77
78 #define CHECK_VALUE_64(a)                                       \
79 do {                                                            \
80         printf("        LASSERTF("#a                            \
81                " == %lldULL, \" found %%lld\\n\",\n                 "\
82                "(long long)"#a");\n", (long long)a);            \
83 } while(0)
84
85 #define CHECK_MEMBER_OFFSET(s,m)                                \
86 do {                                                            \
87         CHECK_VALUE((int)offsetof(struct s, m));                \
88 } while(0)
89
90 #define CHECK_MEMBER_OFFSET_TYPEDEF(s,m)                        \
91 do {                                                            \
92         CHECK_VALUE((int)offsetof(s, m));                       \
93 } while(0)
94
95 #define CHECK_MEMBER_SIZEOF(s,m)                                \
96 do {                                                            \
97         CHECK_VALUE((int)sizeof(((struct s *)0)->m));           \
98 } while(0)
99
100 #define CHECK_MEMBER_SIZEOF_TYPEDEF(s,m)                        \
101 do {                                                            \
102         CHECK_VALUE((int)sizeof(((s *)0)->m));                  \
103 } while(0)
104
105 #define CHECK_MEMBER(s,m)                                       \
106 do {                                                            \
107         CHECK_MEMBER_OFFSET(s, m);                              \
108         CHECK_MEMBER_SIZEOF(s, m);                              \
109 } while(0)
110
111 #define CHECK_MEMBER_TYPEDEF(s,m)                               \
112 do {                                                            \
113         CHECK_MEMBER_OFFSET_TYPEDEF(s, m);                      \
114         CHECK_MEMBER_SIZEOF_TYPEDEF(s, m);                      \
115 } while(0)
116
117 #define CHECK_STRUCT(s)                                         \
118 do {                                                            \
119         COMMENT("Checks for struct "#s);                        \
120                 CHECK_VALUE((int)sizeof(struct s));             \
121 } while(0)
122
123 #define CHECK_STRUCT_TYPEDEF(s)                                 \
124 do {                                                            \
125         COMMENT("Checks for type "#s);                          \
126                 CHECK_VALUE((int)sizeof(s));                    \
127 } while(0)
128
129 static void
130 check_lustre_handle(void)
131 {
132         BLANK_LINE();
133         CHECK_STRUCT(lustre_handle);
134         CHECK_MEMBER(lustre_handle, cookie);
135 }
136
137 void
138 check_lustre_msg_v2(void)
139 {
140         BLANK_LINE();
141         CHECK_STRUCT(lustre_msg_v2);
142         CHECK_MEMBER(lustre_msg_v2, lm_bufcount);
143         CHECK_MEMBER(lustre_msg_v2, lm_secflvr);
144         CHECK_MEMBER(lustre_msg_v2, lm_magic);
145         CHECK_MEMBER(lustre_msg_v2, lm_repsize);
146         CHECK_MEMBER(lustre_msg_v2, lm_cksum);
147         CHECK_MEMBER(lustre_msg_v2, lm_flags);
148         CHECK_MEMBER(lustre_msg_v2, lm_padding_2);
149         CHECK_MEMBER(lustre_msg_v2, lm_padding_3);
150         CHECK_MEMBER(lustre_msg_v2, lm_buflens[0]);
151 }
152
153 void
154 check_ptlrpc_body(void)
155 {
156         BLANK_LINE();
157         CHECK_STRUCT(ptlrpc_body);
158         CHECK_MEMBER(ptlrpc_body, pb_handle);
159         CHECK_MEMBER(ptlrpc_body, pb_type);
160         CHECK_MEMBER(ptlrpc_body, pb_version);
161         CHECK_MEMBER(ptlrpc_body, pb_opc);
162         CHECK_MEMBER(ptlrpc_body, pb_status);
163         CHECK_MEMBER(ptlrpc_body, pb_last_xid);
164         CHECK_MEMBER(ptlrpc_body, pb_last_seen);
165         CHECK_MEMBER(ptlrpc_body, pb_last_committed);
166         CHECK_MEMBER(ptlrpc_body, pb_transno);
167         CHECK_MEMBER(ptlrpc_body, pb_flags);
168         CHECK_MEMBER(ptlrpc_body, pb_op_flags);
169         CHECK_MEMBER(ptlrpc_body, pb_conn_cnt);
170         CHECK_MEMBER(ptlrpc_body, pb_timeout);
171         CHECK_MEMBER(ptlrpc_body, pb_service_time);
172         CHECK_MEMBER(ptlrpc_body, pb_slv);
173         CHECK_MEMBER(ptlrpc_body, pb_limit);
174         CHECK_CVALUE(PTLRPC_NUM_VERSIONS);
175         CHECK_MEMBER(ptlrpc_body, pb_pre_versions[PTLRPC_NUM_VERSIONS]);
176 }
177
178 static void check_obd_connect_data(void)
179 {
180         BLANK_LINE();
181         CHECK_STRUCT(obd_connect_data);
182         CHECK_MEMBER(obd_connect_data, ocd_connect_flags);
183         CHECK_MEMBER(obd_connect_data, ocd_version);
184         CHECK_MEMBER(obd_connect_data, ocd_grant);
185         CHECK_MEMBER(obd_connect_data, ocd_index);
186         CHECK_MEMBER(obd_connect_data, ocd_brw_size);
187         CHECK_MEMBER(obd_connect_data, ocd_ibits_known);
188         CHECK_MEMBER(obd_connect_data, ocd_nllu);
189         CHECK_MEMBER(obd_connect_data, ocd_nllg);
190         CHECK_MEMBER(obd_connect_data, ocd_transno);
191         CHECK_MEMBER(obd_connect_data, ocd_group);
192         CHECK_MEMBER(obd_connect_data, ocd_cksum_types);
193         CHECK_MEMBER(obd_connect_data, padding1);
194         CHECK_MEMBER(obd_connect_data, padding2);
195
196         CHECK_CDEFINE(OBD_CONNECT_RDONLY);
197         CHECK_CDEFINE(OBD_CONNECT_INDEX);
198         CHECK_CDEFINE(OBD_CONNECT_GRANT);
199         CHECK_CDEFINE(OBD_CONNECT_SRVLOCK);
200         CHECK_CDEFINE(OBD_CONNECT_VERSION);
201         CHECK_CDEFINE(OBD_CONNECT_REQPORTAL);
202         CHECK_CDEFINE(OBD_CONNECT_ACL);
203         CHECK_CDEFINE(OBD_CONNECT_XATTR);
204         CHECK_CDEFINE(OBD_CONNECT_REAL);
205         CHECK_CDEFINE(OBD_CONNECT_CKSUM);
206         CHECK_CDEFINE(OBD_CONNECT_TRUNCLOCK);
207         CHECK_CDEFINE(OBD_CONNECT_IBITS);
208         CHECK_CDEFINE(OBD_CONNECT_JOIN);
209         CHECK_CDEFINE(OBD_CONNECT_ATTRFID);
210         CHECK_CDEFINE(OBD_CONNECT_NODEVOH);
211         CHECK_CDEFINE(OBD_CONNECT_RMT_CLIENT);
212         CHECK_CDEFINE(OBD_CONNECT_RMT_CLIENT_FORCE);
213         CHECK_CDEFINE(OBD_CONNECT_BRW_SIZE);
214         CHECK_CDEFINE(OBD_CONNECT_QUOTA64);
215         CHECK_CDEFINE(OBD_CONNECT_MDS_CAPA);
216         CHECK_CDEFINE(OBD_CONNECT_OSS_CAPA);
217         CHECK_CDEFINE(OBD_CONNECT_MDS_MDS);
218         CHECK_CDEFINE(OBD_CONNECT_SOM);
219         CHECK_CDEFINE(OBD_CONNECT_AT);
220         CHECK_CDEFINE(OBD_CONNECT_CANCELSET);
221         CHECK_CDEFINE(OBD_CONNECT_LRU_RESIZE);
222         CHECK_CDEFINE(OBD_CONNECT_VBR);
223         CHECK_CDEFINE(OBD_CONNECT_SKIP_ORPHAN);
224         CHECK_CDEFINE(OBD_CONNECT_FULL20);
225 }
226
227 static void
228 check_obdo(void)
229 {
230         BLANK_LINE();
231         CHECK_STRUCT(obdo);
232         CHECK_MEMBER(obdo, o_valid);
233         CHECK_MEMBER(obdo, o_id);
234         CHECK_MEMBER(obdo, o_seq);
235         CHECK_MEMBER(obdo, o_parent_seq);
236         CHECK_MEMBER(obdo, o_size);
237         CHECK_MEMBER(obdo, o_mtime);
238         CHECK_MEMBER(obdo, o_atime);
239         CHECK_MEMBER(obdo, o_ctime);
240         CHECK_MEMBER(obdo, o_blocks);
241         CHECK_MEMBER(obdo, o_grant);
242         CHECK_MEMBER(obdo, o_blksize);
243         CHECK_MEMBER(obdo, o_mode);
244         CHECK_MEMBER(obdo, o_uid);
245         CHECK_MEMBER(obdo, o_gid);
246         CHECK_MEMBER(obdo, o_flags);
247         CHECK_MEMBER(obdo, o_nlink);
248         CHECK_MEMBER(obdo, o_parent_oid);
249         CHECK_MEMBER(obdo, o_misc);
250         CHECK_MEMBER(obdo, o_ioepoch);
251         CHECK_MEMBER(obdo, o_stripe_idx);
252         CHECK_MEMBER(obdo, o_parent_ver);
253         CHECK_MEMBER(obdo, o_handle);
254         CHECK_MEMBER(obdo, o_lcookie);
255         CHECK_MEMBER(obdo, o_uid_h);
256         CHECK_MEMBER(obdo, o_gid_h);
257         CHECK_MEMBER(obdo, o_padding_3);
258         CHECK_MEMBER(obdo, o_padding_4);
259         CHECK_MEMBER(obdo, o_padding_5);
260         CHECK_MEMBER(obdo, o_padding_6);
261
262         CHECK_CDEFINE(OBD_MD_FLID);
263         CHECK_CDEFINE(OBD_MD_FLATIME);
264         CHECK_CDEFINE(OBD_MD_FLMTIME);
265         CHECK_CDEFINE(OBD_MD_FLCTIME);
266         CHECK_CDEFINE(OBD_MD_FLSIZE);
267         CHECK_CDEFINE(OBD_MD_FLBLOCKS);
268         CHECK_CDEFINE(OBD_MD_FLBLKSZ);
269         CHECK_CDEFINE(OBD_MD_FLMODE);
270         CHECK_CDEFINE(OBD_MD_FLTYPE);
271         CHECK_CDEFINE(OBD_MD_FLUID);
272         CHECK_CDEFINE(OBD_MD_FLGID);
273         CHECK_CDEFINE(OBD_MD_FLFLAGS);
274         CHECK_CDEFINE(OBD_MD_FLNLINK);
275         CHECK_CDEFINE(OBD_MD_FLGENER);
276         CHECK_CDEFINE(OBD_MD_FLRDEV);
277         CHECK_CDEFINE(OBD_MD_FLEASIZE);
278         CHECK_CDEFINE(OBD_MD_LINKNAME);
279         CHECK_CDEFINE(OBD_MD_FLHANDLE);
280         CHECK_CDEFINE(OBD_MD_FLCKSUM);
281         CHECK_CDEFINE(OBD_MD_FLQOS);
282         CHECK_CDEFINE(OBD_MD_FLCOOKIE);
283         CHECK_CDEFINE(OBD_MD_FLGROUP);
284         CHECK_CDEFINE(OBD_MD_FLFID);
285         CHECK_CDEFINE(OBD_MD_FLEPOCH);
286         CHECK_CDEFINE(OBD_MD_FLGRANT);
287         CHECK_CDEFINE(OBD_MD_FLDIREA);
288         CHECK_CDEFINE(OBD_MD_FLUSRQUOTA);
289         CHECK_CDEFINE(OBD_MD_FLGRPQUOTA);
290         CHECK_CDEFINE(OBD_MD_FLMODEASIZE);
291         CHECK_CDEFINE(OBD_MD_MDS);
292         CHECK_CDEFINE(OBD_MD_REINT);
293         CHECK_CDEFINE(OBD_MD_FLXATTR);
294         CHECK_CDEFINE(OBD_MD_FLXATTRLS);
295         CHECK_CDEFINE(OBD_MD_FLXATTRRM);
296         CHECK_CDEFINE(OBD_MD_FLACL);
297
298         CHECK_CVALUE(OBD_FL_INLINEDATA);
299         CHECK_CVALUE(OBD_FL_OBDMDEXISTS);
300         CHECK_CVALUE(OBD_FL_DELORPHAN);
301         CHECK_CVALUE(OBD_FL_NORPC);
302         CHECK_CVALUE(OBD_FL_IDONLY);
303         CHECK_CVALUE(OBD_FL_RECREATE_OBJS);
304         CHECK_CVALUE(OBD_FL_DEBUG_CHECK);
305         CHECK_CVALUE(OBD_FL_NO_USRQUOTA);
306         CHECK_CVALUE(OBD_FL_NO_GRPQUOTA);
307         CHECK_CVALUE(OBD_FL_SRVLOCK);
308         CHECK_CVALUE(OBD_FL_CKSUM_CRC32);
309         CHECK_CVALUE(OBD_FL_CKSUM_ADLER);
310         CHECK_CVALUE(OBD_FL_SHRINK_GRANT);
311         CHECK_CVALUE(OBD_FL_MMAP);
312         CHECK_CVALUE(OBD_CKSUM_CRC32);
313         CHECK_CVALUE(OBD_CKSUM_ADLER);
314 }
315
316 static void
317 check_lov_mds_md_v1(void)
318 {
319         BLANK_LINE();
320         CHECK_STRUCT(lov_mds_md_v1);
321         CHECK_MEMBER(lov_mds_md_v1, lmm_magic);
322         CHECK_MEMBER(lov_mds_md_v1, lmm_pattern);
323         CHECK_MEMBER(lov_mds_md_v1, lmm_object_id);
324         CHECK_MEMBER(lov_mds_md_v1, lmm_object_seq);
325         CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_size);
326         CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_count);
327         CHECK_MEMBER(lov_mds_md_v1, lmm_objects);
328
329         BLANK_LINE();
330         CHECK_STRUCT(lov_ost_data_v1);
331         CHECK_MEMBER(lov_ost_data_v1, l_object_id);
332         CHECK_MEMBER(lov_ost_data_v1, l_object_seq);
333         CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
334         CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
335
336         CHECK_CDEFINE(LOV_MAGIC_V1);
337
338         CHECK_VALUE(LOV_PATTERN_RAID0);
339         CHECK_VALUE(LOV_PATTERN_RAID1);
340 }
341
342 static void
343 check_lov_mds_md_v3(void)
344 {
345         BLANK_LINE();
346         CHECK_STRUCT(lov_mds_md_v3);
347         CHECK_MEMBER(lov_mds_md_v3, lmm_magic);
348         CHECK_MEMBER(lov_mds_md_v3, lmm_pattern);
349         CHECK_MEMBER(lov_mds_md_v3, lmm_object_id);
350         CHECK_MEMBER(lov_mds_md_v3, lmm_object_seq);
351         CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_size);
352         CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_count);
353         CHECK_MEMBER(lov_mds_md_v3, lmm_pool_name);
354         CHECK_MEMBER(lov_mds_md_v3, lmm_objects);
355
356         BLANK_LINE();
357         CHECK_STRUCT(lov_ost_data_v1);
358         CHECK_MEMBER(lov_ost_data_v1, l_object_id);
359         CHECK_MEMBER(lov_ost_data_v1, l_object_seq);
360         CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
361         CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
362
363         CHECK_CDEFINE(LOV_MAGIC_V3);
364
365         CHECK_VALUE(LOV_PATTERN_RAID0);
366         CHECK_VALUE(LOV_PATTERN_RAID1);
367 }
368
369 static void
370 check_obd_statfs(void)
371 {
372         BLANK_LINE();
373         CHECK_STRUCT(obd_statfs);
374         CHECK_MEMBER(obd_statfs, os_type);
375         CHECK_MEMBER(obd_statfs, os_blocks);
376         CHECK_MEMBER(obd_statfs, os_bfree);
377         CHECK_MEMBER(obd_statfs, os_bavail);
378         CHECK_MEMBER(obd_statfs, os_ffree);
379         CHECK_MEMBER(obd_statfs, os_fsid);
380         CHECK_MEMBER(obd_statfs, os_bsize);
381         CHECK_MEMBER(obd_statfs, os_namelen);
382         CHECK_MEMBER(obd_statfs, os_state);
383         CHECK_MEMBER(obd_statfs, os_spare1);
384         CHECK_MEMBER(obd_statfs, os_spare2);
385         CHECK_MEMBER(obd_statfs, os_spare3);
386         CHECK_MEMBER(obd_statfs, os_spare4);
387         CHECK_MEMBER(obd_statfs, os_spare5);
388         CHECK_MEMBER(obd_statfs, os_spare6);
389         CHECK_MEMBER(obd_statfs, os_spare7);
390         CHECK_MEMBER(obd_statfs, os_spare8);
391         CHECK_MEMBER(obd_statfs, os_spare9);
392 }
393
394 static void
395 check_obd_ioobj(void)
396 {
397         BLANK_LINE();
398         CHECK_STRUCT(obd_ioobj);
399         CHECK_MEMBER(obd_ioobj, ioo_id);
400         CHECK_MEMBER(obd_ioobj, ioo_seq);
401         CHECK_MEMBER(obd_ioobj, ioo_type);
402         CHECK_MEMBER(obd_ioobj, ioo_bufcnt);
403 }
404
405 static void
406 check_obd_quotactl(void)
407 {
408         BLANK_LINE();
409         CHECK_STRUCT(obd_quotactl);
410         CHECK_MEMBER(obd_quotactl, qc_cmd);
411         CHECK_MEMBER(obd_quotactl, qc_type);
412         CHECK_MEMBER(obd_quotactl, qc_id);
413         CHECK_MEMBER(obd_quotactl, qc_stat);
414         CHECK_MEMBER(obd_quotactl, qc_dqinfo);
415         CHECK_MEMBER(obd_quotactl, qc_dqblk);
416
417         BLANK_LINE();
418         CHECK_STRUCT(obd_dqinfo);
419         CHECK_MEMBER(obd_dqinfo, dqi_bgrace);
420         CHECK_MEMBER(obd_dqinfo, dqi_igrace);
421         CHECK_MEMBER(obd_dqinfo, dqi_flags);
422         CHECK_MEMBER(obd_dqinfo, dqi_valid);
423
424         BLANK_LINE();
425         CHECK_STRUCT(obd_dqblk);
426         CHECK_MEMBER(obd_dqblk, dqb_bhardlimit);
427         CHECK_MEMBER(obd_dqblk, dqb_bsoftlimit);
428         CHECK_MEMBER(obd_dqblk, dqb_curspace);
429         CHECK_MEMBER(obd_dqblk, dqb_ihardlimit);
430         CHECK_MEMBER(obd_dqblk, dqb_isoftlimit);
431         CHECK_MEMBER(obd_dqblk, dqb_curinodes);
432         CHECK_MEMBER(obd_dqblk, dqb_btime);
433         CHECK_MEMBER(obd_dqblk, dqb_itime);
434         CHECK_MEMBER(obd_dqblk, dqb_valid);
435         CHECK_MEMBER(obd_dqblk, padding);
436
437         CHECK_DEFINE(Q_QUOTACHECK);
438         CHECK_DEFINE(Q_INITQUOTA);
439         CHECK_DEFINE(Q_GETOINFO);
440         CHECK_DEFINE(Q_GETOQUOTA);
441 }
442
443 static void
444 check_niobuf_remote(void)
445 {
446         BLANK_LINE();
447         CHECK_STRUCT(niobuf_remote);
448         CHECK_MEMBER(niobuf_remote, offset);
449         CHECK_MEMBER(niobuf_remote, len);
450         CHECK_MEMBER(niobuf_remote, flags);
451
452         CHECK_VALUE(OBD_BRW_READ);
453         CHECK_VALUE(OBD_BRW_WRITE);
454         CHECK_VALUE(OBD_BRW_SYNC);
455         CHECK_VALUE(OBD_BRW_FROM_GRANT);
456         CHECK_VALUE(OBD_BRW_NOQUOTA);
457 }
458
459 static void
460 check_ost_body(void)
461 {
462         BLANK_LINE();
463         CHECK_STRUCT(ost_body);
464         CHECK_MEMBER(ost_body, oa);
465 }
466
467 static void
468 check_ll_fid(void)
469 {
470         BLANK_LINE();
471         CHECK_STRUCT(ll_fid);
472         CHECK_MEMBER(ll_fid, id);
473         CHECK_MEMBER(ll_fid, generation);
474         CHECK_MEMBER(ll_fid, f_type);
475 }
476
477 static void
478 check_mds_status_req(void)
479 {
480         BLANK_LINE();
481         CHECK_STRUCT(mds_status_req);
482         CHECK_MEMBER(mds_status_req, flags);
483         CHECK_MEMBER(mds_status_req, repbuf);
484 }
485
486 static void
487 check_mds_body(void)
488 {
489         BLANK_LINE();
490         CHECK_STRUCT(mds_body);
491         CHECK_MEMBER(mds_body, fid1);
492         CHECK_MEMBER(mds_body, fid2);
493         CHECK_MEMBER(mds_body, handle);
494         CHECK_MEMBER(mds_body, size);
495         CHECK_MEMBER(mds_body, blocks);
496         CHECK_MEMBER(mds_body, io_epoch);
497         CHECK_MEMBER(mds_body, ino);
498         CHECK_MEMBER(mds_body, valid);
499         CHECK_MEMBER(mds_body, fsuid);
500         CHECK_MEMBER(mds_body, fsgid);
501         CHECK_MEMBER(mds_body, capability);
502         CHECK_MEMBER(mds_body, mode);
503         CHECK_MEMBER(mds_body, uid);
504         CHECK_MEMBER(mds_body, gid);
505         CHECK_MEMBER(mds_body, mtime);
506         CHECK_MEMBER(mds_body, ctime);
507         CHECK_MEMBER(mds_body, atime);
508         CHECK_MEMBER(mds_body, flags);
509         CHECK_MEMBER(mds_body, rdev);
510         CHECK_MEMBER(mds_body, nlink);
511         CHECK_MEMBER(mds_body, generation);
512         CHECK_MEMBER(mds_body, suppgid);
513         CHECK_MEMBER(mds_body, eadatasize);
514         CHECK_MEMBER(mds_body, aclsize);
515         CHECK_MEMBER(mds_body, max_mdsize);
516         CHECK_MEMBER(mds_body, max_cookiesize);
517         CHECK_MEMBER(mds_body, padding_4);
518
519         CHECK_VALUE(FMODE_READ);
520         CHECK_VALUE(FMODE_WRITE);
521         CHECK_VALUE(MDS_FMODE_EXEC);
522
523         CHECK_CDEFINE(MDS_OPEN_CREAT);
524         CHECK_CDEFINE(MDS_OPEN_EXCL);
525         CHECK_CDEFINE(MDS_OPEN_TRUNC);
526         CHECK_CDEFINE(MDS_OPEN_APPEND);
527         CHECK_CDEFINE(MDS_OPEN_SYNC);
528         CHECK_CDEFINE(MDS_OPEN_DIRECTORY);
529         CHECK_CDEFINE(MDS_OPEN_DELAY_CREATE);
530         CHECK_CDEFINE(MDS_OPEN_OWNEROVERRIDE);
531         CHECK_CDEFINE(MDS_OPEN_JOIN_FILE);
532         CHECK_CDEFINE(MDS_OPEN_HAS_EA);
533         CHECK_CDEFINE(MDS_OPEN_HAS_OBJS);
534
535         /* these should be identical to their EXT3_*_FL counterparts, and
536          * are redefined only to avoid dragging in ext3_fs.h */
537         CHECK_CDEFINE(MDS_SYNC_FL);
538         CHECK_CDEFINE(MDS_IMMUTABLE_FL);
539         CHECK_CDEFINE(MDS_APPEND_FL);
540         CHECK_CDEFINE(MDS_NOATIME_FL);
541         CHECK_CDEFINE(MDS_DIRSYNC_FL);
542
543         CHECK_CDEFINE(MDS_INODELOCK_LOOKUP);
544         CHECK_CDEFINE(MDS_INODELOCK_UPDATE);
545         CHECK_CDEFINE(MDS_INODELOCK_OPEN);
546 }
547
548 static void
549 check_mdt_rec_setattr(void)
550 {
551         BLANK_LINE();
552         CHECK_STRUCT(mdt_rec_setattr);
553         CHECK_MEMBER(mdt_rec_setattr, sa_opcode);
554         CHECK_MEMBER(mdt_rec_setattr, sa_cap);
555         CHECK_MEMBER(mdt_rec_setattr, sa_fsuid);
556         CHECK_MEMBER(mdt_rec_setattr, sa_fsuid_h);
557         CHECK_MEMBER(mdt_rec_setattr, sa_fsgid);
558         CHECK_MEMBER(mdt_rec_setattr, sa_fsgid_h);
559         CHECK_MEMBER(mdt_rec_setattr, sa_suppgid);
560         CHECK_MEMBER(mdt_rec_setattr, sa_suppgid_h);
561         CHECK_MEMBER(mdt_rec_setattr, sa_padding_1);
562         CHECK_MEMBER(mdt_rec_setattr, sa_padding_1_h);
563         CHECK_MEMBER(mdt_rec_setattr, sa_fid);
564         CHECK_MEMBER(mdt_rec_setattr, sa_valid);
565         CHECK_MEMBER(mdt_rec_setattr, sa_uid);
566         CHECK_MEMBER(mdt_rec_setattr, sa_gid);
567         CHECK_MEMBER(mdt_rec_setattr, sa_size);
568         CHECK_MEMBER(mdt_rec_setattr, sa_blocks);
569         CHECK_MEMBER(mdt_rec_setattr, sa_mtime);
570         CHECK_MEMBER(mdt_rec_setattr, sa_atime);
571         CHECK_MEMBER(mdt_rec_setattr, sa_ctime);
572         CHECK_MEMBER(mdt_rec_setattr, sa_attr_flags);
573         CHECK_MEMBER(mdt_rec_setattr, sa_mode);
574         CHECK_MEMBER(mdt_rec_setattr, sa_padding_2);
575         CHECK_MEMBER(mdt_rec_setattr, sa_padding_3);
576         CHECK_MEMBER(mdt_rec_setattr, sa_padding_4);
577         CHECK_MEMBER(mdt_rec_setattr, sa_padding_5);
578 }
579
580 static void
581 check_mdt_rec_create(void)
582 {
583         BLANK_LINE();
584         CHECK_STRUCT(mdt_rec_create);
585         CHECK_MEMBER(mdt_rec_create, cr_opcode);
586         CHECK_MEMBER(mdt_rec_create, cr_cap);
587         CHECK_MEMBER(mdt_rec_create, cr_fsuid);
588         CHECK_MEMBER(mdt_rec_create, cr_fsuid_h);
589         CHECK_MEMBER(mdt_rec_create, cr_fsgid);
590         CHECK_MEMBER(mdt_rec_create, cr_fsgid_h);
591         CHECK_MEMBER(mdt_rec_create, cr_suppgid1);
592         CHECK_MEMBER(mdt_rec_create, cr_suppgid1_h);
593         CHECK_MEMBER(mdt_rec_create, cr_suppgid2);
594         CHECK_MEMBER(mdt_rec_create, cr_suppgid2_h);
595         CHECK_MEMBER(mdt_rec_create, cr_fid1);
596         CHECK_MEMBER(mdt_rec_create, cr_fid2);
597         CHECK_MEMBER(mdt_rec_create, cr_old_handle);
598         CHECK_MEMBER(mdt_rec_create, cr_time);
599         CHECK_MEMBER(mdt_rec_create, cr_rdev);
600         CHECK_MEMBER(mdt_rec_create, cr_ioepoch);
601         CHECK_MEMBER(mdt_rec_create, cr_padding_1);
602         CHECK_MEMBER(mdt_rec_create, cr_mode);
603         CHECK_MEMBER(mdt_rec_create, cr_bias);
604         CHECK_MEMBER(mdt_rec_create, cr_flags_l);
605         CHECK_MEMBER(mdt_rec_create, cr_flags_h);
606         CHECK_MEMBER(mdt_rec_create, cr_padding_3);
607         CHECK_MEMBER(mdt_rec_create, cr_padding_4);
608 }
609
610 static void
611 check_mdt_rec_link(void)
612 {
613         BLANK_LINE();
614         CHECK_STRUCT(mdt_rec_link);
615         CHECK_MEMBER(mdt_rec_link, lk_opcode);
616         CHECK_MEMBER(mdt_rec_link, lk_cap);
617         CHECK_MEMBER(mdt_rec_link, lk_fsuid);
618         CHECK_MEMBER(mdt_rec_link, lk_fsuid_h);
619         CHECK_MEMBER(mdt_rec_link, lk_fsgid);
620         CHECK_MEMBER(mdt_rec_link, lk_fsgid_h);
621         CHECK_MEMBER(mdt_rec_link, lk_suppgid1);
622         CHECK_MEMBER(mdt_rec_link, lk_suppgid1_h);
623         CHECK_MEMBER(mdt_rec_link, lk_suppgid2);
624         CHECK_MEMBER(mdt_rec_link, lk_suppgid2_h);
625         CHECK_MEMBER(mdt_rec_link, lk_fid1);
626         CHECK_MEMBER(mdt_rec_link, lk_fid2);
627         CHECK_MEMBER(mdt_rec_link, lk_time);
628         CHECK_MEMBER(mdt_rec_link, lk_padding_1);
629         CHECK_MEMBER(mdt_rec_link, lk_padding_2);
630         CHECK_MEMBER(mdt_rec_link, lk_padding_3);
631         CHECK_MEMBER(mdt_rec_link, lk_padding_4);
632         CHECK_MEMBER(mdt_rec_link, lk_bias);
633         CHECK_MEMBER(mdt_rec_link, lk_padding_5);
634         CHECK_MEMBER(mdt_rec_link, lk_padding_6);
635         CHECK_MEMBER(mdt_rec_link, lk_padding_7);
636         CHECK_MEMBER(mdt_rec_link, lk_padding_8);
637         CHECK_MEMBER(mdt_rec_link, lk_padding_9);
638 }
639
640 static void
641 check_mdt_rec_unlink(void)
642 {
643         BLANK_LINE();
644         CHECK_STRUCT(mdt_rec_unlink);
645         CHECK_MEMBER(mdt_rec_unlink, ul_opcode);
646         CHECK_MEMBER(mdt_rec_unlink, ul_cap);
647         CHECK_MEMBER(mdt_rec_unlink, ul_fsuid);
648         CHECK_MEMBER(mdt_rec_unlink, ul_fsuid_h);
649         CHECK_MEMBER(mdt_rec_unlink, ul_fsgid);
650         CHECK_MEMBER(mdt_rec_unlink, ul_fsgid_h);
651         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid1);
652         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid1_h);
653         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid2);
654         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid2_h);
655         CHECK_MEMBER(mdt_rec_unlink, ul_fid1);
656         CHECK_MEMBER(mdt_rec_unlink, ul_fid2);
657         CHECK_MEMBER(mdt_rec_unlink, ul_time);
658         CHECK_MEMBER(mdt_rec_unlink, ul_padding_2);
659         CHECK_MEMBER(mdt_rec_unlink, ul_padding_3);
660         CHECK_MEMBER(mdt_rec_unlink, ul_padding_4);
661         CHECK_MEMBER(mdt_rec_unlink, ul_padding_5);
662         CHECK_MEMBER(mdt_rec_unlink, ul_bias);
663         CHECK_MEMBER(mdt_rec_unlink, ul_mode);
664         CHECK_MEMBER(mdt_rec_unlink, ul_padding_6);
665         CHECK_MEMBER(mdt_rec_unlink, ul_padding_7);
666         CHECK_MEMBER(mdt_rec_unlink, ul_padding_8);
667         CHECK_MEMBER(mdt_rec_unlink, ul_padding_9);
668 }
669
670 static void
671 check_mdt_rec_rename(void)
672 {
673         BLANK_LINE();
674         CHECK_STRUCT(mdt_rec_rename);
675         CHECK_MEMBER(mdt_rec_rename, rn_opcode);
676         CHECK_MEMBER(mdt_rec_rename, rn_cap);
677         CHECK_MEMBER(mdt_rec_rename, rn_fsuid);
678         CHECK_MEMBER(mdt_rec_rename, rn_fsuid_h);
679         CHECK_MEMBER(mdt_rec_rename, rn_fsgid);
680         CHECK_MEMBER(mdt_rec_rename, rn_fsgid_h);
681         CHECK_MEMBER(mdt_rec_rename, rn_suppgid1);
682         CHECK_MEMBER(mdt_rec_rename, rn_suppgid1_h);
683         CHECK_MEMBER(mdt_rec_rename, rn_suppgid2);
684         CHECK_MEMBER(mdt_rec_rename, rn_suppgid2_h);
685         CHECK_MEMBER(mdt_rec_rename, rn_fid1);
686         CHECK_MEMBER(mdt_rec_rename, rn_fid2);
687         CHECK_MEMBER(mdt_rec_rename, rn_time);
688         CHECK_MEMBER(mdt_rec_rename, rn_padding_1);
689         CHECK_MEMBER(mdt_rec_rename, rn_padding_2);
690         CHECK_MEMBER(mdt_rec_rename, rn_padding_3);
691         CHECK_MEMBER(mdt_rec_rename, rn_padding_4); 
692         CHECK_MEMBER(mdt_rec_rename, rn_bias);
693         CHECK_MEMBER(mdt_rec_rename, rn_mode);
694         CHECK_MEMBER(mdt_rec_rename, rn_padding_5);
695         CHECK_MEMBER(mdt_rec_rename, rn_padding_6);
696         CHECK_MEMBER(mdt_rec_rename, rn_padding_7);
697         CHECK_MEMBER(mdt_rec_rename, rn_padding_8);
698 }
699
700 static void
701 check_lov_desc(void)
702 {
703         BLANK_LINE();
704         CHECK_STRUCT(lov_desc);
705         CHECK_MEMBER(lov_desc, ld_tgt_count);
706         CHECK_MEMBER(lov_desc, ld_active_tgt_count);
707         CHECK_MEMBER(lov_desc, ld_default_stripe_count);
708         CHECK_MEMBER(lov_desc, ld_pattern);
709         CHECK_MEMBER(lov_desc, ld_default_stripe_size);
710         CHECK_MEMBER(lov_desc, ld_default_stripe_offset);
711         CHECK_MEMBER(lov_desc, ld_qos_maxage);
712         CHECK_MEMBER(lov_desc, ld_padding_1);
713         CHECK_MEMBER(lov_desc, ld_padding_2);
714         CHECK_MEMBER(lov_desc, ld_uuid);
715 }
716
717 static void
718 check_ldlm_res_id(void)
719 {
720         BLANK_LINE();
721         CHECK_STRUCT(ldlm_res_id);
722         CHECK_MEMBER(ldlm_res_id, name[RES_NAME_SIZE]);
723 }
724
725 static void
726 check_ldlm_extent(void)
727 {
728         BLANK_LINE();
729         CHECK_STRUCT(ldlm_extent);
730         CHECK_MEMBER(ldlm_extent, start);
731         CHECK_MEMBER(ldlm_extent, end);
732         CHECK_MEMBER(ldlm_extent, gid);
733 }
734
735 static void
736 check_ldlm_inodebits(void)
737 {
738         BLANK_LINE();
739         CHECK_STRUCT(ldlm_inodebits);
740         CHECK_MEMBER(ldlm_inodebits, bits);
741 }
742
743 static void
744 check_ldlm_flock(void)
745 {
746         BLANK_LINE();
747         CHECK_STRUCT(ldlm_flock);
748         CHECK_MEMBER(ldlm_flock, start);
749         CHECK_MEMBER(ldlm_flock, end);
750         CHECK_MEMBER(ldlm_flock, blocking_pid);
751         CHECK_MEMBER(ldlm_flock, pid);
752 }
753
754 static void
755 check_ldlm_intent(void)
756 {
757         BLANK_LINE();
758         CHECK_STRUCT(ldlm_intent);
759         CHECK_MEMBER(ldlm_intent, opc);
760 }
761
762 static void
763 check_ldlm_resource_desc(void)
764 {
765         BLANK_LINE();
766         CHECK_STRUCT(ldlm_resource_desc);
767         CHECK_MEMBER(ldlm_resource_desc, lr_type);
768         CHECK_MEMBER(ldlm_resource_desc, lr_padding);
769         CHECK_MEMBER(ldlm_resource_desc, lr_name);
770 }
771
772 static void
773 check_ldlm_lock_desc(void)
774 {
775         BLANK_LINE();
776         CHECK_STRUCT(ldlm_lock_desc);
777         CHECK_MEMBER(ldlm_lock_desc, l_resource);
778         CHECK_MEMBER(ldlm_lock_desc, l_req_mode);
779         CHECK_MEMBER(ldlm_lock_desc, l_granted_mode);
780         CHECK_MEMBER(ldlm_lock_desc, l_policy_data);
781 }
782
783 static void
784 check_ldlm_request(void)
785 {
786         BLANK_LINE();
787         CHECK_STRUCT(ldlm_request);
788         CHECK_MEMBER(ldlm_request, lock_flags);
789         CHECK_MEMBER(ldlm_request, lock_count);
790         CHECK_MEMBER(ldlm_request, lock_desc);
791         CHECK_MEMBER(ldlm_request, lock_handle);
792 }
793
794 static void
795 check_ldlm_reply(void)
796 {
797         BLANK_LINE();
798         CHECK_STRUCT(ldlm_reply);
799         CHECK_MEMBER(ldlm_reply, lock_flags);
800         CHECK_MEMBER(ldlm_reply, lock_padding);
801         CHECK_MEMBER(ldlm_reply, lock_desc);
802         CHECK_MEMBER(ldlm_reply, lock_handle);
803         CHECK_MEMBER(ldlm_reply, lock_policy_res1);
804         CHECK_MEMBER(ldlm_reply, lock_policy_res2);
805 }
806
807 static void
808 check_ldlm_lvb(void)
809 {
810         BLANK_LINE();
811         CHECK_STRUCT(ost_lvb);
812         CHECK_MEMBER(ost_lvb, lvb_size);
813         CHECK_MEMBER(ost_lvb, lvb_mtime);
814         CHECK_MEMBER(ost_lvb, lvb_atime);
815         CHECK_MEMBER(ost_lvb, lvb_ctime);
816         CHECK_MEMBER(ost_lvb, lvb_blocks);
817 }
818
819 static void
820 check_cfg_marker(void)
821 {
822         BLANK_LINE();
823         CHECK_STRUCT(cfg_marker);
824         CHECK_MEMBER(cfg_marker, cm_step);
825         CHECK_MEMBER(cfg_marker, cm_flags);
826         CHECK_MEMBER(cfg_marker, cm_vers);
827         CHECK_MEMBER(cfg_marker, cm_createtime);
828         CHECK_MEMBER(cfg_marker, cm_canceltime);
829         CHECK_MEMBER(cfg_marker, cm_tgtname);
830         CHECK_MEMBER(cfg_marker, cm_comment);
831 }
832
833 static void
834 check_llog_logid(void)
835 {
836         BLANK_LINE();
837         CHECK_STRUCT(llog_logid);
838         CHECK_MEMBER(llog_logid, lgl_oid);
839         CHECK_MEMBER(llog_logid, lgl_oseq);
840         CHECK_MEMBER(llog_logid, lgl_ogen);
841
842         CHECK_CVALUE(OST_SZ_REC);
843         CHECK_CVALUE(OST_RAID1_REC);
844         CHECK_CVALUE(MDS_UNLINK_REC);
845         CHECK_CVALUE(MDS_SETATTR_REC);
846         CHECK_CVALUE(OBD_CFG_REC);
847         CHECK_CVALUE(PTL_CFG_REC);
848         CHECK_CVALUE(LLOG_GEN_REC);
849         CHECK_CVALUE(LLOG_JOIN_REC);
850         CHECK_CVALUE(LLOG_HDR_MAGIC);
851         CHECK_CVALUE(LLOG_LOGID_MAGIC);
852 }
853
854 static void
855 check_llog_catid(void)
856 {
857         BLANK_LINE();
858         CHECK_STRUCT(llog_catid);
859         CHECK_MEMBER(llog_catid, lci_logid);
860         CHECK_MEMBER(llog_catid, lci_padding1);
861         CHECK_MEMBER(llog_catid, lci_padding2);
862         CHECK_MEMBER(llog_catid, lci_padding3);
863 }
864
865 static void
866 check_llog_rec_hdr(void)
867 {
868         BLANK_LINE();
869         CHECK_STRUCT(llog_rec_hdr);
870         CHECK_MEMBER(llog_rec_hdr, lrh_len);
871         CHECK_MEMBER(llog_rec_hdr, lrh_index);
872         CHECK_MEMBER(llog_rec_hdr, lrh_type);
873         CHECK_MEMBER(llog_rec_hdr, padding);
874 }
875
876 static void
877 check_llog_rec_tail(void)
878 {
879         BLANK_LINE();
880         CHECK_STRUCT(llog_rec_tail);
881         CHECK_MEMBER(llog_rec_tail, lrt_len);
882         CHECK_MEMBER(llog_rec_tail, lrt_index);
883 }
884
885 static void
886 check_llog_logid_rec(void)
887 {
888         BLANK_LINE();
889         CHECK_STRUCT(llog_logid_rec);
890         CHECK_MEMBER(llog_logid_rec, lid_hdr);
891         CHECK_MEMBER(llog_logid_rec, lid_id);
892         CHECK_MEMBER(llog_logid_rec, padding1);
893         CHECK_MEMBER(llog_logid_rec, padding2);
894         CHECK_MEMBER(llog_logid_rec, padding3);
895         CHECK_MEMBER(llog_logid_rec, padding4);
896         CHECK_MEMBER(llog_logid_rec, padding5);
897         CHECK_MEMBER(llog_logid_rec, lid_tail);
898 }
899
900 static void
901 check_llog_create_rec(void)
902 {
903         BLANK_LINE();
904         CHECK_STRUCT(llog_create_rec);
905         CHECK_MEMBER(llog_create_rec, lcr_hdr);
906         CHECK_MEMBER(llog_create_rec, lcr_fid);
907         CHECK_MEMBER(llog_create_rec, lcr_oid);
908         CHECK_MEMBER(llog_create_rec, lcr_oseq);
909         CHECK_MEMBER(llog_create_rec, padding);
910         CHECK_MEMBER(llog_create_rec, lcr_tail);
911 }
912
913 static void
914 check_llog_orphan_rec(void)
915 {
916         BLANK_LINE();
917         CHECK_STRUCT(llog_orphan_rec);
918         CHECK_MEMBER(llog_orphan_rec, lor_hdr);
919         CHECK_MEMBER(llog_orphan_rec, lor_oid);
920         CHECK_MEMBER(llog_orphan_rec, lor_ogen);
921         CHECK_MEMBER(llog_orphan_rec, padding);
922         CHECK_MEMBER(llog_orphan_rec, lor_tail);
923 }
924
925 static void
926 check_llog_unlink_rec(void)
927 {
928         BLANK_LINE();
929         CHECK_STRUCT(llog_unlink_rec);
930         CHECK_MEMBER(llog_unlink_rec, lur_hdr);
931         CHECK_MEMBER(llog_unlink_rec, lur_oid);
932         CHECK_MEMBER(llog_unlink_rec, lur_oseq);
933         CHECK_MEMBER(llog_unlink_rec, lur_count);
934         CHECK_MEMBER(llog_unlink_rec, lur_tail);
935 }
936
937 static void
938 check_llog_setattr_rec(void)
939 {
940         BLANK_LINE();
941         CHECK_STRUCT(llog_setattr_rec);
942         CHECK_MEMBER(llog_setattr_rec, lsr_hdr);
943         CHECK_MEMBER(llog_setattr_rec, lsr_oid);
944         CHECK_MEMBER(llog_setattr_rec, lsr_oseq);
945         CHECK_MEMBER(llog_setattr_rec, lsr_uid);
946         CHECK_MEMBER(llog_setattr_rec, lsr_gid);
947         CHECK_MEMBER(llog_setattr_rec, padding);
948         CHECK_MEMBER(llog_setattr_rec, lsr_tail);
949 }
950
951 static void
952 check_llog_setattr64_rec(void)
953 {
954         BLANK_LINE();
955         CHECK_STRUCT(llog_setattr64_rec);
956         CHECK_MEMBER(llog_setattr64_rec, lsr_hdr);
957         CHECK_MEMBER(llog_setattr64_rec, lsr_oid);
958         CHECK_MEMBER(llog_setattr64_rec, lsr_oseq);
959         CHECK_MEMBER(llog_setattr64_rec, padding);
960         CHECK_MEMBER(llog_setattr64_rec, lsr_uid);
961         CHECK_MEMBER(llog_setattr64_rec, lsr_uid_h);
962         CHECK_MEMBER(llog_setattr64_rec, lsr_gid);
963         CHECK_MEMBER(llog_setattr64_rec, lsr_gid_h);
964         CHECK_MEMBER(llog_setattr64_rec, lsr_tail);
965 }
966
967 static void
968 check_llog_size_change_rec(void)
969 {
970         BLANK_LINE();
971         CHECK_STRUCT(llog_size_change_rec);
972         CHECK_MEMBER(llog_size_change_rec, lsc_hdr);
973         CHECK_MEMBER(llog_size_change_rec, lsc_fid);
974         CHECK_MEMBER(llog_size_change_rec, lsc_ioepoch);
975         CHECK_MEMBER(llog_size_change_rec, padding);
976         CHECK_MEMBER(llog_size_change_rec, lsc_tail);
977 }
978
979 static void
980 check_changelog_rec(void)
981 {
982         BLANK_LINE();
983         CHECK_STRUCT(changelog_rec);
984         CHECK_MEMBER(changelog_rec, cr_namelen);
985         CHECK_MEMBER(changelog_rec, cr_flags);
986         CHECK_MEMBER(changelog_rec, cr_type);
987         CHECK_MEMBER(changelog_rec, cr_index);
988         CHECK_MEMBER(changelog_rec, cr_prev);
989         CHECK_MEMBER(changelog_rec, cr_time);
990         CHECK_MEMBER(changelog_rec, cr_tfid);
991         CHECK_MEMBER(changelog_rec, cr_pfid);
992 }
993
994 static void
995 check_llog_changelog_rec(void)
996 {
997         BLANK_LINE();
998         CHECK_STRUCT(llog_changelog_rec);
999         CHECK_MEMBER(llog_changelog_rec, cr_hdr);
1000         CHECK_MEMBER(llog_changelog_rec, cr);
1001         CHECK_MEMBER(llog_changelog_rec, cr_tail);
1002 }
1003
1004 static void
1005 check_llog_gen(void)
1006 {
1007         BLANK_LINE();
1008         CHECK_STRUCT(llog_gen);
1009         CHECK_MEMBER(llog_gen, mnt_cnt);
1010         CHECK_MEMBER(llog_gen, conn_cnt);
1011 }
1012
1013 static void
1014 check_llog_gen_rec(void)
1015 {
1016         BLANK_LINE();
1017         CHECK_STRUCT(llog_gen_rec);
1018         CHECK_MEMBER(llog_gen_rec, lgr_hdr);
1019         CHECK_MEMBER(llog_gen_rec, lgr_gen);
1020         CHECK_MEMBER(llog_gen_rec, lgr_tail);
1021 }
1022
1023 static void
1024 check_llog_log_hdr(void)
1025 {
1026         BLANK_LINE();
1027         CHECK_STRUCT(llog_log_hdr);
1028         CHECK_MEMBER(llog_log_hdr, llh_hdr);
1029         CHECK_MEMBER(llog_log_hdr, llh_timestamp);
1030         CHECK_MEMBER(llog_log_hdr, llh_count);
1031         CHECK_MEMBER(llog_log_hdr, llh_bitmap_offset);
1032         CHECK_MEMBER(llog_log_hdr, llh_size);
1033         CHECK_MEMBER(llog_log_hdr, llh_flags);
1034         CHECK_MEMBER(llog_log_hdr, llh_cat_idx);
1035         CHECK_MEMBER(llog_log_hdr, llh_tgtuuid);
1036         CHECK_MEMBER(llog_log_hdr, llh_reserved);
1037         CHECK_MEMBER(llog_log_hdr, llh_bitmap);
1038         CHECK_MEMBER(llog_log_hdr, llh_tail);
1039 }
1040
1041 static void
1042 check_llog_cookie(void)
1043 {
1044         BLANK_LINE();
1045         CHECK_STRUCT(llog_cookie);
1046         CHECK_MEMBER(llog_cookie, lgc_lgl);
1047         CHECK_MEMBER(llog_cookie, lgc_subsys);
1048         CHECK_MEMBER(llog_cookie, lgc_index);
1049         CHECK_MEMBER(llog_cookie, lgc_padding);
1050 }
1051
1052 static void
1053 check_llogd_body(void)
1054 {
1055         BLANK_LINE();
1056         CHECK_STRUCT(llogd_body);
1057         CHECK_MEMBER(llogd_body, lgd_logid);
1058         CHECK_MEMBER(llogd_body, lgd_ctxt_idx);
1059         CHECK_MEMBER(llogd_body, lgd_llh_flags);
1060         CHECK_MEMBER(llogd_body, lgd_index);
1061         CHECK_MEMBER(llogd_body, lgd_saved_index);
1062         CHECK_MEMBER(llogd_body, lgd_len);
1063         CHECK_MEMBER(llogd_body, lgd_cur_offset);
1064
1065         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_CREATE);
1066         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
1067         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_READ_HEADER);
1068         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_WRITE_REC);
1069         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_CLOSE);
1070         CHECK_CVALUE(LLOG_ORIGIN_CONNECT);
1071         CHECK_CVALUE(LLOG_CATINFO);
1072         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_PREV_BLOCK);
1073         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_DESTROY);
1074 }
1075
1076 static void
1077 check_llogd_conn_body(void)
1078 {
1079         BLANK_LINE();
1080         CHECK_STRUCT(llogd_conn_body);
1081         CHECK_MEMBER(llogd_conn_body, lgdc_gen);
1082         CHECK_MEMBER(llogd_conn_body, lgdc_logid);
1083         CHECK_MEMBER(llogd_conn_body, lgdc_ctxt_idx);
1084 }
1085
1086 static void
1087 check_qunit_data(void)
1088 {
1089         BLANK_LINE();
1090         CHECK_STRUCT(qunit_data);
1091         CHECK_MEMBER(qunit_data, qd_id);
1092         CHECK_MEMBER(qunit_data, qd_flags);
1093         CHECK_MEMBER(qunit_data, qd_count);
1094         CHECK_MEMBER(qunit_data, qd_qunit);
1095         CHECK_MEMBER(qunit_data, padding);
1096 }
1097
1098 static void
1099 check_mgs_target_info(void)
1100 {
1101         BLANK_LINE();
1102         CHECK_STRUCT(mgs_target_info);
1103         CHECK_MEMBER(mgs_target_info, mti_lustre_ver);
1104         CHECK_MEMBER(mgs_target_info, mti_stripe_index);
1105         CHECK_MEMBER(mgs_target_info, mti_config_ver);
1106         CHECK_MEMBER(mgs_target_info, mti_flags);
1107         CHECK_MEMBER(mgs_target_info, mti_nid_count);
1108         CHECK_MEMBER(mgs_target_info, mti_fsname);
1109         CHECK_MEMBER(mgs_target_info, mti_svname);
1110         CHECK_MEMBER(mgs_target_info, mti_uuid);
1111         CHECK_MEMBER(mgs_target_info, mti_nids);
1112         CHECK_MEMBER(mgs_target_info, mti_params);
1113 }
1114
1115 static void
1116 check_lustre_disk_data(void)
1117 {
1118         BLANK_LINE();
1119         CHECK_STRUCT(lustre_disk_data);
1120         CHECK_MEMBER(lustre_disk_data, ldd_magic);
1121         CHECK_MEMBER(lustre_disk_data, ldd_feature_compat);
1122         CHECK_MEMBER(lustre_disk_data, ldd_feature_rocompat);
1123         CHECK_MEMBER(lustre_disk_data, ldd_feature_incompat);
1124         CHECK_MEMBER(lustre_disk_data, ldd_config_ver);
1125         CHECK_MEMBER(lustre_disk_data, ldd_flags);
1126         CHECK_MEMBER(lustre_disk_data, ldd_svindex);
1127         CHECK_MEMBER(lustre_disk_data, ldd_mount_type);
1128         CHECK_MEMBER(lustre_disk_data, ldd_fsname);
1129         CHECK_MEMBER(lustre_disk_data, ldd_svname);
1130         CHECK_MEMBER(lustre_disk_data, ldd_uuid);
1131         CHECK_MEMBER(lustre_disk_data, ldd_userdata);
1132         CHECK_MEMBER(lustre_disk_data, ldd_mount_opts);
1133         CHECK_MEMBER(lustre_disk_data, ldd_params);
1134 }
1135
1136 static void
1137 check_posix_acl_xattr_entry(void)
1138 {
1139         BLANK_LINE();
1140         CHECK_STRUCT_TYPEDEF(posix_acl_xattr_entry);
1141         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_tag);
1142         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_perm);
1143         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_id);
1144 }
1145
1146 static void
1147 check_posix_acl_xattr_header(void)
1148 {
1149         BLANK_LINE();
1150         CHECK_STRUCT_TYPEDEF(posix_acl_xattr_header);
1151         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_version);
1152         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_entries);
1153 }
1154
1155 static void
1156 check_quota_adjust_qunit(void)
1157 {
1158         BLANK_LINE();
1159         CHECK_STRUCT(quota_adjust_qunit);
1160         CHECK_MEMBER(quota_adjust_qunit, qaq_flags);
1161         CHECK_MEMBER(quota_adjust_qunit, qaq_id);
1162         CHECK_MEMBER(quota_adjust_qunit, qaq_bunit_sz);
1163         CHECK_MEMBER(quota_adjust_qunit, qaq_iunit_sz);
1164         CHECK_MEMBER(quota_adjust_qunit, padding1);
1165 }
1166
1167 static void
1168 check_ll_user_fiemap(void)
1169 {
1170         BLANK_LINE();
1171         CHECK_STRUCT(ll_user_fiemap);
1172         CHECK_MEMBER(ll_user_fiemap, fm_start);
1173         CHECK_MEMBER(ll_user_fiemap, fm_length);
1174         CHECK_MEMBER(ll_user_fiemap, fm_flags);
1175         CHECK_MEMBER(ll_user_fiemap, fm_mapped_extents);
1176         CHECK_MEMBER(ll_user_fiemap, fm_extent_count);
1177         CHECK_MEMBER(ll_user_fiemap, fm_reserved);
1178         CHECK_MEMBER(ll_user_fiemap, fm_extents);
1179
1180         CHECK_CDEFINE(FIEMAP_FLAG_SYNC);
1181         CHECK_CDEFINE(FIEMAP_FLAG_XATTR);
1182         CHECK_CDEFINE(FIEMAP_FLAG_DEVICE_ORDER);
1183 }
1184
1185 static void
1186 check_ll_fiemap_extent(void)
1187 {
1188         BLANK_LINE();
1189         CHECK_STRUCT(ll_fiemap_extent);
1190         CHECK_MEMBER(ll_fiemap_extent, fe_logical);
1191         CHECK_MEMBER(ll_fiemap_extent, fe_physical);
1192         CHECK_MEMBER(ll_fiemap_extent, fe_length);
1193         CHECK_MEMBER(ll_fiemap_extent, fe_flags);
1194         CHECK_MEMBER(ll_fiemap_extent, fe_device);
1195
1196         CHECK_CDEFINE(FIEMAP_EXTENT_LAST);
1197         CHECK_CDEFINE(FIEMAP_EXTENT_UNKNOWN);
1198         CHECK_CDEFINE(FIEMAP_EXTENT_DELALLOC);
1199         CHECK_CDEFINE(FIEMAP_EXTENT_ENCODED);
1200         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_ENCRYPTED);
1201         CHECK_CDEFINE(FIEMAP_EXTENT_NOT_ALIGNED);
1202         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_INLINE);
1203         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_TAIL);
1204         CHECK_CDEFINE(FIEMAP_EXTENT_UNWRITTEN);
1205         CHECK_CDEFINE(FIEMAP_EXTENT_MERGED);
1206         CHECK_CDEFINE(FIEMAP_EXTENT_NO_DIRECT);
1207         CHECK_CDEFINE(FIEMAP_EXTENT_NET);
1208 }
1209
1210 static void
1211 check_link_ea_header(void)
1212 {
1213         BLANK_LINE();
1214         CHECK_STRUCT(link_ea_header);
1215         CHECK_MEMBER(link_ea_header, leh_magic);
1216         CHECK_MEMBER(link_ea_header, leh_reccount);
1217         CHECK_MEMBER(link_ea_header, leh_len);
1218         CHECK_MEMBER(link_ea_header, padding1);
1219         CHECK_MEMBER(link_ea_header, padding2);
1220 }
1221
1222 static void
1223 check_link_ea_entry(void)
1224 {
1225         BLANK_LINE();
1226         CHECK_STRUCT(link_ea_entry);
1227         CHECK_MEMBER(link_ea_entry, lee_reclen);
1228         CHECK_MEMBER(link_ea_entry, lee_parent_fid);
1229         CHECK_MEMBER(link_ea_entry, lee_name);
1230 }
1231
1232 static void
1233 check_hsm_user_item(void)
1234 {
1235         BLANK_LINE();
1236         CHECK_STRUCT(hsm_user_item);
1237         CHECK_MEMBER(hsm_user_item, hui_fid);
1238         CHECK_MEMBER(hsm_user_item, hui_extent);
1239 }
1240
1241 static void
1242 check_hsm_user_request(void)
1243 {
1244         BLANK_LINE();
1245         CHECK_STRUCT(hsm_user_request);
1246         CHECK_MEMBER(hsm_user_request, hur_action);
1247         CHECK_MEMBER(hsm_user_request, hur_archive_num);
1248         CHECK_MEMBER(hsm_user_request, hur_itemcount);
1249         CHECK_MEMBER(hsm_user_request, hur_data_len);
1250 }
1251
1252 static void
1253 check_hsm_user_state(void)
1254 {
1255         BLANK_LINE();
1256         CHECK_STRUCT(hsm_user_state);
1257         CHECK_MEMBER(hsm_user_state, hus_states);
1258         CHECK_MEMBER(hsm_user_state, hus_archive_num);
1259         CHECK_MEMBER(hsm_user_state, hus_in_progress_state);
1260         CHECK_MEMBER(hsm_user_state, hus_in_progress_action);
1261         CHECK_MEMBER(hsm_user_state, hus_in_progress_location);
1262 }
1263
1264 static void
1265 system_string (char *cmdline, char *str, int len)
1266 {
1267         int   fds[2];
1268         int   rc;
1269         pid_t pid;
1270
1271         rc = pipe(fds);
1272         if (rc != 0)
1273                 abort();
1274
1275         pid = fork();
1276         if (pid == 0) {
1277                 /* child */
1278                 int   fd = fileno(stdout);
1279
1280                 rc = dup2(fds[1], fd);
1281                 if (rc != fd)
1282                         abort();
1283
1284                 exit(system(cmdline));
1285                 /* notreached */
1286         } else if ((int)pid < 0) {
1287                 abort();
1288         } else {
1289                 FILE *f = fdopen(fds[0], "r");
1290
1291                 if (f == NULL)
1292                         abort();
1293
1294                 close(fds[1]);
1295
1296                 if (fgets(str, len, f) == NULL)
1297                         abort();
1298
1299                 if (waitpid(pid, &rc, 0) != pid)
1300                         abort();
1301
1302                 if (!WIFEXITED(rc) || WEXITSTATUS(rc) != 0)
1303                         abort();
1304
1305                 if (strnlen(str, len) == len)
1306                         str[len - 1] = 0;
1307
1308                 if (str[strlen(str) - 1] == '\n')
1309                         str[strlen(str) - 1] = 0;
1310
1311                 fclose(f);
1312         }
1313 }
1314
1315 int
1316 main(int argc, char **argv)
1317 {
1318         char unameinfo[80];
1319         char gccinfo[80];
1320
1321         system_string("uname -a", unameinfo, sizeof(unameinfo));
1322         system_string(CC " -v 2>&1 | tail -1", gccinfo, sizeof(gccinfo));
1323
1324         printf ("void lustre_assert_wire_constants(void)\n"
1325                 "{\n"
1326                 "        /* Wire protocol assertions generated by 'wirecheck'\n"
1327                 "         * (make -C lustre/utils newwiretest)\n"
1328                 "         * running on %s\n"
1329                 "         * with %s */\n"
1330                 "\n", unameinfo, gccinfo);
1331
1332         BLANK_LINE ();
1333
1334         COMMENT("Constants...");
1335         CHECK_DEFINE(LUSTRE_MSG_MAGIC_V2);
1336         CHECK_DEFINE(PTLRPC_MSG_VERSION);
1337         CHECK_VALUE(MSGHDR_AT_SUPPORT);
1338
1339         CHECK_VALUE(PTL_RPC_MSG_REQUEST);
1340         CHECK_VALUE(PTL_RPC_MSG_ERR);
1341         CHECK_VALUE(PTL_RPC_MSG_REPLY);
1342
1343         CHECK_VALUE(MSG_LAST_REPLAY);
1344         CHECK_VALUE(MSG_RESENT);
1345         CHECK_VALUE(MSG_REPLAY);
1346
1347         CHECK_VALUE(MSG_CONNECT_RECOVERING);
1348         CHECK_VALUE(MSG_CONNECT_RECONNECT);
1349         CHECK_VALUE(MSG_CONNECT_REPLAYABLE);
1350
1351         CHECK_VALUE(OST_REPLY);
1352         CHECK_VALUE(OST_GETATTR);
1353         CHECK_VALUE(OST_SETATTR);
1354         CHECK_VALUE(OST_READ);
1355         CHECK_VALUE(OST_WRITE);
1356         CHECK_VALUE(OST_CREATE);
1357         CHECK_VALUE(OST_DESTROY);
1358         CHECK_VALUE(OST_GET_INFO);
1359         CHECK_VALUE(OST_CONNECT);
1360         CHECK_VALUE(OST_DISCONNECT);
1361         CHECK_VALUE(OST_PUNCH);
1362         CHECK_VALUE(OST_OPEN);
1363         CHECK_VALUE(OST_CLOSE);
1364         CHECK_VALUE(OST_STATFS);
1365         CHECK_VALUE(OST_SYNC);
1366         CHECK_VALUE(OST_QUOTACHECK);
1367         CHECK_VALUE(OST_QUOTACTL);
1368         CHECK_VALUE(OST_QUOTA_ADJUST_QUNIT);
1369         CHECK_VALUE(OST_LAST_OPC);
1370
1371         CHECK_DEFINE(OBD_OBJECT_EOF);
1372
1373         CHECK_VALUE(MDS_GETATTR);
1374         CHECK_VALUE(MDS_GETATTR_NAME);
1375         CHECK_VALUE(MDS_CLOSE);
1376         CHECK_VALUE(MDS_REINT);
1377         CHECK_VALUE(MDS_READPAGE);
1378         CHECK_VALUE(MDS_CONNECT);
1379         CHECK_VALUE(MDS_DISCONNECT);
1380         CHECK_VALUE(MDS_GETSTATUS);
1381         CHECK_VALUE(MDS_STATFS);
1382         CHECK_VALUE(MDS_PIN);
1383         CHECK_VALUE(MDS_UNPIN);
1384         CHECK_VALUE(MDS_SYNC);
1385         CHECK_VALUE(MDS_DONE_WRITING);
1386         CHECK_VALUE(MDS_SET_INFO);
1387         CHECK_VALUE(MDS_QUOTACHECK);
1388         CHECK_VALUE(MDS_QUOTACTL);
1389         CHECK_VALUE(MDS_GETXATTR);
1390         CHECK_VALUE(MDS_SETXATTR);
1391         CHECK_VALUE(MDS_WRITEPAGE);
1392         CHECK_VALUE(MDS_IS_SUBDIR);
1393         CHECK_VALUE(MDS_GET_INFO);
1394         CHECK_VALUE(MDS_LAST_OPC);
1395
1396         CHECK_VALUE(REINT_SETATTR);
1397         CHECK_VALUE(REINT_CREATE);
1398         CHECK_VALUE(REINT_LINK);
1399         CHECK_VALUE(REINT_UNLINK);
1400         CHECK_VALUE(REINT_RENAME);
1401         CHECK_VALUE(REINT_OPEN);
1402         CHECK_VALUE(REINT_MAX);
1403
1404         CHECK_VALUE(MGS_CONNECT);
1405         CHECK_VALUE(MGS_DISCONNECT);
1406         CHECK_VALUE(MGS_EXCEPTION);
1407         CHECK_VALUE(MGS_TARGET_REG);
1408         CHECK_VALUE(MGS_TARGET_DEL);
1409         CHECK_VALUE(MGS_SET_INFO);
1410
1411         CHECK_VALUE(DISP_IT_EXECD);
1412         CHECK_VALUE(DISP_LOOKUP_EXECD);
1413         CHECK_VALUE(DISP_LOOKUP_NEG);
1414         CHECK_VALUE(DISP_LOOKUP_POS);
1415         CHECK_VALUE(DISP_OPEN_CREATE);
1416         CHECK_VALUE(DISP_OPEN_OPEN);
1417
1418         CHECK_VALUE(MDS_STATUS_CONN);
1419         CHECK_VALUE(MDS_STATUS_LOV);
1420
1421         CHECK_VALUE(LDLM_ENQUEUE);
1422         CHECK_VALUE(LDLM_CONVERT);
1423         CHECK_VALUE(LDLM_CANCEL);
1424         CHECK_VALUE(LDLM_BL_CALLBACK);
1425         CHECK_VALUE(LDLM_CP_CALLBACK);
1426         CHECK_VALUE(LDLM_GL_CALLBACK);
1427         CHECK_VALUE(LDLM_SET_INFO);
1428         CHECK_VALUE(LDLM_LAST_OPC);
1429
1430         CHECK_VALUE(LCK_EX);
1431         CHECK_VALUE(LCK_PW);
1432         CHECK_VALUE(LCK_PR);
1433         CHECK_VALUE(LCK_CW);
1434         CHECK_VALUE(LCK_CR);
1435         CHECK_VALUE(LCK_NL);
1436         CHECK_VALUE(LCK_GROUP);
1437         CHECK_VALUE(LCK_MAXMODE);
1438         CHECK_VALUE(LCK_MODE_NUM);
1439
1440         CHECK_CVALUE(LDLM_PLAIN);
1441         CHECK_CVALUE(LDLM_EXTENT);
1442         CHECK_CVALUE(LDLM_FLOCK);
1443         CHECK_CVALUE(LDLM_IBITS);
1444
1445         CHECK_VALUE(OBD_PING);
1446         CHECK_VALUE(OBD_LOG_CANCEL);
1447         CHECK_VALUE(OBD_QC_CALLBACK);
1448         CHECK_VALUE(OBD_LAST_OPC);
1449
1450         CHECK_VALUE(QUOTA_DQACQ);
1451         CHECK_VALUE(QUOTA_DQREL);
1452
1453         CHECK_VALUE(MGS_CONNECT);
1454         CHECK_VALUE(MGS_DISCONNECT);
1455         CHECK_VALUE(MGS_EXCEPTION);
1456         CHECK_VALUE(MGS_TARGET_REG);
1457         CHECK_VALUE(MGS_TARGET_DEL);
1458         CHECK_VALUE(MGS_SET_INFO);
1459
1460         COMMENT("Sizes and Offsets");
1461         BLANK_LINE();
1462         CHECK_STRUCT(obd_uuid);
1463         check_lustre_handle();
1464         check_lustre_msg_v2();
1465         check_ptlrpc_body();
1466         check_obd_connect_data();
1467         check_obdo();
1468         check_lov_mds_md_v1();
1469         check_lov_mds_md_v3();
1470         check_obd_statfs();
1471         check_obd_ioobj();
1472         check_obd_quotactl();
1473         check_niobuf_remote();
1474         check_ost_body();
1475         check_ll_fid();
1476         check_mds_status_req();
1477         check_mds_body();
1478         check_mdt_rec_setattr();
1479         check_mdt_rec_create();
1480         check_mdt_rec_link();
1481         check_mdt_rec_unlink();
1482         check_mdt_rec_rename();
1483         check_lov_desc();
1484         check_ldlm_res_id();
1485         check_ldlm_extent();
1486         check_ldlm_flock();
1487         check_ldlm_inodebits();
1488         check_ldlm_intent();
1489         check_ldlm_resource_desc();
1490         check_ldlm_lock_desc();
1491         check_ldlm_request();
1492         check_ldlm_reply();
1493         check_ldlm_lvb();
1494         check_cfg_marker();
1495         check_llog_logid();
1496         check_llog_catid();
1497         check_llog_rec_hdr();
1498         check_llog_rec_tail();
1499         check_llog_logid_rec();
1500         check_llog_create_rec();
1501         check_llog_orphan_rec();
1502         check_llog_unlink_rec();
1503         check_llog_setattr_rec();
1504         check_llog_setattr64_rec();
1505         check_llog_size_change_rec();
1506         check_changelog_rec();
1507         check_llog_changelog_rec();
1508         check_llog_gen();
1509         check_llog_gen_rec();
1510         check_llog_log_hdr();
1511         check_llog_cookie();
1512         check_llogd_body();
1513         check_llogd_conn_body();
1514         check_qunit_data();
1515         check_quota_adjust_qunit();
1516         check_mgs_target_info();
1517         check_lustre_disk_data();
1518         check_ll_user_fiemap();
1519         check_ll_fiemap_extent();
1520         printf("#ifdef LIBLUSTRE_POSIX_ACL\n");
1521 #ifndef LIBLUSTRE_POSIX_ACL
1522 #error build generator without LIBLUSTRE_POSIX_ACL defined - produce wrong check code.
1523 #endif
1524         check_posix_acl_xattr_entry();
1525         check_posix_acl_xattr_header();
1526         printf("#endif\n");
1527         check_link_ea_header();
1528         check_link_ea_entry();
1529         check_hsm_user_item();
1530         check_hsm_user_request();
1531         check_hsm_user_state();
1532
1533         printf("}\n\n");
1534
1535         return(0);
1536 }