Whamcloud - gitweb
LU-1081 fid: define special FID for BFL
[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  * Copyright (c) 2011, 2012, Whamcloud, Inc.
33  */
34 /*
35  * This file is part of Lustre, http://www.lustre.org/
36  * Lustre is a trademark of Sun Microsystems, Inc.
37  */
38
39 #include <stdio.h>
40 #include <sys/types.h>
41 #include <sys/wait.h>
42 #include <liblustre.h>
43 #include <lustre_lib.h>
44 #include <lustre/lustre_idl.h>
45 #include <lustre_disk.h>
46
47 #define BLANK_LINE()                                            \
48 do {                                                            \
49         printf("\n");                                           \
50 } while(0)
51
52 #define COMMENT(c)                                              \
53 do {                                                            \
54         printf("        /* "c" */\n");                          \
55 } while(0)
56
57 #define STRINGIFY(a) #a
58
59 #define CHECK_CDEFINE(a)                                        \
60         printf("        CLASSERT("#a" == "STRINGIFY(a) ");\n")
61
62 #define CHECK_CVALUE(a)                                         \
63         printf("        CLASSERT("#a" == %lld);\n", (long long)a)
64
65 #define CHECK_CVALUE_X(a)                                       \
66         printf("        CLASSERT("#a" == 0x%.8x);\n", a)
67
68 #define CHECK_DEFINE(a)                                         \
69 do {                                                            \
70         printf("        LASSERTF("#a" == "STRINGIFY(a)          \
71                ", \"found %%lld\\n\",\n                 "       \
72                "(long long)"#a");\n");                          \
73 } while(0)
74
75 #define CHECK_DEFINE_X(a)                                       \
76 do {                                                            \
77         printf("        LASSERTF("#a" == "STRINGIFY(a)          \
78                ", \"found 0x%%.8x\\n\",\n                 "#a   \
79                ");\n");                                         \
80 } while(0)
81
82 #define CHECK_DEFINE_64X(a)                                     \
83 do {                                                            \
84         printf("        LASSERTF("#a" == "STRINGIFY(a)          \
85                ", \"found 0x%%.16llxULL\\n\",\n                "\
86                " "#a");\n");                                    \
87 } while(0)
88
89 #define CHECK_VALUE(a)                                          \
90 do {                                                            \
91         printf("        LASSERTF("#a                            \
92                " == %lld, \"found %%lld\\n\",\n                "\
93                " (long long)"#a");\n", (long long)a);           \
94 } while(0)
95
96 #define CHECK_VALUE_X(a)                                        \
97 do {                                                            \
98         printf("        LASSERTF("#a                            \
99                " == 0x%.8xUL, \"found 0x%%.8xUL\\n\",\n        "\
100                "         (unsigned)"#a");\n", (unsigned)a);     \
101 } while(0)
102
103 #define CHECK_VALUE_O(a)                                        \
104 do {                                                            \
105         printf("        LASSERTF("#a                            \
106                " == 0%.11oUL, \"found 0%%.11oUL\\n\",\n        "\
107                "         "#a");\n", a);                         \
108 } while(0)
109
110 #define CHECK_VALUE_64X(a)                                      \
111 do {                                                            \
112         printf("        LASSERTF("#a" == 0x%.16llxULL, "        \
113                "\"found 0x%%.16llxULL\\n\",\n                 " \
114                "(long long)"#a");\n", (long long)a);            \
115 } while(0)
116
117 #define CHECK_VALUE_64O(a)                                      \
118 do {                                                            \
119         printf("        LASSERTF("#a" == 0%.22lloULL, "         \
120                "\"found 0%%.22lloULL\\n\",\n                 "  \
121                "(long long)"#a");\n", (long long)a);            \
122 } while(0)
123
124 #define CHECK_MEMBER_OFFSET(s,m)                                \
125 do {                                                            \
126         CHECK_VALUE((int)offsetof(struct s, m));                \
127 } while(0)
128
129 #define CHECK_MEMBER_OFFSET_TYPEDEF(s,m)                        \
130 do {                                                            \
131         CHECK_VALUE((int)offsetof(s, m));                       \
132 } while(0)
133
134 #define CHECK_MEMBER_SIZEOF(s,m)                                \
135 do {                                                            \
136         CHECK_VALUE((int)sizeof(((struct s *)0)->m));           \
137 } while(0)
138
139 #define CHECK_MEMBER_SIZEOF_TYPEDEF(s,m)                        \
140 do {                                                            \
141         CHECK_VALUE((int)sizeof(((s *)0)->m));                  \
142 } while(0)
143
144 #define CHECK_MEMBER(s,m)                                       \
145 do {                                                            \
146         CHECK_MEMBER_OFFSET(s, m);                              \
147         CHECK_MEMBER_SIZEOF(s, m);                              \
148 } while(0)
149
150 #define CHECK_MEMBER_TYPEDEF(s,m)                               \
151 do {                                                            \
152         CHECK_MEMBER_OFFSET_TYPEDEF(s, m);                      \
153         CHECK_MEMBER_SIZEOF_TYPEDEF(s, m);                      \
154 } while(0)
155
156 #define CHECK_STRUCT(s)                                         \
157 do {                                                            \
158         COMMENT("Checks for struct "#s);                        \
159                 CHECK_VALUE((int)sizeof(struct s));             \
160 } while(0)
161
162 #define CHECK_STRUCT_TYPEDEF(s)                                 \
163 do {                                                            \
164         COMMENT("Checks for type "#s);                          \
165                 CHECK_VALUE((int)sizeof(s));                    \
166 } while(0)
167
168 static void
169 check_lu_seq_range(void)
170 {
171         BLANK_LINE();
172         CHECK_STRUCT(lu_seq_range);
173         CHECK_MEMBER(lu_seq_range, lsr_start);
174         CHECK_MEMBER(lu_seq_range, lsr_end);
175         CHECK_MEMBER(lu_seq_range, lsr_index);
176         CHECK_MEMBER(lu_seq_range, lsr_flags);
177
178         CHECK_VALUE(LU_SEQ_RANGE_MDT);
179         CHECK_VALUE(LU_SEQ_RANGE_OST);
180 }
181
182 static void
183 check_lustre_mdt_attrs(void)
184 {
185         BLANK_LINE();
186         CHECK_STRUCT(lustre_mdt_attrs);
187         CHECK_MEMBER(lustre_mdt_attrs, lma_compat);
188         CHECK_MEMBER(lustre_mdt_attrs, lma_incompat);
189         CHECK_MEMBER(lustre_mdt_attrs, lma_self_fid);
190         CHECK_MEMBER(lustre_mdt_attrs, lma_flags);
191         CHECK_MEMBER(lustre_mdt_attrs, lma_ioepoch);
192         CHECK_MEMBER(lustre_mdt_attrs, lma_som_size);
193         CHECK_MEMBER(lustre_mdt_attrs, lma_som_blocks);
194         CHECK_MEMBER(lustre_mdt_attrs, lma_som_mountid);
195
196         CHECK_DEFINE(LMA_INCOMPAT_SUPP);
197
198         CHECK_VALUE_X(LMAC_HSM);
199         CHECK_VALUE_X(LMAC_SOM);
200 }
201
202 static void
203 check_ost_id(void)
204 {
205         BLANK_LINE();
206         CHECK_STRUCT(ost_id);
207         CHECK_MEMBER(ost_id, oi_id);
208         CHECK_MEMBER(ost_id, oi_seq);
209
210         CHECK_VALUE(LUSTRE_FID_INIT_OID);
211
212         CHECK_VALUE(FID_SEQ_OST_MDT0);
213         CHECK_VALUE(FID_SEQ_LLOG);
214         CHECK_VALUE(FID_SEQ_ECHO);
215         CHECK_VALUE(FID_SEQ_OST_MDT1);
216         CHECK_VALUE(FID_SEQ_OST_MAX);
217         CHECK_VALUE(FID_SEQ_RSVD);
218         CHECK_VALUE(FID_SEQ_IGIF);
219         CHECK_VALUE_64X(FID_SEQ_IGIF_MAX);
220         CHECK_VALUE_64X(FID_SEQ_IDIF);
221         CHECK_VALUE_64X(FID_SEQ_IDIF_MAX);
222         CHECK_VALUE_64X(FID_SEQ_START);
223         CHECK_VALUE_64X(FID_SEQ_LOCAL_FILE);
224         CHECK_VALUE_64X(FID_SEQ_DOT_LUSTRE);
225         CHECK_VALUE_64X(FID_SEQ_SPECIAL);
226         CHECK_VALUE_64X(FID_SEQ_NORMAL);
227         CHECK_VALUE_64X(FID_SEQ_LOV_DEFAULT);
228
229         CHECK_VALUE(FID_OID_SPECIAL_BFL);
230         CHECK_VALUE(FID_OID_DOT_LUSTRE);
231         CHECK_VALUE(FID_OID_DOT_LUSTRE_OBF);
232 }
233
234 static void
235 check_lu_dirent(void)
236 {
237         BLANK_LINE();
238         CHECK_STRUCT(lu_dirent);
239         CHECK_MEMBER(lu_dirent, lde_fid);
240         CHECK_MEMBER(lu_dirent, lde_hash);
241         CHECK_MEMBER(lu_dirent, lde_reclen);
242         CHECK_MEMBER(lu_dirent, lde_namelen);
243         CHECK_MEMBER(lu_dirent, lde_attrs);
244         CHECK_MEMBER(lu_dirent, lde_name[0]);
245
246         CHECK_VALUE_X(LUDA_FID);
247         CHECK_VALUE_X(LUDA_TYPE);
248         CHECK_VALUE_X(LUDA_64BITHASH);
249 }
250
251 static void
252 check_luda_type(void)
253 {
254         BLANK_LINE();
255         CHECK_STRUCT(luda_type);
256         CHECK_MEMBER(luda_type, lt_type);
257 }
258
259 static void
260 check_lu_dirpage(void)
261 {
262         BLANK_LINE();
263         CHECK_STRUCT(lu_dirpage);
264         CHECK_MEMBER(lu_dirpage, ldp_hash_start);
265         CHECK_MEMBER(lu_dirpage, ldp_hash_end);
266         CHECK_MEMBER(lu_dirpage, ldp_flags);
267         CHECK_MEMBER(lu_dirpage, ldp_pad0);
268         CHECK_MEMBER(lu_dirpage, ldp_entries[0]);
269
270         CHECK_VALUE(LDF_EMPTY);
271         CHECK_VALUE(LDF_COLLIDE);
272         CHECK_VALUE(LU_PAGE_SIZE);
273 }
274
275 static void
276 check_lustre_handle(void)
277 {
278         BLANK_LINE();
279         CHECK_STRUCT(lustre_handle);
280         CHECK_MEMBER(lustre_handle, cookie);
281 }
282
283 static void
284 check_lustre_msg_v2(void)
285 {
286         BLANK_LINE();
287         CHECK_STRUCT(lustre_msg_v2);
288         CHECK_MEMBER(lustre_msg_v2, lm_bufcount);
289         CHECK_MEMBER(lustre_msg_v2, lm_secflvr);
290         CHECK_MEMBER(lustre_msg_v2, lm_magic);
291         CHECK_MEMBER(lustre_msg_v2, lm_repsize);
292         CHECK_MEMBER(lustre_msg_v2, lm_cksum);
293         CHECK_MEMBER(lustre_msg_v2, lm_flags);
294         CHECK_MEMBER(lustre_msg_v2, lm_padding_2);
295         CHECK_MEMBER(lustre_msg_v2, lm_padding_3);
296         CHECK_MEMBER(lustre_msg_v2, lm_buflens[0]);
297
298         CHECK_DEFINE_X(LUSTRE_MSG_MAGIC_V1);
299         CHECK_DEFINE_X(LUSTRE_MSG_MAGIC_V2);
300         CHECK_DEFINE_X(LUSTRE_MSG_MAGIC_V1_SWABBED);
301         CHECK_DEFINE_X(LUSTRE_MSG_MAGIC_V2_SWABBED);
302 }
303
304 static void
305 check_ptlrpc_body(void)
306 {
307         BLANK_LINE();
308         CHECK_STRUCT(ptlrpc_body);
309         CHECK_MEMBER(ptlrpc_body, pb_handle);
310         CHECK_MEMBER(ptlrpc_body, pb_type);
311         CHECK_MEMBER(ptlrpc_body, pb_version);
312         CHECK_MEMBER(ptlrpc_body, pb_opc);
313         CHECK_MEMBER(ptlrpc_body, pb_status);
314         CHECK_MEMBER(ptlrpc_body, pb_last_xid);
315         CHECK_MEMBER(ptlrpc_body, pb_last_seen);
316         CHECK_MEMBER(ptlrpc_body, pb_last_committed);
317         CHECK_MEMBER(ptlrpc_body, pb_transno);
318         CHECK_MEMBER(ptlrpc_body, pb_flags);
319         CHECK_MEMBER(ptlrpc_body, pb_op_flags);
320         CHECK_MEMBER(ptlrpc_body, pb_conn_cnt);
321         CHECK_MEMBER(ptlrpc_body, pb_timeout);
322         CHECK_MEMBER(ptlrpc_body, pb_service_time);
323         CHECK_MEMBER(ptlrpc_body, pb_slv);
324         CHECK_MEMBER(ptlrpc_body, pb_limit);
325         CHECK_CVALUE(PTLRPC_NUM_VERSIONS);
326         CHECK_MEMBER(ptlrpc_body, pb_pre_versions[PTLRPC_NUM_VERSIONS]);
327         CHECK_MEMBER(ptlrpc_body, pb_padding[4]);
328
329         CHECK_VALUE(MSG_PTLRPC_BODY_OFF);
330         CHECK_VALUE(REQ_REC_OFF);
331         CHECK_VALUE(REPLY_REC_OFF);
332         CHECK_VALUE(DLM_LOCKREQ_OFF);
333         CHECK_VALUE(DLM_REQ_REC_OFF);
334         CHECK_VALUE(DLM_INTENT_IT_OFF);
335         CHECK_VALUE(DLM_INTENT_REC_OFF);
336         CHECK_VALUE(DLM_LOCKREPLY_OFF);
337         CHECK_VALUE(DLM_REPLY_REC_OFF);
338         CHECK_VALUE(MSG_PTLRPC_HEADER_OFF);
339
340         CHECK_DEFINE_X(PTLRPC_MSG_VERSION);
341         CHECK_DEFINE_X(LUSTRE_VERSION_MASK);
342         CHECK_DEFINE_X(LUSTRE_OBD_VERSION);
343         CHECK_DEFINE_X(LUSTRE_MDS_VERSION);
344         CHECK_DEFINE_X(LUSTRE_OST_VERSION);
345         CHECK_DEFINE_X(LUSTRE_DLM_VERSION);
346         CHECK_DEFINE_X(LUSTRE_LOG_VERSION);
347         CHECK_DEFINE_X(LUSTRE_MGS_VERSION);
348
349         CHECK_VALUE(MSGHDR_AT_SUPPORT);
350         CHECK_VALUE(MSGHDR_CKSUM_INCOMPAT18);
351
352         CHECK_VALUE_X(MSG_OP_FLAG_MASK);
353         CHECK_VALUE(MSG_OP_FLAG_SHIFT);
354         CHECK_VALUE_X(MSG_GEN_FLAG_MASK);
355
356         CHECK_VALUE_X(MSG_LAST_REPLAY);
357         CHECK_VALUE_X(MSG_RESENT);
358         CHECK_VALUE_X(MSG_REPLAY);
359         CHECK_VALUE_X(MSG_DELAY_REPLAY);
360         CHECK_VALUE_X(MSG_VERSION_REPLAY);
361         CHECK_VALUE_X(MSG_REQ_REPLAY_DONE);
362         CHECK_VALUE_X(MSG_LOCK_REPLAY_DONE);
363
364         CHECK_VALUE_X(MSG_CONNECT_RECOVERING);
365         CHECK_VALUE_X(MSG_CONNECT_RECONNECT);
366         CHECK_VALUE_X(MSG_CONNECT_REPLAYABLE);
367         CHECK_VALUE_X(MSG_CONNECT_LIBCLIENT);
368         CHECK_VALUE_X(MSG_CONNECT_INITIAL);
369         CHECK_VALUE_X(MSG_CONNECT_ASYNC);
370         CHECK_VALUE_X(MSG_CONNECT_NEXT_VER);
371         CHECK_VALUE_X(MSG_CONNECT_TRANSNO);
372 }
373
374 static void
375 check_obd_connect_data(void)
376 {
377         BLANK_LINE();
378         CHECK_STRUCT(obd_connect_data);
379         CHECK_MEMBER(obd_connect_data, ocd_connect_flags);
380         CHECK_MEMBER(obd_connect_data, ocd_version);
381         CHECK_MEMBER(obd_connect_data, ocd_grant);
382         CHECK_MEMBER(obd_connect_data, ocd_index);
383         CHECK_MEMBER(obd_connect_data, ocd_brw_size);
384         CHECK_MEMBER(obd_connect_data, ocd_ibits_known);
385         CHECK_MEMBER(obd_connect_data, ocd_blocksize);
386         CHECK_MEMBER(obd_connect_data, ocd_inodespace);
387         CHECK_MEMBER(obd_connect_data, ocd_grant_extent);
388         CHECK_MEMBER(obd_connect_data, ocd_unused);
389         CHECK_MEMBER(obd_connect_data, ocd_transno);
390         CHECK_MEMBER(obd_connect_data, ocd_group);
391         CHECK_MEMBER(obd_connect_data, ocd_cksum_types);
392         CHECK_MEMBER(obd_connect_data, ocd_max_easize);
393         CHECK_MEMBER(obd_connect_data, ocd_instance);
394         CHECK_MEMBER(obd_connect_data, ocd_maxbytes);
395         CHECK_MEMBER(obd_connect_data, padding1);
396         CHECK_MEMBER(obd_connect_data, padding2);
397         CHECK_MEMBER(obd_connect_data, padding3);
398         CHECK_MEMBER(obd_connect_data, padding4);
399         CHECK_MEMBER(obd_connect_data, padding5);
400         CHECK_MEMBER(obd_connect_data, padding6);
401         CHECK_MEMBER(obd_connect_data, padding7);
402         CHECK_MEMBER(obd_connect_data, padding8);
403         CHECK_MEMBER(obd_connect_data, padding9);
404         CHECK_MEMBER(obd_connect_data, paddingA);
405         CHECK_MEMBER(obd_connect_data, paddingB);
406         CHECK_MEMBER(obd_connect_data, paddingC);
407         CHECK_MEMBER(obd_connect_data, paddingD);
408         CHECK_MEMBER(obd_connect_data, paddingE);
409         CHECK_MEMBER(obd_connect_data, paddingF);
410
411         CHECK_DEFINE_64X(OBD_CONNECT_RDONLY);
412         CHECK_DEFINE_64X(OBD_CONNECT_INDEX);
413         CHECK_DEFINE_64X(OBD_CONNECT_MDS);
414         CHECK_DEFINE_64X(OBD_CONNECT_GRANT);
415         CHECK_DEFINE_64X(OBD_CONNECT_SRVLOCK);
416         CHECK_DEFINE_64X(OBD_CONNECT_VERSION);
417         CHECK_DEFINE_64X(OBD_CONNECT_REQPORTAL);
418         CHECK_DEFINE_64X(OBD_CONNECT_ACL);
419         CHECK_DEFINE_64X(OBD_CONNECT_XATTR);
420         CHECK_DEFINE_64X(OBD_CONNECT_CROW);
421         CHECK_DEFINE_64X(OBD_CONNECT_TRUNCLOCK);
422         CHECK_DEFINE_64X(OBD_CONNECT_TRANSNO);
423         CHECK_DEFINE_64X(OBD_CONNECT_IBITS);
424         CHECK_DEFINE_64X(OBD_CONNECT_JOIN);
425         CHECK_DEFINE_64X(OBD_CONNECT_ATTRFID);
426         CHECK_DEFINE_64X(OBD_CONNECT_NODEVOH);
427         CHECK_DEFINE_64X(OBD_CONNECT_RMT_CLIENT);
428         CHECK_DEFINE_64X(OBD_CONNECT_RMT_CLIENT_FORCE);
429         CHECK_DEFINE_64X(OBD_CONNECT_BRW_SIZE);
430         CHECK_DEFINE_64X(OBD_CONNECT_QUOTA64);
431         CHECK_DEFINE_64X(OBD_CONNECT_MDS_CAPA);
432         CHECK_DEFINE_64X(OBD_CONNECT_OSS_CAPA);
433         CHECK_DEFINE_64X(OBD_CONNECT_CANCELSET);
434         CHECK_DEFINE_64X(OBD_CONNECT_SOM);
435         CHECK_DEFINE_64X(OBD_CONNECT_AT);
436         CHECK_DEFINE_64X(OBD_CONNECT_LRU_RESIZE);
437         CHECK_DEFINE_64X(OBD_CONNECT_MDS_MDS);
438         CHECK_DEFINE_64X(OBD_CONNECT_REAL);
439         CHECK_DEFINE_64X(OBD_CONNECT_CHANGE_QS);
440         CHECK_DEFINE_64X(OBD_CONNECT_CKSUM);
441         CHECK_DEFINE_64X(OBD_CONNECT_FID);
442         CHECK_DEFINE_64X(OBD_CONNECT_VBR);
443         CHECK_DEFINE_64X(OBD_CONNECT_LOV_V3);
444         CHECK_DEFINE_64X(OBD_CONNECT_GRANT_SHRINK);
445         CHECK_DEFINE_64X(OBD_CONNECT_SKIP_ORPHAN);
446         CHECK_DEFINE_64X(OBD_CONNECT_MAX_EASIZE);
447         CHECK_DEFINE_64X(OBD_CONNECT_FULL20);
448         CHECK_DEFINE_64X(OBD_CONNECT_LAYOUTLOCK);
449         CHECK_DEFINE_64X(OBD_CONNECT_64BITHASH);
450         CHECK_DEFINE_64X(OBD_CONNECT_MAXBYTES);
451         CHECK_DEFINE_64X(OBD_CONNECT_IMP_RECOV);
452         CHECK_DEFINE_64X(OBD_CONNECT_JOBSTATS);
453         CHECK_DEFINE_64X(OBD_CONNECT_GRANT_PARAM);
454         CHECK_DEFINE_64X(OBD_CONNECT_EINPROGRESS);
455
456         CHECK_VALUE_X(OBD_CKSUM_CRC32);
457         CHECK_VALUE_X(OBD_CKSUM_ADLER);
458         CHECK_VALUE_X(OBD_CKSUM_CRC32C);
459 }
460
461 static void
462 check_obdo(void)
463 {
464         BLANK_LINE();
465         CHECK_STRUCT(obdo);
466         CHECK_MEMBER(obdo, o_valid);
467         CHECK_MEMBER(obdo, o_id);
468         CHECK_MEMBER(obdo, o_seq);
469         CHECK_MEMBER(obdo, o_parent_seq);
470         CHECK_MEMBER(obdo, o_size);
471         CHECK_MEMBER(obdo, o_mtime);
472         CHECK_MEMBER(obdo, o_atime);
473         CHECK_MEMBER(obdo, o_ctime);
474         CHECK_MEMBER(obdo, o_blocks);
475         CHECK_MEMBER(obdo, o_grant);
476         CHECK_MEMBER(obdo, o_blksize);
477         CHECK_MEMBER(obdo, o_mode);
478         CHECK_MEMBER(obdo, o_uid);
479         CHECK_MEMBER(obdo, o_gid);
480         CHECK_MEMBER(obdo, o_flags);
481         CHECK_MEMBER(obdo, o_nlink);
482         CHECK_MEMBER(obdo, o_parent_oid);
483         CHECK_MEMBER(obdo, o_misc);
484         CHECK_MEMBER(obdo, o_ioepoch);
485         CHECK_MEMBER(obdo, o_stripe_idx);
486         CHECK_MEMBER(obdo, o_parent_ver);
487         CHECK_MEMBER(obdo, o_handle);
488         CHECK_MEMBER(obdo, o_lcookie);
489         CHECK_MEMBER(obdo, o_uid_h);
490         CHECK_MEMBER(obdo, o_gid_h);
491         CHECK_MEMBER(obdo, o_data_version);
492         CHECK_MEMBER(obdo, o_padding_4);
493         CHECK_MEMBER(obdo, o_padding_5);
494         CHECK_MEMBER(obdo, o_padding_6);
495
496         CHECK_DEFINE_64X(OBD_MD_FLID);
497         CHECK_DEFINE_64X(OBD_MD_FLATIME);
498         CHECK_DEFINE_64X(OBD_MD_FLMTIME);
499         CHECK_DEFINE_64X(OBD_MD_FLCTIME);
500         CHECK_DEFINE_64X(OBD_MD_FLSIZE);
501         CHECK_DEFINE_64X(OBD_MD_FLBLOCKS);
502         CHECK_DEFINE_64X(OBD_MD_FLBLKSZ);
503         CHECK_DEFINE_64X(OBD_MD_FLMODE);
504         CHECK_DEFINE_64X(OBD_MD_FLTYPE);
505         CHECK_DEFINE_64X(OBD_MD_FLUID);
506         CHECK_DEFINE_64X(OBD_MD_FLGID);
507         CHECK_DEFINE_64X(OBD_MD_FLFLAGS);
508         CHECK_DEFINE_64X(OBD_MD_FLNLINK);
509         CHECK_DEFINE_64X(OBD_MD_FLGENER);
510         CHECK_DEFINE_64X(OBD_MD_FLRDEV);
511         CHECK_DEFINE_64X(OBD_MD_FLEASIZE);
512         CHECK_DEFINE_64X(OBD_MD_LINKNAME);
513         CHECK_DEFINE_64X(OBD_MD_FLHANDLE);
514         CHECK_DEFINE_64X(OBD_MD_FLCKSUM);
515         CHECK_DEFINE_64X(OBD_MD_FLQOS);
516         CHECK_DEFINE_64X(OBD_MD_FLCOOKIE);
517         CHECK_DEFINE_64X(OBD_MD_FLGROUP);
518         CHECK_DEFINE_64X(OBD_MD_FLFID);
519         CHECK_DEFINE_64X(OBD_MD_FLEPOCH);
520         CHECK_DEFINE_64X(OBD_MD_FLGRANT);
521         CHECK_DEFINE_64X(OBD_MD_FLDIREA);
522         CHECK_DEFINE_64X(OBD_MD_FLUSRQUOTA);
523         CHECK_DEFINE_64X(OBD_MD_FLGRPQUOTA);
524         CHECK_DEFINE_64X(OBD_MD_FLMODEASIZE);
525         CHECK_DEFINE_64X(OBD_MD_MDS);
526         CHECK_DEFINE_64X(OBD_MD_REINT);
527         CHECK_DEFINE_64X(OBD_MD_MEA);
528         CHECK_DEFINE_64X(OBD_MD_MDTIDX);
529         CHECK_DEFINE_64X(OBD_MD_FLXATTR);
530         CHECK_DEFINE_64X(OBD_MD_FLXATTRLS);
531         CHECK_DEFINE_64X(OBD_MD_FLXATTRRM);
532         CHECK_DEFINE_64X(OBD_MD_FLACL);
533         CHECK_DEFINE_64X(OBD_MD_FLRMTPERM);
534         CHECK_DEFINE_64X(OBD_MD_FLMDSCAPA);
535         CHECK_DEFINE_64X(OBD_MD_FLOSSCAPA);
536         CHECK_DEFINE_64X(OBD_MD_FLCKSPLIT);
537         CHECK_DEFINE_64X(OBD_MD_FLCROSSREF);
538         CHECK_DEFINE_64X(OBD_MD_FLGETATTRLOCK);
539         CHECK_DEFINE_64X(OBD_MD_FLRMTLSETFACL);
540         CHECK_DEFINE_64X(OBD_MD_FLRMTLGETFACL);
541         CHECK_DEFINE_64X(OBD_MD_FLRMTRSETFACL);
542         CHECK_DEFINE_64X(OBD_MD_FLRMTRGETFACL);
543         CHECK_DEFINE_64X(OBD_MD_FLDATAVERSION);
544
545         CHECK_CVALUE_X(OBD_FL_INLINEDATA);
546         CHECK_CVALUE_X(OBD_FL_OBDMDEXISTS);
547         CHECK_CVALUE_X(OBD_FL_DELORPHAN);
548         CHECK_CVALUE_X(OBD_FL_NORPC);
549         CHECK_CVALUE_X(OBD_FL_IDONLY);
550         CHECK_CVALUE_X(OBD_FL_RECREATE_OBJS);
551         CHECK_CVALUE_X(OBD_FL_DEBUG_CHECK);
552         CHECK_CVALUE_X(OBD_FL_NO_USRQUOTA);
553         CHECK_CVALUE_X(OBD_FL_NO_GRPQUOTA);
554         CHECK_CVALUE_X(OBD_FL_CREATE_CROW);
555         CHECK_CVALUE_X(OBD_FL_SRVLOCK);
556         CHECK_CVALUE_X(OBD_FL_CKSUM_CRC32);
557         CHECK_CVALUE_X(OBD_FL_CKSUM_ADLER);
558         CHECK_CVALUE_X(OBD_FL_CKSUM_CRC32C);
559         CHECK_CVALUE_X(OBD_FL_CKSUM_RSVD2);
560         CHECK_CVALUE_X(OBD_FL_CKSUM_RSVD3);
561         CHECK_CVALUE_X(OBD_FL_SHRINK_GRANT);
562         CHECK_CVALUE_X(OBD_FL_MMAP);
563         CHECK_CVALUE_X(OBD_FL_RECOV_RESEND);
564         CHECK_CVALUE_X(OBD_FL_NOSPC_BLK);
565         CHECK_CVALUE_X(OBD_FL_LOCAL_MASK);
566 }
567
568 static void
569 check_lov_ost_data_v1(void)
570 {
571         BLANK_LINE();
572         CHECK_STRUCT(lov_ost_data_v1);
573         CHECK_MEMBER(lov_ost_data_v1, l_object_id);
574         CHECK_MEMBER(lov_ost_data_v1, l_object_seq);
575         CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
576         CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
577 }
578
579 static void
580 check_lov_mds_md_v1(void)
581 {
582         BLANK_LINE();
583         CHECK_STRUCT(lov_mds_md_v1);
584         CHECK_MEMBER(lov_mds_md_v1, lmm_magic);
585         CHECK_MEMBER(lov_mds_md_v1, lmm_pattern);
586         CHECK_MEMBER(lov_mds_md_v1, lmm_object_id);
587         CHECK_MEMBER(lov_mds_md_v1, lmm_object_seq);
588         CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_size);
589         CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_count);
590         CHECK_MEMBER(lov_mds_md_v1, lmm_objects[0]);
591
592         CHECK_CDEFINE(LOV_MAGIC_V1);
593 }
594
595 static void
596 check_lov_mds_md_v3(void)
597 {
598         BLANK_LINE();
599         CHECK_STRUCT(lov_mds_md_v3);
600         CHECK_MEMBER(lov_mds_md_v3, lmm_magic);
601         CHECK_MEMBER(lov_mds_md_v3, lmm_pattern);
602         CHECK_MEMBER(lov_mds_md_v3, lmm_object_id);
603         CHECK_MEMBER(lov_mds_md_v3, lmm_object_seq);
604         CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_size);
605         CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_count);
606         CHECK_CVALUE(LOV_MAXPOOLNAME);
607         CHECK_MEMBER(lov_mds_md_v3, lmm_pool_name[LOV_MAXPOOLNAME]);
608         CHECK_MEMBER(lov_mds_md_v3, lmm_objects[0]);
609
610         CHECK_CDEFINE(LOV_MAGIC_V3);
611
612         CHECK_VALUE_X(LOV_PATTERN_RAID0);
613         CHECK_VALUE_X(LOV_PATTERN_RAID1);
614         CHECK_VALUE_X(LOV_PATTERN_FIRST);
615         CHECK_VALUE_X(LOV_PATTERN_CMOBD);
616 }
617
618 static void
619 check_obd_statfs(void)
620 {
621         BLANK_LINE();
622         CHECK_STRUCT(obd_statfs);
623         CHECK_MEMBER(obd_statfs, os_type);
624         CHECK_MEMBER(obd_statfs, os_blocks);
625         CHECK_MEMBER(obd_statfs, os_bfree);
626         CHECK_MEMBER(obd_statfs, os_bavail);
627         CHECK_MEMBER(obd_statfs, os_ffree);
628         CHECK_MEMBER(obd_statfs, os_fsid);
629         CHECK_MEMBER(obd_statfs, os_bsize);
630         CHECK_MEMBER(obd_statfs, os_namelen);
631         CHECK_MEMBER(obd_statfs, os_state);
632         CHECK_MEMBER(obd_statfs, os_spare1);
633         CHECK_MEMBER(obd_statfs, os_spare2);
634         CHECK_MEMBER(obd_statfs, os_spare3);
635         CHECK_MEMBER(obd_statfs, os_spare4);
636         CHECK_MEMBER(obd_statfs, os_spare5);
637         CHECK_MEMBER(obd_statfs, os_spare6);
638         CHECK_MEMBER(obd_statfs, os_spare7);
639         CHECK_MEMBER(obd_statfs, os_spare8);
640         CHECK_MEMBER(obd_statfs, os_spare9);
641 }
642
643 static void
644 check_obd_ioobj(void)
645 {
646         BLANK_LINE();
647         CHECK_STRUCT(obd_ioobj);
648         CHECK_MEMBER(obd_ioobj, ioo_id);
649         CHECK_MEMBER(obd_ioobj, ioo_seq);
650         CHECK_MEMBER(obd_ioobj, ioo_type);
651         CHECK_MEMBER(obd_ioobj, ioo_bufcnt);
652 }
653
654 static void
655 check_obd_quotactl(void)
656 {
657         BLANK_LINE();
658         CHECK_STRUCT(obd_quotactl);
659         CHECK_MEMBER(obd_quotactl, qc_cmd);
660         CHECK_MEMBER(obd_quotactl, qc_type);
661         CHECK_MEMBER(obd_quotactl, qc_id);
662         CHECK_MEMBER(obd_quotactl, qc_stat);
663         CHECK_MEMBER(obd_quotactl, qc_dqinfo);
664         CHECK_MEMBER(obd_quotactl, qc_dqblk);
665
666         BLANK_LINE();
667         CHECK_STRUCT(obd_dqinfo);
668         CHECK_MEMBER(obd_dqinfo, dqi_bgrace);
669         CHECK_MEMBER(obd_dqinfo, dqi_igrace);
670         CHECK_MEMBER(obd_dqinfo, dqi_flags);
671         CHECK_MEMBER(obd_dqinfo, dqi_valid);
672
673         BLANK_LINE();
674         CHECK_STRUCT(obd_dqblk);
675         CHECK_MEMBER(obd_dqblk, dqb_bhardlimit);
676         CHECK_MEMBER(obd_dqblk, dqb_bsoftlimit);
677         CHECK_MEMBER(obd_dqblk, dqb_curspace);
678         CHECK_MEMBER(obd_dqblk, dqb_ihardlimit);
679         CHECK_MEMBER(obd_dqblk, dqb_isoftlimit);
680         CHECK_MEMBER(obd_dqblk, dqb_curinodes);
681         CHECK_MEMBER(obd_dqblk, dqb_btime);
682         CHECK_MEMBER(obd_dqblk, dqb_itime);
683         CHECK_MEMBER(obd_dqblk, dqb_valid);
684         CHECK_MEMBER(obd_dqblk, dqb_padding);
685
686         CHECK_DEFINE_X(Q_QUOTACHECK);
687         CHECK_DEFINE_X(Q_INITQUOTA);
688         CHECK_DEFINE_X(Q_GETOINFO);
689         CHECK_DEFINE_X(Q_GETOQUOTA);
690         CHECK_DEFINE_X(Q_FINVALIDATE);
691 }
692
693 static void
694 check_niobuf_remote(void)
695 {
696         BLANK_LINE();
697         CHECK_STRUCT(niobuf_remote);
698         CHECK_MEMBER(niobuf_remote, offset);
699         CHECK_MEMBER(niobuf_remote, len);
700         CHECK_MEMBER(niobuf_remote, flags);
701
702         CHECK_DEFINE_X(OBD_BRW_READ);
703         CHECK_DEFINE_X(OBD_BRW_WRITE);
704         CHECK_DEFINE_X(OBD_BRW_SYNC);
705         CHECK_DEFINE_X(OBD_BRW_CHECK);
706         CHECK_DEFINE_X(OBD_BRW_FROM_GRANT);
707         CHECK_DEFINE_X(OBD_BRW_GRANTED);
708         CHECK_DEFINE_X(OBD_BRW_NOCACHE);
709         CHECK_DEFINE_X(OBD_BRW_NOQUOTA);
710         CHECK_DEFINE_X(OBD_BRW_SRVLOCK);
711         CHECK_DEFINE_X(OBD_BRW_ASYNC);
712         CHECK_DEFINE_X(OBD_BRW_MEMALLOC);
713 }
714
715 static void
716 check_ost_body(void)
717 {
718         BLANK_LINE();
719         CHECK_STRUCT(ost_body);
720         CHECK_MEMBER(ost_body, oa);
721 }
722
723 static void
724 check_ll_fid(void)
725 {
726         BLANK_LINE();
727         CHECK_STRUCT(ll_fid);
728         CHECK_MEMBER(ll_fid, id);
729         CHECK_MEMBER(ll_fid, generation);
730         CHECK_MEMBER(ll_fid, f_type);
731 }
732
733 static void
734 check_mdt_body(void)
735 {
736         BLANK_LINE();
737         CHECK_STRUCT(mdt_body);
738         CHECK_MEMBER(mdt_body, fid1);
739         CHECK_MEMBER(mdt_body, fid2);
740         CHECK_MEMBER(mdt_body, handle);
741         CHECK_MEMBER(mdt_body, valid);
742         CHECK_MEMBER(mdt_body, size);
743         CHECK_MEMBER(mdt_body, mtime);
744         CHECK_MEMBER(mdt_body, atime);
745         CHECK_MEMBER(mdt_body, ctime);
746         CHECK_MEMBER(mdt_body, blocks);
747         CHECK_MEMBER(mdt_body, ino);
748         CHECK_MEMBER(mdt_body, fsuid);
749         CHECK_MEMBER(mdt_body, fsgid);
750         CHECK_MEMBER(mdt_body, capability);
751         CHECK_MEMBER(mdt_body, mode);
752         CHECK_MEMBER(mdt_body, uid);
753         CHECK_MEMBER(mdt_body, gid);
754         CHECK_MEMBER(mdt_body, flags);
755         CHECK_MEMBER(mdt_body, rdev);
756         CHECK_MEMBER(mdt_body, nlink);
757         CHECK_MEMBER(mdt_body, generation);
758         CHECK_MEMBER(mdt_body, suppgid);
759         CHECK_MEMBER(mdt_body, eadatasize);
760         CHECK_MEMBER(mdt_body, aclsize);
761         CHECK_MEMBER(mdt_body, max_mdsize);
762         CHECK_MEMBER(mdt_body, max_cookiesize);
763         CHECK_MEMBER(mdt_body, uid_h);
764         CHECK_MEMBER(mdt_body, gid_h);
765         CHECK_MEMBER(mdt_body, padding_5);
766         CHECK_MEMBER(mdt_body, padding_6);
767         CHECK_MEMBER(mdt_body, padding_7);
768         CHECK_MEMBER(mdt_body, padding_8);
769         CHECK_MEMBER(mdt_body, padding_9);
770         CHECK_MEMBER(mdt_body, padding_10);
771
772         CHECK_VALUE_O(MDS_FMODE_CLOSED);
773         CHECK_VALUE_O(MDS_FMODE_EXEC);
774         CHECK_VALUE_O(MDS_FMODE_EPOCH);
775         CHECK_VALUE_O(MDS_FMODE_TRUNC);
776         CHECK_VALUE_O(MDS_FMODE_SOM);
777
778         CHECK_VALUE_O(MDS_OPEN_CREATED);
779         CHECK_VALUE_O(MDS_OPEN_CROSS);
780         CHECK_VALUE_O(MDS_OPEN_CREAT);
781         CHECK_VALUE_O(MDS_OPEN_EXCL);
782         CHECK_VALUE_O(MDS_OPEN_TRUNC);
783         CHECK_VALUE_O(MDS_OPEN_APPEND);
784         CHECK_VALUE_O(MDS_OPEN_SYNC);
785         CHECK_VALUE_O(MDS_OPEN_DIRECTORY);
786         CHECK_VALUE_O(MDS_OPEN_DELAY_CREATE);
787         CHECK_VALUE_O(MDS_OPEN_OWNEROVERRIDE);
788         CHECK_VALUE_O(MDS_OPEN_JOIN_FILE);
789         CHECK_VALUE_O(MDS_CREATE_RMT_ACL);
790         CHECK_VALUE_O(MDS_CREATE_SLAVE_OBJ);
791         CHECK_VALUE_O(MDS_OPEN_LOCK);
792         CHECK_VALUE_O(MDS_OPEN_HAS_EA);
793         CHECK_VALUE_O(MDS_OPEN_HAS_OBJS);
794         CHECK_VALUE_64O(MDS_OPEN_NORESTORE);
795         CHECK_VALUE_64O(MDS_OPEN_NEWSTRIPE);
796
797         /* these should be identical to their EXT3_*_FL counterparts, and
798          * are redefined only to avoid dragging in ext3_fs.h */
799         CHECK_DEFINE_X(LUSTRE_SYNC_FL);
800         CHECK_DEFINE_X(LUSTRE_IMMUTABLE_FL);
801         CHECK_DEFINE_X(LUSTRE_APPEND_FL);
802         CHECK_DEFINE_X(LUSTRE_NOATIME_FL);
803         CHECK_DEFINE_X(LUSTRE_DIRSYNC_FL);
804
805         CHECK_DEFINE_X(MDS_INODELOCK_LOOKUP);
806         CHECK_DEFINE_X(MDS_INODELOCK_UPDATE);
807         CHECK_DEFINE_X(MDS_INODELOCK_OPEN);
808         CHECK_DEFINE_X(MDS_INODELOCK_LAYOUT);
809 }
810
811 static void
812 check_mdt_ioepoch(void)
813 {
814         BLANK_LINE();
815         CHECK_STRUCT(mdt_ioepoch);
816         CHECK_MEMBER(mdt_ioepoch, handle);
817         CHECK_MEMBER(mdt_ioepoch, ioepoch);
818         CHECK_MEMBER(mdt_ioepoch, flags);
819         CHECK_MEMBER(mdt_ioepoch, padding);
820 }
821
822 static void
823 check_mdt_remote_perm(void)
824 {
825         BLANK_LINE();
826         CHECK_STRUCT(mdt_remote_perm);
827         CHECK_MEMBER(mdt_remote_perm, rp_uid);
828         CHECK_MEMBER(mdt_remote_perm, rp_gid);
829         CHECK_MEMBER(mdt_remote_perm, rp_fsuid);
830         CHECK_MEMBER(mdt_remote_perm, rp_fsgid);
831         CHECK_MEMBER(mdt_remote_perm, rp_access_perm);
832         CHECK_MEMBER(mdt_remote_perm, rp_padding);
833
834         CHECK_VALUE_X(CFS_SETUID_PERM);
835         CHECK_VALUE_X(CFS_SETGID_PERM);
836         CHECK_VALUE_X(CFS_SETGRP_PERM);
837         CHECK_VALUE_X(CFS_RMTACL_PERM);
838         CHECK_VALUE_X(CFS_RMTOWN_PERM);
839 }
840
841 static void
842 check_mdt_rec_setattr(void)
843 {
844         BLANK_LINE();
845         CHECK_STRUCT(mdt_rec_setattr);
846         CHECK_MEMBER(mdt_rec_setattr, sa_opcode);
847         CHECK_MEMBER(mdt_rec_setattr, sa_cap);
848         CHECK_MEMBER(mdt_rec_setattr, sa_fsuid);
849         CHECK_MEMBER(mdt_rec_setattr, sa_fsuid_h);
850         CHECK_MEMBER(mdt_rec_setattr, sa_fsgid);
851         CHECK_MEMBER(mdt_rec_setattr, sa_fsgid_h);
852         CHECK_MEMBER(mdt_rec_setattr, sa_suppgid);
853         CHECK_MEMBER(mdt_rec_setattr, sa_suppgid_h);
854         CHECK_MEMBER(mdt_rec_setattr, sa_padding_1);
855         CHECK_MEMBER(mdt_rec_setattr, sa_padding_1_h);
856         CHECK_MEMBER(mdt_rec_setattr, sa_fid);
857         CHECK_MEMBER(mdt_rec_setattr, sa_valid);
858         CHECK_MEMBER(mdt_rec_setattr, sa_uid);
859         CHECK_MEMBER(mdt_rec_setattr, sa_gid);
860         CHECK_MEMBER(mdt_rec_setattr, sa_size);
861         CHECK_MEMBER(mdt_rec_setattr, sa_blocks);
862         CHECK_MEMBER(mdt_rec_setattr, sa_mtime);
863         CHECK_MEMBER(mdt_rec_setattr, sa_atime);
864         CHECK_MEMBER(mdt_rec_setattr, sa_ctime);
865         CHECK_MEMBER(mdt_rec_setattr, sa_attr_flags);
866         CHECK_MEMBER(mdt_rec_setattr, sa_mode);
867         CHECK_MEMBER(mdt_rec_setattr, sa_padding_2);
868         CHECK_MEMBER(mdt_rec_setattr, sa_padding_3);
869         CHECK_MEMBER(mdt_rec_setattr, sa_padding_4);
870         CHECK_MEMBER(mdt_rec_setattr, sa_padding_5);
871 }
872
873 static void
874 check_mdt_rec_create(void)
875 {
876         BLANK_LINE();
877         CHECK_STRUCT(mdt_rec_create);
878         CHECK_MEMBER(mdt_rec_create, cr_opcode);
879         CHECK_MEMBER(mdt_rec_create, cr_cap);
880         CHECK_MEMBER(mdt_rec_create, cr_fsuid);
881         CHECK_MEMBER(mdt_rec_create, cr_fsuid_h);
882         CHECK_MEMBER(mdt_rec_create, cr_fsgid);
883         CHECK_MEMBER(mdt_rec_create, cr_fsgid_h);
884         CHECK_MEMBER(mdt_rec_create, cr_suppgid1);
885         CHECK_MEMBER(mdt_rec_create, cr_suppgid1_h);
886         CHECK_MEMBER(mdt_rec_create, cr_suppgid2);
887         CHECK_MEMBER(mdt_rec_create, cr_suppgid2_h);
888         CHECK_MEMBER(mdt_rec_create, cr_fid1);
889         CHECK_MEMBER(mdt_rec_create, cr_fid2);
890         CHECK_MEMBER(mdt_rec_create, cr_old_handle);
891         CHECK_MEMBER(mdt_rec_create, cr_time);
892         CHECK_MEMBER(mdt_rec_create, cr_rdev);
893         CHECK_MEMBER(mdt_rec_create, cr_ioepoch);
894         CHECK_MEMBER(mdt_rec_create, cr_padding_1);
895         CHECK_MEMBER(mdt_rec_create, cr_mode);
896         CHECK_MEMBER(mdt_rec_create, cr_bias);
897         CHECK_MEMBER(mdt_rec_create, cr_flags_l);
898         CHECK_MEMBER(mdt_rec_create, cr_flags_h);
899         CHECK_MEMBER(mdt_rec_create, cr_padding_3);
900         CHECK_MEMBER(mdt_rec_create, cr_padding_4);
901 }
902
903 static void
904 check_mdt_rec_link(void)
905 {
906         BLANK_LINE();
907         CHECK_STRUCT(mdt_rec_link);
908         CHECK_MEMBER(mdt_rec_link, lk_opcode);
909         CHECK_MEMBER(mdt_rec_link, lk_cap);
910         CHECK_MEMBER(mdt_rec_link, lk_fsuid);
911         CHECK_MEMBER(mdt_rec_link, lk_fsuid_h);
912         CHECK_MEMBER(mdt_rec_link, lk_fsgid);
913         CHECK_MEMBER(mdt_rec_link, lk_fsgid_h);
914         CHECK_MEMBER(mdt_rec_link, lk_suppgid1);
915         CHECK_MEMBER(mdt_rec_link, lk_suppgid1_h);
916         CHECK_MEMBER(mdt_rec_link, lk_suppgid2);
917         CHECK_MEMBER(mdt_rec_link, lk_suppgid2_h);
918         CHECK_MEMBER(mdt_rec_link, lk_fid1);
919         CHECK_MEMBER(mdt_rec_link, lk_fid2);
920         CHECK_MEMBER(mdt_rec_link, lk_time);
921         CHECK_MEMBER(mdt_rec_link, lk_padding_1);
922         CHECK_MEMBER(mdt_rec_link, lk_padding_2);
923         CHECK_MEMBER(mdt_rec_link, lk_padding_3);
924         CHECK_MEMBER(mdt_rec_link, lk_padding_4);
925         CHECK_MEMBER(mdt_rec_link, lk_bias);
926         CHECK_MEMBER(mdt_rec_link, lk_padding_5);
927         CHECK_MEMBER(mdt_rec_link, lk_padding_6);
928         CHECK_MEMBER(mdt_rec_link, lk_padding_7);
929         CHECK_MEMBER(mdt_rec_link, lk_padding_8);
930         CHECK_MEMBER(mdt_rec_link, lk_padding_9);
931 }
932
933 static void
934 check_mdt_rec_unlink(void)
935 {
936         BLANK_LINE();
937         CHECK_STRUCT(mdt_rec_unlink);
938         CHECK_MEMBER(mdt_rec_unlink, ul_opcode);
939         CHECK_MEMBER(mdt_rec_unlink, ul_cap);
940         CHECK_MEMBER(mdt_rec_unlink, ul_fsuid);
941         CHECK_MEMBER(mdt_rec_unlink, ul_fsuid_h);
942         CHECK_MEMBER(mdt_rec_unlink, ul_fsgid);
943         CHECK_MEMBER(mdt_rec_unlink, ul_fsgid_h);
944         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid1);
945         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid1_h);
946         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid2);
947         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid2_h);
948         CHECK_MEMBER(mdt_rec_unlink, ul_fid1);
949         CHECK_MEMBER(mdt_rec_unlink, ul_fid2);
950         CHECK_MEMBER(mdt_rec_unlink, ul_time);
951         CHECK_MEMBER(mdt_rec_unlink, ul_padding_2);
952         CHECK_MEMBER(mdt_rec_unlink, ul_padding_3);
953         CHECK_MEMBER(mdt_rec_unlink, ul_padding_4);
954         CHECK_MEMBER(mdt_rec_unlink, ul_padding_5);
955         CHECK_MEMBER(mdt_rec_unlink, ul_bias);
956         CHECK_MEMBER(mdt_rec_unlink, ul_mode);
957         CHECK_MEMBER(mdt_rec_unlink, ul_padding_6);
958         CHECK_MEMBER(mdt_rec_unlink, ul_padding_7);
959         CHECK_MEMBER(mdt_rec_unlink, ul_padding_8);
960         CHECK_MEMBER(mdt_rec_unlink, ul_padding_9);
961 }
962
963 static void
964 check_mdt_rec_rename(void)
965 {
966         BLANK_LINE();
967         CHECK_STRUCT(mdt_rec_rename);
968         CHECK_MEMBER(mdt_rec_rename, rn_opcode);
969         CHECK_MEMBER(mdt_rec_rename, rn_cap);
970         CHECK_MEMBER(mdt_rec_rename, rn_fsuid);
971         CHECK_MEMBER(mdt_rec_rename, rn_fsuid_h);
972         CHECK_MEMBER(mdt_rec_rename, rn_fsgid);
973         CHECK_MEMBER(mdt_rec_rename, rn_fsgid_h);
974         CHECK_MEMBER(mdt_rec_rename, rn_suppgid1);
975         CHECK_MEMBER(mdt_rec_rename, rn_suppgid1_h);
976         CHECK_MEMBER(mdt_rec_rename, rn_suppgid2);
977         CHECK_MEMBER(mdt_rec_rename, rn_suppgid2_h);
978         CHECK_MEMBER(mdt_rec_rename, rn_fid1);
979         CHECK_MEMBER(mdt_rec_rename, rn_fid2);
980         CHECK_MEMBER(mdt_rec_rename, rn_time);
981         CHECK_MEMBER(mdt_rec_rename, rn_padding_1);
982         CHECK_MEMBER(mdt_rec_rename, rn_padding_2);
983         CHECK_MEMBER(mdt_rec_rename, rn_padding_3);
984         CHECK_MEMBER(mdt_rec_rename, rn_padding_4);
985         CHECK_MEMBER(mdt_rec_rename, rn_bias);
986         CHECK_MEMBER(mdt_rec_rename, rn_mode);
987         CHECK_MEMBER(mdt_rec_rename, rn_padding_5);
988         CHECK_MEMBER(mdt_rec_rename, rn_padding_6);
989         CHECK_MEMBER(mdt_rec_rename, rn_padding_7);
990         CHECK_MEMBER(mdt_rec_rename, rn_padding_8);
991 }
992
993 static void
994 check_mdt_rec_setxattr(void)
995 {
996         BLANK_LINE();
997         CHECK_STRUCT(mdt_rec_setxattr);
998         CHECK_MEMBER(mdt_rec_setxattr, sx_opcode);
999         CHECK_MEMBER(mdt_rec_setxattr, sx_cap);
1000         CHECK_MEMBER(mdt_rec_setxattr, sx_fsuid);
1001         CHECK_MEMBER(mdt_rec_setxattr, sx_fsuid_h);
1002         CHECK_MEMBER(mdt_rec_setxattr, sx_fsgid);
1003         CHECK_MEMBER(mdt_rec_setxattr, sx_fsgid_h);
1004         CHECK_MEMBER(mdt_rec_setxattr, sx_suppgid1);
1005         CHECK_MEMBER(mdt_rec_setxattr, sx_suppgid1_h);
1006         CHECK_MEMBER(mdt_rec_setxattr, sx_suppgid2);
1007         CHECK_MEMBER(mdt_rec_setxattr, sx_suppgid2_h);
1008         CHECK_MEMBER(mdt_rec_setxattr, sx_fid);
1009         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_1);
1010         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_2);
1011         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_3);
1012         CHECK_MEMBER(mdt_rec_setxattr, sx_valid);
1013         CHECK_MEMBER(mdt_rec_setxattr, sx_time);
1014         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_5);
1015         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_6);
1016         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_7);
1017         CHECK_MEMBER(mdt_rec_setxattr, sx_size);
1018         CHECK_MEMBER(mdt_rec_setxattr, sx_flags);
1019         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_8);
1020         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_9);
1021         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_10);
1022         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_11);
1023 }
1024
1025 static void
1026 check_mdt_rec_reint(void)
1027 {
1028         BLANK_LINE();
1029         CHECK_STRUCT(mdt_rec_reint);
1030         CHECK_MEMBER(mdt_rec_reint, rr_opcode);
1031         CHECK_MEMBER(mdt_rec_reint, rr_cap);
1032         CHECK_MEMBER(mdt_rec_reint, rr_fsuid);
1033         CHECK_MEMBER(mdt_rec_reint, rr_fsuid_h);
1034         CHECK_MEMBER(mdt_rec_reint, rr_fsgid);
1035         CHECK_MEMBER(mdt_rec_reint, rr_fsgid_h);
1036         CHECK_MEMBER(mdt_rec_reint, rr_suppgid1);
1037         CHECK_MEMBER(mdt_rec_reint, rr_suppgid1_h);
1038         CHECK_MEMBER(mdt_rec_reint, rr_suppgid2);
1039         CHECK_MEMBER(mdt_rec_reint, rr_suppgid2_h);
1040         CHECK_MEMBER(mdt_rec_reint, rr_fid1);
1041         CHECK_MEMBER(mdt_rec_reint, rr_fid2);
1042         CHECK_MEMBER(mdt_rec_reint, rr_mtime);
1043         CHECK_MEMBER(mdt_rec_reint, rr_atime);
1044         CHECK_MEMBER(mdt_rec_reint, rr_ctime);
1045         CHECK_MEMBER(mdt_rec_reint, rr_size);
1046         CHECK_MEMBER(mdt_rec_reint, rr_blocks);
1047         CHECK_MEMBER(mdt_rec_reint, rr_bias);
1048         CHECK_MEMBER(mdt_rec_reint, rr_mode);
1049         CHECK_MEMBER(mdt_rec_reint, rr_flags);
1050         CHECK_MEMBER(mdt_rec_reint, rr_padding_2);
1051         CHECK_MEMBER(mdt_rec_reint, rr_padding_3);
1052         CHECK_MEMBER(mdt_rec_reint, rr_padding_4);
1053 }
1054
1055 static void
1056 check_lmv_desc(void)
1057 {
1058         BLANK_LINE();
1059         CHECK_STRUCT(lmv_desc);
1060         CHECK_MEMBER(lmv_desc, ld_tgt_count);
1061         CHECK_MEMBER(lmv_desc, ld_active_tgt_count);
1062         CHECK_MEMBER(lmv_desc, ld_default_stripe_count);
1063         CHECK_MEMBER(lmv_desc, ld_pattern);
1064         CHECK_MEMBER(lmv_desc, ld_default_hash_size);
1065         CHECK_MEMBER(lmv_desc, ld_padding_1);
1066         CHECK_MEMBER(lmv_desc, ld_padding_2);
1067         CHECK_MEMBER(lmv_desc, ld_qos_maxage);
1068         CHECK_MEMBER(lmv_desc, ld_padding_3);
1069         CHECK_MEMBER(lmv_desc, ld_padding_4);
1070         CHECK_MEMBER(lmv_desc, ld_uuid);
1071 }
1072
1073 static void
1074 check_lmv_stripe_md(void)
1075 {
1076         BLANK_LINE();
1077         CHECK_STRUCT(lmv_stripe_md);
1078         CHECK_MEMBER(lmv_stripe_md, mea_magic);
1079         CHECK_MEMBER(lmv_stripe_md, mea_count);
1080         CHECK_MEMBER(lmv_stripe_md, mea_master);
1081         CHECK_MEMBER(lmv_stripe_md, mea_padding);
1082         CHECK_CVALUE(LOV_MAXPOOLNAME);
1083         CHECK_MEMBER(lmv_stripe_md, mea_pool_name[LOV_MAXPOOLNAME]);
1084         CHECK_MEMBER(lmv_stripe_md, mea_ids[0]);
1085 }
1086
1087 static void
1088 check_lov_desc(void)
1089 {
1090         BLANK_LINE();
1091         CHECK_STRUCT(lov_desc);
1092         CHECK_MEMBER(lov_desc, ld_tgt_count);
1093         CHECK_MEMBER(lov_desc, ld_active_tgt_count);
1094         CHECK_MEMBER(lov_desc, ld_default_stripe_count);
1095         CHECK_MEMBER(lov_desc, ld_pattern);
1096         CHECK_MEMBER(lov_desc, ld_default_stripe_size);
1097         CHECK_MEMBER(lov_desc, ld_default_stripe_offset);
1098         CHECK_MEMBER(lov_desc, ld_padding_0);
1099         CHECK_MEMBER(lov_desc, ld_qos_maxage);
1100         CHECK_MEMBER(lov_desc, ld_padding_1);
1101         CHECK_MEMBER(lov_desc, ld_padding_2);
1102         CHECK_MEMBER(lov_desc, ld_uuid);
1103
1104         CHECK_CDEFINE(LOV_DESC_MAGIC);
1105 }
1106
1107 static void
1108 check_ldlm_res_id(void)
1109 {
1110         BLANK_LINE();
1111         CHECK_STRUCT(ldlm_res_id);
1112         CHECK_CVALUE(RES_NAME_SIZE);
1113         CHECK_MEMBER(ldlm_res_id, name[RES_NAME_SIZE]);
1114 }
1115
1116 static void
1117 check_ldlm_extent(void)
1118 {
1119         BLANK_LINE();
1120         CHECK_STRUCT(ldlm_extent);
1121         CHECK_MEMBER(ldlm_extent, start);
1122         CHECK_MEMBER(ldlm_extent, end);
1123         CHECK_MEMBER(ldlm_extent, gid);
1124 }
1125
1126 static void
1127 check_ldlm_inodebits(void)
1128 {
1129         BLANK_LINE();
1130         CHECK_STRUCT(ldlm_inodebits);
1131         CHECK_MEMBER(ldlm_inodebits, bits);
1132 }
1133
1134 static void
1135 check_ldlm_flock(void)
1136 {
1137         BLANK_LINE();
1138         CHECK_STRUCT(ldlm_flock_wire);
1139         CHECK_MEMBER(ldlm_flock_wire, lfw_start);
1140         CHECK_MEMBER(ldlm_flock_wire, lfw_end);
1141         CHECK_MEMBER(ldlm_flock_wire, lfw_owner);
1142         CHECK_MEMBER(ldlm_flock_wire, lfw_padding);
1143         CHECK_MEMBER(ldlm_flock_wire, lfw_pid);
1144 }
1145
1146 static void
1147 check_ldlm_intent(void)
1148 {
1149         BLANK_LINE();
1150         CHECK_STRUCT(ldlm_intent);
1151         CHECK_MEMBER(ldlm_intent, opc);
1152 }
1153
1154 static void
1155 check_ldlm_resource_desc(void)
1156 {
1157         BLANK_LINE();
1158         CHECK_STRUCT(ldlm_resource_desc);
1159         CHECK_MEMBER(ldlm_resource_desc, lr_type);
1160         CHECK_MEMBER(ldlm_resource_desc, lr_padding);
1161         CHECK_MEMBER(ldlm_resource_desc, lr_name);
1162 }
1163
1164 static void
1165 check_ldlm_lock_desc(void)
1166 {
1167         BLANK_LINE();
1168         CHECK_STRUCT(ldlm_lock_desc);
1169         CHECK_MEMBER(ldlm_lock_desc, l_resource);
1170         CHECK_MEMBER(ldlm_lock_desc, l_req_mode);
1171         CHECK_MEMBER(ldlm_lock_desc, l_granted_mode);
1172         CHECK_MEMBER(ldlm_lock_desc, l_policy_data);
1173 }
1174
1175 static void
1176 check_ldlm_request(void)
1177 {
1178         BLANK_LINE();
1179         CHECK_STRUCT(ldlm_request);
1180         CHECK_MEMBER(ldlm_request, lock_flags);
1181         CHECK_MEMBER(ldlm_request, lock_count);
1182         CHECK_MEMBER(ldlm_request, lock_desc);
1183         CHECK_MEMBER(ldlm_request, lock_handle);
1184 }
1185
1186 static void
1187 check_ldlm_reply(void)
1188 {
1189         BLANK_LINE();
1190         CHECK_STRUCT(ldlm_reply);
1191         CHECK_MEMBER(ldlm_reply, lock_flags);
1192         CHECK_MEMBER(ldlm_reply, lock_padding);
1193         CHECK_MEMBER(ldlm_reply, lock_desc);
1194         CHECK_MEMBER(ldlm_reply, lock_handle);
1195         CHECK_MEMBER(ldlm_reply, lock_policy_res1);
1196         CHECK_MEMBER(ldlm_reply, lock_policy_res2);
1197 }
1198
1199 static void
1200 check_ldlm_lvb(void)
1201 {
1202         BLANK_LINE();
1203         CHECK_STRUCT(ost_lvb);
1204         CHECK_MEMBER(ost_lvb, lvb_size);
1205         CHECK_MEMBER(ost_lvb, lvb_mtime);
1206         CHECK_MEMBER(ost_lvb, lvb_atime);
1207         CHECK_MEMBER(ost_lvb, lvb_ctime);
1208         CHECK_MEMBER(ost_lvb, lvb_blocks);
1209 }
1210
1211 static void
1212 check_mgs_send_param(void)
1213 {
1214         BLANK_LINE();
1215         CHECK_STRUCT(mgs_send_param);
1216         CHECK_CVALUE(MGS_PARAM_MAXLEN);
1217         CHECK_MEMBER(mgs_send_param, mgs_param[MGS_PARAM_MAXLEN]);
1218 }
1219
1220 static void
1221 check_cfg_marker(void)
1222 {
1223         BLANK_LINE();
1224         CHECK_STRUCT(cfg_marker);
1225         CHECK_MEMBER(cfg_marker, cm_step);
1226         CHECK_MEMBER(cfg_marker, cm_flags);
1227         CHECK_MEMBER(cfg_marker, cm_vers);
1228         CHECK_MEMBER(cfg_marker, cm_padding);
1229         CHECK_MEMBER(cfg_marker, cm_createtime);
1230         CHECK_MEMBER(cfg_marker, cm_canceltime);
1231         CHECK_MEMBER(cfg_marker, cm_tgtname);
1232         CHECK_MEMBER(cfg_marker, cm_comment);
1233 }
1234
1235 static void
1236 check_llog_logid(void)
1237 {
1238         BLANK_LINE();
1239         CHECK_STRUCT(llog_logid);
1240         CHECK_MEMBER(llog_logid, lgl_oid);
1241         CHECK_MEMBER(llog_logid, lgl_oseq);
1242         CHECK_MEMBER(llog_logid, lgl_ogen);
1243
1244         CHECK_CVALUE(OST_SZ_REC);
1245         CHECK_CVALUE(OST_RAID1_REC);
1246         CHECK_CVALUE(MDS_UNLINK_REC);
1247         CHECK_CVALUE(MDS_SETATTR_REC);
1248         CHECK_CVALUE(OBD_CFG_REC);
1249         CHECK_CVALUE(PTL_CFG_REC);
1250         CHECK_CVALUE(LLOG_GEN_REC);
1251         CHECK_CVALUE(LLOG_JOIN_REC);
1252         CHECK_CVALUE(LLOG_HDR_MAGIC);
1253         CHECK_CVALUE(LLOG_LOGID_MAGIC);
1254 }
1255
1256 static void
1257 check_llog_catid(void)
1258 {
1259         BLANK_LINE();
1260         CHECK_STRUCT(llog_catid);
1261         CHECK_MEMBER(llog_catid, lci_logid);
1262         CHECK_MEMBER(llog_catid, lci_padding1);
1263         CHECK_MEMBER(llog_catid, lci_padding2);
1264         CHECK_MEMBER(llog_catid, lci_padding3);
1265 }
1266
1267 static void
1268 check_llog_rec_hdr(void)
1269 {
1270         BLANK_LINE();
1271         CHECK_STRUCT(llog_rec_hdr);
1272         CHECK_MEMBER(llog_rec_hdr, lrh_len);
1273         CHECK_MEMBER(llog_rec_hdr, lrh_index);
1274         CHECK_MEMBER(llog_rec_hdr, lrh_type);
1275         CHECK_MEMBER(llog_rec_hdr, lrh_padding);
1276 }
1277
1278 static void
1279 check_llog_rec_tail(void)
1280 {
1281         BLANK_LINE();
1282         CHECK_STRUCT(llog_rec_tail);
1283         CHECK_MEMBER(llog_rec_tail, lrt_len);
1284         CHECK_MEMBER(llog_rec_tail, lrt_index);
1285 }
1286
1287 static void
1288 check_llog_logid_rec(void)
1289 {
1290         BLANK_LINE();
1291         CHECK_STRUCT(llog_logid_rec);
1292         CHECK_MEMBER(llog_logid_rec, lid_hdr);
1293         CHECK_MEMBER(llog_logid_rec, lid_id);
1294         CHECK_MEMBER(llog_logid_rec, lid_padding1);
1295         CHECK_MEMBER(llog_logid_rec, lid_padding2);
1296         CHECK_MEMBER(llog_logid_rec, lid_padding3);
1297         CHECK_MEMBER(llog_logid_rec, lid_padding4);
1298         CHECK_MEMBER(llog_logid_rec, lid_padding5);
1299         CHECK_MEMBER(llog_logid_rec, lid_tail);
1300 }
1301
1302 static void
1303 check_llog_create_rec(void)
1304 {
1305         BLANK_LINE();
1306         CHECK_STRUCT(llog_create_rec);
1307         CHECK_MEMBER(llog_create_rec, lcr_hdr);
1308         CHECK_MEMBER(llog_create_rec, lcr_fid);
1309         CHECK_MEMBER(llog_create_rec, lcr_oid);
1310         CHECK_MEMBER(llog_create_rec, lcr_oseq);
1311         CHECK_MEMBER(llog_create_rec, lcr_padding);
1312         CHECK_MEMBER(llog_create_rec, lcr_tail);
1313 }
1314
1315 static void
1316 check_llog_orphan_rec(void)
1317 {
1318         BLANK_LINE();
1319         CHECK_STRUCT(llog_orphan_rec);
1320         CHECK_MEMBER(llog_orphan_rec, lor_hdr);
1321         CHECK_MEMBER(llog_orphan_rec, lor_oid);
1322         CHECK_MEMBER(llog_orphan_rec, lor_ogen);
1323         CHECK_MEMBER(llog_orphan_rec, lor_padding);
1324         CHECK_MEMBER(llog_orphan_rec, lor_tail);
1325 }
1326
1327 static void
1328 check_llog_unlink_rec(void)
1329 {
1330         BLANK_LINE();
1331         CHECK_STRUCT(llog_unlink_rec);
1332         CHECK_MEMBER(llog_unlink_rec, lur_hdr);
1333         CHECK_MEMBER(llog_unlink_rec, lur_oid);
1334         CHECK_MEMBER(llog_unlink_rec, lur_oseq);
1335         CHECK_MEMBER(llog_unlink_rec, lur_count);
1336         CHECK_MEMBER(llog_unlink_rec, lur_tail);
1337 }
1338
1339 static void
1340 check_llog_setattr_rec(void)
1341 {
1342         BLANK_LINE();
1343         CHECK_STRUCT(llog_setattr_rec);
1344         CHECK_MEMBER(llog_setattr_rec, lsr_hdr);
1345         CHECK_MEMBER(llog_setattr_rec, lsr_oid);
1346         CHECK_MEMBER(llog_setattr_rec, lsr_oseq);
1347         CHECK_MEMBER(llog_setattr_rec, lsr_uid);
1348         CHECK_MEMBER(llog_setattr_rec, lsr_gid);
1349         CHECK_MEMBER(llog_setattr_rec, lsr_padding);
1350         CHECK_MEMBER(llog_setattr_rec, lsr_tail);
1351 }
1352
1353 static void
1354 check_llog_setattr64_rec(void)
1355 {
1356         BLANK_LINE();
1357         CHECK_STRUCT(llog_setattr64_rec);
1358         CHECK_MEMBER(llog_setattr64_rec, lsr_hdr);
1359         CHECK_MEMBER(llog_setattr64_rec, lsr_oid);
1360         CHECK_MEMBER(llog_setattr64_rec, lsr_oseq);
1361         CHECK_MEMBER(llog_setattr64_rec, lsr_padding);
1362         CHECK_MEMBER(llog_setattr64_rec, lsr_uid);
1363         CHECK_MEMBER(llog_setattr64_rec, lsr_uid_h);
1364         CHECK_MEMBER(llog_setattr64_rec, lsr_gid);
1365         CHECK_MEMBER(llog_setattr64_rec, lsr_gid_h);
1366         CHECK_MEMBER(llog_setattr64_rec, lsr_tail);
1367 }
1368
1369 static void
1370 check_llog_size_change_rec(void)
1371 {
1372         BLANK_LINE();
1373         CHECK_STRUCT(llog_size_change_rec);
1374         CHECK_MEMBER(llog_size_change_rec, lsc_hdr);
1375         CHECK_MEMBER(llog_size_change_rec, lsc_fid);
1376         CHECK_MEMBER(llog_size_change_rec, lsc_ioepoch);
1377         CHECK_MEMBER(llog_size_change_rec, lsc_padding);
1378         CHECK_MEMBER(llog_size_change_rec, lsc_tail);
1379 }
1380
1381 static void
1382 check_changelog_rec(void)
1383 {
1384         BLANK_LINE();
1385         CHECK_STRUCT(changelog_rec);
1386         CHECK_MEMBER(changelog_rec, cr_namelen);
1387         CHECK_MEMBER(changelog_rec, cr_flags);
1388         CHECK_MEMBER(changelog_rec, cr_type);
1389         CHECK_MEMBER(changelog_rec, cr_index);
1390         CHECK_MEMBER(changelog_rec, cr_prev);
1391         CHECK_MEMBER(changelog_rec, cr_time);
1392         CHECK_MEMBER(changelog_rec, cr_tfid);
1393         CHECK_MEMBER(changelog_rec, cr_pfid);
1394 }
1395
1396 static void
1397 check_changelog_setinfo(void)
1398 {
1399         BLANK_LINE();
1400         CHECK_STRUCT(changelog_setinfo);
1401         CHECK_MEMBER(changelog_setinfo, cs_recno);
1402         CHECK_MEMBER(changelog_setinfo, cs_id);
1403 }
1404
1405 static void
1406 check_llog_changelog_rec(void)
1407 {
1408         BLANK_LINE();
1409         CHECK_STRUCT(llog_changelog_rec);
1410         CHECK_MEMBER(llog_changelog_rec, cr_hdr);
1411         CHECK_MEMBER(llog_changelog_rec, cr);
1412         CHECK_MEMBER(llog_changelog_rec, cr_tail);
1413 }
1414
1415 static void
1416 check_llog_changelog_user_rec(void)
1417 {
1418         BLANK_LINE();
1419         CHECK_STRUCT(llog_changelog_user_rec);
1420         CHECK_MEMBER(llog_changelog_user_rec, cur_hdr);
1421         CHECK_MEMBER(llog_changelog_user_rec, cur_id);
1422         CHECK_MEMBER(llog_changelog_user_rec, cur_padding);
1423         CHECK_MEMBER(llog_changelog_user_rec, cur_endrec);
1424         CHECK_MEMBER(llog_changelog_user_rec, cur_tail);
1425 }
1426
1427 static void
1428 check_llog_gen(void)
1429 {
1430         BLANK_LINE();
1431         CHECK_STRUCT(llog_gen);
1432         CHECK_MEMBER(llog_gen, mnt_cnt);
1433         CHECK_MEMBER(llog_gen, conn_cnt);
1434 }
1435
1436 static void
1437 check_llog_gen_rec(void)
1438 {
1439         BLANK_LINE();
1440         CHECK_STRUCT(llog_gen_rec);
1441         CHECK_MEMBER(llog_gen_rec, lgr_hdr);
1442         CHECK_MEMBER(llog_gen_rec, lgr_gen);
1443         CHECK_MEMBER(llog_gen_rec, lgr_tail);
1444 }
1445
1446 static void
1447 check_llog_log_hdr(void)
1448 {
1449         BLANK_LINE();
1450         CHECK_STRUCT(llog_log_hdr);
1451         CHECK_MEMBER(llog_log_hdr, llh_hdr);
1452         CHECK_MEMBER(llog_log_hdr, llh_timestamp);
1453         CHECK_MEMBER(llog_log_hdr, llh_count);
1454         CHECK_MEMBER(llog_log_hdr, llh_bitmap_offset);
1455         CHECK_MEMBER(llog_log_hdr, llh_size);
1456         CHECK_MEMBER(llog_log_hdr, llh_flags);
1457         CHECK_MEMBER(llog_log_hdr, llh_cat_idx);
1458         CHECK_MEMBER(llog_log_hdr, llh_tgtuuid);
1459         CHECK_MEMBER(llog_log_hdr, llh_reserved);
1460         CHECK_MEMBER(llog_log_hdr, llh_bitmap);
1461         CHECK_MEMBER(llog_log_hdr, llh_tail);
1462 }
1463
1464 static void
1465 check_llog_cookie(void)
1466 {
1467         BLANK_LINE();
1468         CHECK_STRUCT(llog_cookie);
1469         CHECK_MEMBER(llog_cookie, lgc_lgl);
1470         CHECK_MEMBER(llog_cookie, lgc_subsys);
1471         CHECK_MEMBER(llog_cookie, lgc_index);
1472         CHECK_MEMBER(llog_cookie, lgc_padding);
1473 }
1474
1475 static void
1476 check_llogd_body(void)
1477 {
1478         BLANK_LINE();
1479         CHECK_STRUCT(llogd_body);
1480         CHECK_MEMBER(llogd_body, lgd_logid);
1481         CHECK_MEMBER(llogd_body, lgd_ctxt_idx);
1482         CHECK_MEMBER(llogd_body, lgd_llh_flags);
1483         CHECK_MEMBER(llogd_body, lgd_index);
1484         CHECK_MEMBER(llogd_body, lgd_saved_index);
1485         CHECK_MEMBER(llogd_body, lgd_len);
1486         CHECK_MEMBER(llogd_body, lgd_cur_offset);
1487
1488         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_CREATE);
1489         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
1490         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_READ_HEADER);
1491         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_WRITE_REC);
1492         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_CLOSE);
1493         CHECK_CVALUE(LLOG_ORIGIN_CONNECT);
1494         CHECK_CVALUE(LLOG_CATINFO);
1495         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_PREV_BLOCK);
1496         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_DESTROY);
1497         CHECK_CVALUE(LLOG_FIRST_OPC);
1498         CHECK_CVALUE(LLOG_LAST_OPC);
1499 }
1500
1501 static void
1502 check_llogd_conn_body(void)
1503 {
1504         BLANK_LINE();
1505         CHECK_STRUCT(llogd_conn_body);
1506         CHECK_MEMBER(llogd_conn_body, lgdc_gen);
1507         CHECK_MEMBER(llogd_conn_body, lgdc_logid);
1508         CHECK_MEMBER(llogd_conn_body, lgdc_ctxt_idx);
1509 }
1510
1511 static void
1512 check_ll_fiemap_info_key(void)
1513 {
1514         BLANK_LINE();
1515         CHECK_STRUCT(ll_fiemap_info_key);
1516         CHECK_MEMBER(ll_fiemap_info_key, name[8]);
1517         CHECK_MEMBER(ll_fiemap_info_key, oa);
1518         CHECK_MEMBER(ll_fiemap_info_key, fiemap);
1519 }
1520
1521 static void
1522 check_qunit_data(void)
1523 {
1524         BLANK_LINE();
1525         CHECK_STRUCT(qunit_data);
1526         CHECK_MEMBER(qunit_data, qd_id);
1527         CHECK_MEMBER(qunit_data, qd_flags);
1528         CHECK_MEMBER(qunit_data, qd_count);
1529         CHECK_MEMBER(qunit_data, qd_qunit);
1530         CHECK_MEMBER(qunit_data, padding);
1531 }
1532
1533 static void
1534 check_mgs_target_info(void)
1535 {
1536         BLANK_LINE();
1537         CHECK_STRUCT(mgs_target_info);
1538         CHECK_MEMBER(mgs_target_info, mti_lustre_ver);
1539         CHECK_MEMBER(mgs_target_info, mti_stripe_index);
1540         CHECK_MEMBER(mgs_target_info, mti_config_ver);
1541         CHECK_MEMBER(mgs_target_info, mti_flags);
1542         CHECK_MEMBER(mgs_target_info, mti_nid_count);
1543         CHECK_MEMBER(mgs_target_info, mti_instance);
1544         CHECK_MEMBER(mgs_target_info, mti_fsname);
1545         CHECK_MEMBER(mgs_target_info, mti_svname);
1546         CHECK_MEMBER(mgs_target_info, mti_uuid);
1547         CHECK_MEMBER(mgs_target_info, mti_nids);
1548         CHECK_MEMBER(mgs_target_info, mti_params);
1549 }
1550
1551 static void
1552 check_lustre_capa(void)
1553 {
1554         BLANK_LINE();
1555         CHECK_STRUCT(lustre_capa);
1556         CHECK_MEMBER(lustre_capa, lc_fid);
1557         CHECK_MEMBER(lustre_capa, lc_opc);
1558         CHECK_MEMBER(lustre_capa, lc_uid);
1559         CHECK_MEMBER(lustre_capa, lc_gid);
1560         CHECK_MEMBER(lustre_capa, lc_flags);
1561         CHECK_MEMBER(lustre_capa, lc_keyid);
1562         CHECK_MEMBER(lustre_capa, lc_timeout);
1563         CHECK_MEMBER(lustre_capa, lc_expiry);
1564         CHECK_CVALUE(CAPA_HMAC_MAX_LEN);
1565         CHECK_MEMBER(lustre_capa, lc_hmac[CAPA_HMAC_MAX_LEN]);
1566 }
1567
1568 static void
1569 check_lustre_capa_key(void)
1570 {
1571         BLANK_LINE();
1572         CHECK_STRUCT(lustre_capa_key);
1573         CHECK_MEMBER(lustre_capa_key, lk_seq);
1574         CHECK_MEMBER(lustre_capa_key, lk_keyid);
1575         CHECK_MEMBER(lustre_capa_key, lk_padding);
1576         CHECK_CVALUE(CAPA_HMAC_KEY_MAX_LEN);
1577         CHECK_MEMBER(lustre_capa_key, lk_key[CAPA_HMAC_KEY_MAX_LEN]);
1578 }
1579
1580 static void
1581 check_getinfo_fid2path(void)
1582 {
1583         BLANK_LINE();
1584         CHECK_STRUCT(getinfo_fid2path);
1585         CHECK_MEMBER(getinfo_fid2path, gf_fid);
1586         CHECK_MEMBER(getinfo_fid2path, gf_recno);
1587         CHECK_MEMBER(getinfo_fid2path, gf_linkno);
1588         CHECK_MEMBER(getinfo_fid2path, gf_pathlen);
1589         CHECK_MEMBER(getinfo_fid2path, gf_path[0]);
1590 }
1591
1592 static void
1593 check_lustre_disk_data(void)
1594 {
1595         BLANK_LINE();
1596         CHECK_STRUCT(lustre_disk_data);
1597         CHECK_MEMBER(lustre_disk_data, ldd_magic);
1598         CHECK_MEMBER(lustre_disk_data, ldd_feature_compat);
1599         CHECK_MEMBER(lustre_disk_data, ldd_feature_rocompat);
1600         CHECK_MEMBER(lustre_disk_data, ldd_feature_incompat);
1601         CHECK_MEMBER(lustre_disk_data, ldd_config_ver);
1602         CHECK_MEMBER(lustre_disk_data, ldd_flags);
1603         CHECK_MEMBER(lustre_disk_data, ldd_svindex);
1604         CHECK_MEMBER(lustre_disk_data, ldd_mount_type);
1605         CHECK_MEMBER(lustre_disk_data, ldd_fsname);
1606         CHECK_MEMBER(lustre_disk_data, ldd_svname);
1607         CHECK_MEMBER(lustre_disk_data, ldd_uuid);
1608         CHECK_MEMBER(lustre_disk_data, ldd_userdata);
1609         CHECK_MEMBER(lustre_disk_data, ldd_mount_opts);
1610         CHECK_MEMBER(lustre_disk_data, ldd_params);
1611 }
1612
1613 static void
1614 check_posix_acl_xattr_entry(void)
1615 {
1616         BLANK_LINE();
1617         CHECK_STRUCT_TYPEDEF(posix_acl_xattr_entry);
1618         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_tag);
1619         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_perm);
1620         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_id);
1621 }
1622
1623 static void
1624 check_posix_acl_xattr_header(void)
1625 {
1626         BLANK_LINE();
1627         CHECK_STRUCT_TYPEDEF(posix_acl_xattr_header);
1628         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_version);
1629         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_entries);
1630 }
1631
1632 static void
1633 check_quota_adjust_qunit(void)
1634 {
1635         BLANK_LINE();
1636         CHECK_STRUCT(quota_adjust_qunit);
1637         CHECK_MEMBER(quota_adjust_qunit, qaq_flags);
1638         CHECK_MEMBER(quota_adjust_qunit, qaq_id);
1639         CHECK_MEMBER(quota_adjust_qunit, qaq_bunit_sz);
1640         CHECK_MEMBER(quota_adjust_qunit, qaq_iunit_sz);
1641         CHECK_MEMBER(quota_adjust_qunit, padding1);
1642 }
1643
1644 static void
1645 check_ll_user_fiemap(void)
1646 {
1647         BLANK_LINE();
1648         CHECK_STRUCT(ll_user_fiemap);
1649         CHECK_MEMBER(ll_user_fiemap, fm_start);
1650         CHECK_MEMBER(ll_user_fiemap, fm_length);
1651         CHECK_MEMBER(ll_user_fiemap, fm_flags);
1652         CHECK_MEMBER(ll_user_fiemap, fm_mapped_extents);
1653         CHECK_MEMBER(ll_user_fiemap, fm_extent_count);
1654         CHECK_MEMBER(ll_user_fiemap, fm_reserved);
1655         CHECK_MEMBER(ll_user_fiemap, fm_extents);
1656
1657         CHECK_CDEFINE(FIEMAP_FLAG_SYNC);
1658         CHECK_CDEFINE(FIEMAP_FLAG_XATTR);
1659         CHECK_CDEFINE(FIEMAP_FLAG_DEVICE_ORDER);
1660 }
1661
1662 static void
1663 check_ll_fiemap_extent(void)
1664 {
1665         BLANK_LINE();
1666         CHECK_STRUCT(ll_fiemap_extent);
1667         CHECK_MEMBER(ll_fiemap_extent, fe_logical);
1668         CHECK_MEMBER(ll_fiemap_extent, fe_physical);
1669         CHECK_MEMBER(ll_fiemap_extent, fe_length);
1670         CHECK_MEMBER(ll_fiemap_extent, fe_flags);
1671         CHECK_MEMBER(ll_fiemap_extent, fe_device);
1672
1673         CHECK_CDEFINE(FIEMAP_EXTENT_LAST);
1674         CHECK_CDEFINE(FIEMAP_EXTENT_UNKNOWN);
1675         CHECK_CDEFINE(FIEMAP_EXTENT_DELALLOC);
1676         CHECK_CDEFINE(FIEMAP_EXTENT_ENCODED);
1677         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_ENCRYPTED);
1678         CHECK_CDEFINE(FIEMAP_EXTENT_NOT_ALIGNED);
1679         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_INLINE);
1680         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_TAIL);
1681         CHECK_CDEFINE(FIEMAP_EXTENT_UNWRITTEN);
1682         CHECK_CDEFINE(FIEMAP_EXTENT_MERGED);
1683         CHECK_CDEFINE(FIEMAP_EXTENT_NO_DIRECT);
1684         CHECK_CDEFINE(FIEMAP_EXTENT_NET);
1685 }
1686
1687 static void
1688 check_link_ea_header(void)
1689 {
1690         BLANK_LINE();
1691         CHECK_STRUCT(link_ea_header);
1692         CHECK_MEMBER(link_ea_header, leh_magic);
1693         CHECK_MEMBER(link_ea_header, leh_reccount);
1694         CHECK_MEMBER(link_ea_header, leh_len);
1695         CHECK_MEMBER(link_ea_header, padding1);
1696         CHECK_MEMBER(link_ea_header, padding2);
1697
1698         CHECK_CDEFINE(LINK_EA_MAGIC);
1699 }
1700
1701 static void
1702 check_link_ea_entry(void)
1703 {
1704         BLANK_LINE();
1705         CHECK_STRUCT(link_ea_entry);
1706         CHECK_MEMBER(link_ea_entry, lee_reclen);
1707         CHECK_MEMBER(link_ea_entry, lee_parent_fid);
1708         CHECK_MEMBER(link_ea_entry, lee_name);
1709 }
1710
1711 static void
1712 check_hsm_user_item(void)
1713 {
1714         BLANK_LINE();
1715         CHECK_STRUCT(hsm_user_item);
1716         CHECK_MEMBER(hsm_user_item, hui_fid);
1717         CHECK_MEMBER(hsm_user_item, hui_extent);
1718 }
1719
1720 static void
1721 check_hsm_user_request(void)
1722 {
1723         BLANK_LINE();
1724         CHECK_STRUCT(hsm_user_request);
1725         CHECK_MEMBER(hsm_user_request, hur_action);
1726         CHECK_MEMBER(hsm_user_request, hur_archive_num);
1727         CHECK_MEMBER(hsm_user_request, hur_itemcount);
1728         CHECK_MEMBER(hsm_user_request, hur_data_len);
1729 }
1730
1731 static void
1732 check_hsm_user_state(void)
1733 {
1734         BLANK_LINE();
1735         CHECK_STRUCT(hsm_user_state);
1736         CHECK_MEMBER(hsm_user_state, hus_states);
1737         CHECK_MEMBER(hsm_user_state, hus_archive_num);
1738         CHECK_MEMBER(hsm_user_state, hus_in_progress_state);
1739         CHECK_MEMBER(hsm_user_state, hus_in_progress_action);
1740         CHECK_MEMBER(hsm_user_state, hus_in_progress_location);
1741 }
1742
1743 static void
1744 system_string (char *cmdline, char *str, int len)
1745 {
1746         int   fds[2];
1747         int   rc;
1748         pid_t pid;
1749
1750         rc = pipe(fds);
1751         if (rc != 0)
1752                 abort();
1753
1754         pid = fork();
1755         if (pid == 0) {
1756                 /* child */
1757                 int   fd = fileno(stdout);
1758
1759                 rc = dup2(fds[1], fd);
1760                 if (rc != fd)
1761                         abort();
1762
1763                 exit(system(cmdline));
1764                 /* notreached */
1765         } else if ((int)pid < 0) {
1766                 abort();
1767         } else {
1768                 FILE *f = fdopen(fds[0], "r");
1769
1770                 if (f == NULL)
1771                         abort();
1772
1773                 close(fds[1]);
1774
1775                 if (fgets(str, len, f) == NULL)
1776                         abort();
1777
1778                 if (waitpid(pid, &rc, 0) != pid)
1779                         abort();
1780
1781                 if (!WIFEXITED(rc) || WEXITSTATUS(rc) != 0)
1782                         abort();
1783
1784                 if (strnlen(str, len) == len)
1785                         str[len - 1] = 0;
1786
1787                 if (str[strlen(str) - 1] == '\n')
1788                         str[strlen(str) - 1] = 0;
1789
1790                 fclose(f);
1791         }
1792 }
1793
1794 int
1795 main(int argc, char **argv)
1796 {
1797         char unameinfo[80];
1798         char gccinfo[80];
1799
1800         system_string("uname -a", unameinfo, sizeof(unameinfo));
1801         system_string(CC " -v 2>&1 | tail -1", gccinfo, sizeof(gccinfo));
1802
1803         printf ("void lustre_assert_wire_constants(void)\n"
1804                 "{\n"
1805                 "        /* Wire protocol assertions generated by 'wirecheck'\n"
1806                 "         * (make -C lustre/utils newwiretest)\n"
1807                 "         * running on %s\n"
1808                 "         * with %s */\n"
1809                 "\n", unameinfo, gccinfo);
1810
1811         BLANK_LINE ();
1812
1813         COMMENT("Constants...");
1814         CHECK_VALUE(PTL_RPC_MSG_REQUEST);
1815         CHECK_VALUE(PTL_RPC_MSG_ERR);
1816         CHECK_VALUE(PTL_RPC_MSG_REPLY);
1817
1818         CHECK_DEFINE_64X(MDS_DIR_END_OFF);
1819
1820         CHECK_DEFINE_64X(DEAD_HANDLE_MAGIC);
1821
1822         CHECK_CVALUE(MTI_NAME_MAXLEN);
1823
1824         CHECK_VALUE(OST_REPLY);
1825         CHECK_VALUE(OST_GETATTR);
1826         CHECK_VALUE(OST_SETATTR);
1827         CHECK_VALUE(OST_READ);
1828         CHECK_VALUE(OST_WRITE);
1829         CHECK_VALUE(OST_CREATE);
1830         CHECK_VALUE(OST_DESTROY);
1831         CHECK_VALUE(OST_GET_INFO);
1832         CHECK_VALUE(OST_CONNECT);
1833         CHECK_VALUE(OST_DISCONNECT);
1834         CHECK_VALUE(OST_PUNCH);
1835         CHECK_VALUE(OST_OPEN);
1836         CHECK_VALUE(OST_CLOSE);
1837         CHECK_VALUE(OST_STATFS);
1838         CHECK_VALUE(OST_SYNC);
1839         CHECK_VALUE(OST_SET_INFO);
1840         CHECK_VALUE(OST_QUOTACHECK);
1841         CHECK_VALUE(OST_QUOTACTL);
1842         CHECK_VALUE(OST_QUOTA_ADJUST_QUNIT);
1843         CHECK_VALUE(OST_LAST_OPC);
1844
1845         CHECK_DEFINE_64X(OBD_OBJECT_EOF);
1846
1847         CHECK_VALUE(OST_MIN_PRECREATE);
1848         CHECK_VALUE(OST_MAX_PRECREATE);
1849
1850         CHECK_DEFINE_64X(OST_LVB_ERR_INIT);
1851         CHECK_DEFINE_64X(OST_LVB_ERR_MASK);
1852
1853         CHECK_VALUE(MDS_FIRST_OPC);
1854         CHECK_VALUE(MDS_GETATTR);
1855         CHECK_VALUE(MDS_GETATTR_NAME);
1856         CHECK_VALUE(MDS_CLOSE);
1857         CHECK_VALUE(MDS_REINT);
1858         CHECK_VALUE(MDS_READPAGE);
1859         CHECK_VALUE(MDS_CONNECT);
1860         CHECK_VALUE(MDS_DISCONNECT);
1861         CHECK_VALUE(MDS_GETSTATUS);
1862         CHECK_VALUE(MDS_STATFS);
1863         CHECK_VALUE(MDS_PIN);
1864         CHECK_VALUE(MDS_UNPIN);
1865         CHECK_VALUE(MDS_SYNC);
1866         CHECK_VALUE(MDS_DONE_WRITING);
1867         CHECK_VALUE(MDS_SET_INFO);
1868         CHECK_VALUE(MDS_QUOTACHECK);
1869         CHECK_VALUE(MDS_QUOTACTL);
1870         CHECK_VALUE(MDS_GETXATTR);
1871         CHECK_VALUE(MDS_SETXATTR);
1872         CHECK_VALUE(MDS_WRITEPAGE);
1873         CHECK_VALUE(MDS_IS_SUBDIR);
1874         CHECK_VALUE(MDS_GET_INFO);
1875         CHECK_VALUE(MDS_LAST_OPC);
1876
1877         CHECK_VALUE(REINT_SETATTR);
1878         CHECK_VALUE(REINT_CREATE);
1879         CHECK_VALUE(REINT_LINK);
1880         CHECK_VALUE(REINT_UNLINK);
1881         CHECK_VALUE(REINT_RENAME);
1882         CHECK_VALUE(REINT_OPEN);
1883         CHECK_VALUE(REINT_SETXATTR);
1884         CHECK_VALUE(REINT_MAX);
1885
1886         CHECK_VALUE_X(DISP_IT_EXECD);
1887         CHECK_VALUE_X(DISP_LOOKUP_EXECD);
1888         CHECK_VALUE_X(DISP_LOOKUP_NEG);
1889         CHECK_VALUE_X(DISP_LOOKUP_POS);
1890         CHECK_VALUE_X(DISP_OPEN_CREATE);
1891         CHECK_VALUE_X(DISP_OPEN_OPEN);
1892         CHECK_VALUE_X(DISP_ENQ_COMPLETE);
1893         CHECK_VALUE_X(DISP_ENQ_OPEN_REF);
1894         CHECK_VALUE_X(DISP_ENQ_CREATE_REF);
1895         CHECK_VALUE_X(DISP_OPEN_LOCK);
1896
1897         CHECK_VALUE(MDS_STATUS_CONN);
1898         CHECK_VALUE(MDS_STATUS_LOV);
1899
1900         CHECK_VALUE(LUSTRE_BFLAG_UNCOMMITTED_WRITES);
1901
1902         CHECK_VALUE_X(MF_SOM_CHANGE);
1903         CHECK_VALUE_X(MF_EPOCH_OPEN);
1904         CHECK_VALUE_X(MF_EPOCH_CLOSE);
1905         CHECK_VALUE_X(MF_MDC_CANCEL_FID1);
1906         CHECK_VALUE_X(MF_MDC_CANCEL_FID2);
1907         CHECK_VALUE_X(MF_MDC_CANCEL_FID3);
1908         CHECK_VALUE_X(MF_MDC_CANCEL_FID4);
1909         CHECK_VALUE_X(MF_SOM_AU);
1910         CHECK_VALUE_X(MF_GETATTR_LOCK);
1911
1912         CHECK_VALUE(LQUOTA_FLAGS_GRP);
1913         CHECK_VALUE(LQUOTA_FLAGS_BLK);
1914         CHECK_VALUE(LQUOTA_FLAGS_ADJBLK);
1915         CHECK_VALUE(LQUOTA_FLAGS_ADJINO);
1916         CHECK_VALUE(LQUOTA_FLAGS_CHG_QS);
1917         CHECK_VALUE(LQUOTA_FLAGS_RECOVERY);
1918         CHECK_VALUE(LQUOTA_FLAGS_SETQUOTA);
1919
1920         CHECK_VALUE_X(LQUOTA_QAQ_CREATE_LQS);
1921
1922         CHECK_VALUE_64X(MDS_ATTR_MODE);
1923         CHECK_VALUE_64X(MDS_ATTR_UID);
1924         CHECK_VALUE_64X(MDS_ATTR_GID);
1925         CHECK_VALUE_64X(MDS_ATTR_SIZE);
1926         CHECK_VALUE_64X(MDS_ATTR_ATIME);
1927         CHECK_VALUE_64X(MDS_ATTR_MTIME);
1928         CHECK_VALUE_64X(MDS_ATTR_CTIME);
1929         CHECK_VALUE_64X(MDS_ATTR_ATIME_SET);
1930         CHECK_VALUE_64X(MDS_ATTR_MTIME_SET);
1931         CHECK_VALUE_64X(MDS_ATTR_FORCE);
1932         CHECK_VALUE_64X(MDS_ATTR_ATTR_FLAG);
1933         CHECK_VALUE_64X(MDS_ATTR_KILL_SUID);
1934         CHECK_VALUE_64X(MDS_ATTR_KILL_SGID);
1935         CHECK_VALUE_64X(MDS_ATTR_CTIME_SET);
1936         CHECK_VALUE_64X(MDS_ATTR_FROM_OPEN);
1937         CHECK_VALUE_64X(MDS_ATTR_BLOCKS);
1938
1939         CHECK_VALUE(FLD_QUERY);
1940         CHECK_VALUE(FLD_FIRST_OPC);
1941         CHECK_VALUE(FLD_LAST_OPC);
1942
1943         CHECK_VALUE(SEQ_QUERY);
1944         CHECK_VALUE(SEQ_FIRST_OPC);
1945         CHECK_VALUE(SEQ_LAST_OPC);
1946
1947         CHECK_VALUE(SEQ_ALLOC_SUPER);
1948         CHECK_VALUE(SEQ_ALLOC_META);
1949
1950         CHECK_VALUE(LDLM_ENQUEUE);
1951         CHECK_VALUE(LDLM_CONVERT);
1952         CHECK_VALUE(LDLM_CANCEL);
1953         CHECK_VALUE(LDLM_BL_CALLBACK);
1954         CHECK_VALUE(LDLM_CP_CALLBACK);
1955         CHECK_VALUE(LDLM_GL_CALLBACK);
1956         CHECK_VALUE(LDLM_SET_INFO);
1957         CHECK_VALUE(LDLM_LAST_OPC);
1958
1959         CHECK_VALUE(LCK_MINMODE);
1960         CHECK_VALUE(LCK_EX);
1961         CHECK_VALUE(LCK_PW);
1962         CHECK_VALUE(LCK_PR);
1963         CHECK_VALUE(LCK_CW);
1964         CHECK_VALUE(LCK_CR);
1965         CHECK_VALUE(LCK_NL);
1966         CHECK_VALUE(LCK_GROUP);
1967         CHECK_VALUE(LCK_COS);
1968         CHECK_VALUE(LCK_MAXMODE);
1969         CHECK_VALUE(LCK_MODE_NUM);
1970
1971         CHECK_CVALUE(LDLM_PLAIN);
1972         CHECK_CVALUE(LDLM_EXTENT);
1973         CHECK_CVALUE(LDLM_FLOCK);
1974         CHECK_CVALUE(LDLM_IBITS);
1975         CHECK_CVALUE(LDLM_MAX_TYPE);
1976
1977         CHECK_CVALUE(LUSTRE_RES_ID_SEQ_OFF);
1978         CHECK_CVALUE(LUSTRE_RES_ID_VER_OID_OFF);
1979         /* CHECK_CVALUE(LUSTRE_RES_ID_WAS_VER_OFF); packed with OID */
1980         CHECK_CVALUE(LUSTRE_RES_ID_HSH_OFF);
1981
1982         CHECK_VALUE(OBD_PING);
1983         CHECK_VALUE(OBD_LOG_CANCEL);
1984         CHECK_VALUE(OBD_QC_CALLBACK);
1985         CHECK_VALUE(OBD_LAST_OPC);
1986
1987         CHECK_VALUE(QUOTA_DQACQ);
1988         CHECK_VALUE(QUOTA_DQREL);
1989         CHECK_VALUE(QUOTA_LAST_OPC);
1990
1991         CHECK_VALUE(MGS_CONNECT);
1992         CHECK_VALUE(MGS_DISCONNECT);
1993         CHECK_VALUE(MGS_EXCEPTION);
1994         CHECK_VALUE(MGS_TARGET_REG);
1995         CHECK_VALUE(MGS_TARGET_DEL);
1996         CHECK_VALUE(MGS_SET_INFO);
1997         CHECK_VALUE(MGS_LAST_OPC);
1998
1999         CHECK_VALUE(SEC_CTX_INIT);
2000         CHECK_VALUE(SEC_CTX_INIT_CONT);
2001         CHECK_VALUE(SEC_CTX_FINI);
2002         CHECK_VALUE(SEC_LAST_OPC);
2003
2004         COMMENT("Sizes and Offsets");
2005         BLANK_LINE();
2006         CHECK_STRUCT(obd_uuid);
2007         check_lu_seq_range();
2008         check_lustre_mdt_attrs();
2009         check_ost_id();
2010         check_lu_dirent();
2011         check_luda_type();
2012         check_lu_dirpage();
2013         check_lustre_handle();
2014         check_lustre_msg_v2();
2015         check_ptlrpc_body();
2016         check_obd_connect_data();
2017         check_obdo();
2018         check_lov_ost_data_v1();
2019         check_lov_mds_md_v1();
2020         check_lov_mds_md_v3();
2021         check_obd_statfs();
2022         check_obd_ioobj();
2023         check_obd_quotactl();
2024         check_niobuf_remote();
2025         check_ost_body();
2026         check_ll_fid();
2027         check_mdt_body();
2028         check_mdt_ioepoch();
2029         check_mdt_remote_perm();
2030         check_mdt_rec_setattr();
2031         check_mdt_rec_create();
2032         check_mdt_rec_link();
2033         check_mdt_rec_unlink();
2034         check_mdt_rec_rename();
2035         check_mdt_rec_setxattr();
2036         check_mdt_rec_reint();
2037         check_lmv_desc();
2038         check_lmv_stripe_md();
2039         check_lov_desc();
2040         check_ldlm_res_id();
2041         check_ldlm_extent();
2042         check_ldlm_inodebits();
2043         check_ldlm_flock();
2044         check_ldlm_intent();
2045         check_ldlm_resource_desc();
2046         check_ldlm_lock_desc();
2047         check_ldlm_request();
2048         check_ldlm_reply();
2049         check_ldlm_lvb();
2050         check_mgs_send_param();
2051         check_cfg_marker();
2052         check_llog_logid();
2053         check_llog_catid();
2054         check_llog_rec_hdr();
2055         check_llog_rec_tail();
2056         check_llog_logid_rec();
2057         check_llog_create_rec();
2058         check_llog_orphan_rec();
2059         check_llog_unlink_rec();
2060         check_llog_setattr_rec();
2061         check_llog_setattr64_rec();
2062         check_llog_size_change_rec();
2063         check_changelog_rec();
2064         check_changelog_setinfo();
2065         check_llog_changelog_rec();
2066         check_llog_changelog_user_rec();
2067         check_llog_gen();
2068         check_llog_gen_rec();
2069         check_llog_log_hdr();
2070         check_llog_cookie();
2071         check_llogd_body();
2072         check_llogd_conn_body();
2073         check_ll_fiemap_info_key();
2074         check_qunit_data();
2075         check_quota_adjust_qunit();
2076         check_mgs_target_info();
2077         check_lustre_capa();
2078         check_lustre_capa_key();
2079         check_getinfo_fid2path();
2080         check_lustre_disk_data();
2081         check_ll_user_fiemap();
2082         check_ll_fiemap_extent();
2083         printf("#ifdef LIBLUSTRE_POSIX_ACL\n");
2084 #ifndef LIBLUSTRE_POSIX_ACL
2085 #error build generator without LIBLUSTRE_POSIX_ACL defined - produce wrong check code.
2086 #endif
2087         check_posix_acl_xattr_entry();
2088         check_posix_acl_xattr_header();
2089         printf("#endif\n");
2090         check_link_ea_header();
2091         check_link_ea_entry();
2092         check_hsm_user_item();
2093         check_hsm_user_request();
2094         check_hsm_user_state();
2095
2096         printf("}\n\n");
2097
2098         return(0);
2099 }