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