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