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