Whamcloud - gitweb
3b749c4c6652a11cd6d6a1a43e1e403962c106bf
[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, 2014, Intel Corporation.
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 <libcfs/libcfs.h>
41 #include <lustre/lustre_idl.h>
42 #include <lustre/lustre_lfsck_user.h>
43 #include <lustre_disk.h>
44
45 #define BLANK_LINE()                                            \
46 do {                                                            \
47         printf("\n");                                           \
48 } while(0)
49
50 #define COMMENT(c)                                              \
51 do {                                                            \
52         printf("        /* "c" */\n");                          \
53 } while(0)
54
55 #define STRINGIFY(a) #a
56
57 #define CHECK_CDEFINE(a)                                        \
58         printf("        CLASSERT("#a" == "STRINGIFY(a) ");\n")
59
60 #define CHECK_CVALUE(a)                                  \
61         printf("        CLASSERT("#a" == %lld);\n", (long long)a)
62
63 #define CHECK_CVALUE_X(a)                                       \
64         printf("        CLASSERT("#a" == 0x%.8x);\n", a)
65
66 #define CHECK_DEFINE(a)                                         \
67 do {                                                            \
68         printf("        LASSERTF("#a" == "STRINGIFY(a)          \
69                 ", \"found %%lld\\n\",\n                        "\
70                 "(long long)"#a");\n");                         \
71 } while(0)
72
73 #define CHECK_DEFINE_X(a)                                       \
74 do {                                                            \
75         printf("        LASSERTF("#a" == "STRINGIFY(a)          \
76                 ", \"found 0x%%.8x\\n\",\n              "#a     \
77                 ");\n");                                        \
78 } while(0)
79
80 #define CHECK_DEFINE_64X(a)                                     \
81 do {                                                            \
82         printf("        LASSERTF("#a" == "STRINGIFY(a)          \
83                 ", \"found 0x%%.16llxULL\\n\",\n                "\
84                 " "#a");\n");                                   \
85 } while(0)
86
87 #define CHECK_VALUE(a)                                          \
88 do {                                                            \
89         printf("        LASSERTF("#a                            \
90                 " == %lld, \"found %%lld\\n\",\n                "\
91                 " (long long)"#a");\n", (long long)a);          \
92 } while(0)
93
94 #define CHECK_VALUE_X(a)                                        \
95 do {                                                            \
96         printf("        LASSERTF("#a                            \
97                 " == 0x%.8xUL, \"found 0x%%.8xUL\\n\",\n        "\
98                 "       (unsigned)"#a");\n", (unsigned)a);      \
99 } while(0)
100
101 #define CHECK_VALUE_O(a)                                        \
102 do {                                                            \
103         printf("        LASSERTF("#a                            \
104                 " == 0%.11oUL, \"found 0%%.11oUL\\n\",\n        "\
105                 "       "#a");\n", a);                          \
106 } while(0)
107
108 #define CHECK_VALUE_64X(a)                                      \
109 do {                                                            \
110         printf("        LASSERTF("#a" == 0x%.16llxULL, "        \
111                 "\"found 0x%%.16llxULL\\n\",\n                  "\
112                 "(long long)"#a");\n", (long long)a);           \
113 } while(0)
114
115 #define CHECK_VALUE_64O(a)                                      \
116 do {                                                            \
117         printf("        LASSERTF("#a" == 0%.22lloULL, "         \
118                 "\"found 0%%.22lloULL\\n\",\n                   "\
119                 "(long long)"#a");\n", (long long)a);           \
120 } while(0)
121
122 #define CHECK_MEMBER_OFFSET(s, m)                               \
123 do {                                                            \
124         CHECK_VALUE((int)offsetof(struct s, m));                \
125 } while(0)
126
127 #define CHECK_MEMBER_OFFSET_TYPEDEF(s, m)                       \
128 do {                                                            \
129         CHECK_VALUE((int)offsetof(s, m));                       \
130 } while(0)
131
132 #define CHECK_MEMBER_SIZEOF(s, m)                               \
133 do {                                                            \
134         CHECK_VALUE((int)sizeof(((struct s *)0)->m));           \
135 } while(0)
136
137 #define CHECK_MEMBER_SIZEOF_TYPEDEF(s, m)                       \
138 do {                                                            \
139         CHECK_VALUE((int)sizeof(((s *)0)->m));                  \
140 } while(0)
141
142 #define CHECK_MEMBER(s, m)                                      \
143 do {                                                            \
144         CHECK_MEMBER_OFFSET(s, m);                              \
145         CHECK_MEMBER_SIZEOF(s, m);                              \
146 } while(0)
147
148 #define CHECK_MEMBER_TYPEDEF(s, m)                              \
149 do {                                                            \
150         CHECK_MEMBER_OFFSET_TYPEDEF(s, m);                      \
151         CHECK_MEMBER_SIZEOF_TYPEDEF(s, m);                      \
152 } while(0)
153
154 #define CHECK_STRUCT(s)                                         \
155 do {                                                            \
156         COMMENT("Checks for struct "#s);                        \
157                 CHECK_VALUE((int)sizeof(struct s));             \
158 } while(0)
159
160 #define CHECK_STRUCT_TYPEDEF(s)                                 \
161 do {                                                            \
162         COMMENT("Checks for type "#s);                          \
163                 CHECK_VALUE((int)sizeof(s));                    \
164 } while(0)
165
166 #define CHECK_UNION(s)                                          \
167 do {                                                            \
168         COMMENT("Checks for union "#s);                         \
169         CHECK_VALUE((int)sizeof(union s));                      \
170 } while(0)
171
172 #define CHECK_VALUE_SAME(v1, v2)                                \
173 do {                                                            \
174         printf("\tLASSERTF("#v1" == "#v2", "                    \
175                 "\"%%d != %%d\\n\",\n"                          \
176                 "\t\t "#v1", "#v2");\n");                       \
177 } while (0)
178
179 #define CHECK_MEMBER_SAME(s1, s2, m)                            \
180 do {                                                            \
181         CHECK_VALUE_SAME((int)offsetof(struct s1, m),           \
182                          (int)offsetof(struct s2, m));          \
183         CHECK_VALUE_SAME((int)sizeof(((struct s1 *)0)->m),      \
184                          (int)sizeof(((struct s2 *)0)->m));     \
185 } while (0)
186
187 static void
188 check_lu_seq_range(void)
189 {
190         BLANK_LINE();
191         CHECK_STRUCT(lu_seq_range);
192         CHECK_MEMBER(lu_seq_range, lsr_start);
193         CHECK_MEMBER(lu_seq_range, lsr_end);
194         CHECK_MEMBER(lu_seq_range, lsr_index);
195         CHECK_MEMBER(lu_seq_range, lsr_flags);
196
197         CHECK_VALUE(LU_SEQ_RANGE_MDT);
198         CHECK_VALUE(LU_SEQ_RANGE_OST);
199 }
200
201 static void
202 check_lustre_mdt_attrs(void)
203 {
204         BLANK_LINE();
205         CHECK_STRUCT(lustre_mdt_attrs);
206         CHECK_MEMBER(lustre_mdt_attrs, lma_compat);
207         CHECK_MEMBER(lustre_mdt_attrs, lma_incompat);
208         CHECK_MEMBER(lustre_mdt_attrs, lma_self_fid);
209         CHECK_VALUE_X(LMAI_RELEASED);
210
211         CHECK_VALUE_X(LMAC_HSM);
212         CHECK_VALUE_X(LMAC_SOM);
213         CHECK_VALUE_X(LMAC_NOT_IN_OI);
214         CHECK_VALUE_X(LMAC_FID_ON_OST);
215 }
216
217 static void
218 check_som_attrs(void)
219 {
220         BLANK_LINE();
221         CHECK_STRUCT(som_attrs);
222         CHECK_MEMBER(som_attrs, som_compat);
223         CHECK_MEMBER(som_attrs, som_incompat);
224         CHECK_MEMBER(som_attrs, som_ioepoch);
225         CHECK_MEMBER(som_attrs, som_size);
226         CHECK_MEMBER(som_attrs, som_blocks);
227         CHECK_MEMBER(som_attrs, som_mountid);
228 }
229
230 static void
231 check_hsm_attrs(void)
232 {
233         BLANK_LINE();
234         CHECK_STRUCT(hsm_attrs);
235         CHECK_MEMBER(hsm_attrs, hsm_compat);
236         CHECK_MEMBER(hsm_attrs, hsm_flags);
237         CHECK_MEMBER(hsm_attrs, hsm_arch_id);
238         CHECK_MEMBER(hsm_attrs, hsm_arch_ver);
239 }
240
241 static void
242 check_ost_id(void)
243 {
244         BLANK_LINE();
245         CHECK_STRUCT(ost_id);
246         CHECK_MEMBER(ost_id, oi);
247
248         CHECK_VALUE(LUSTRE_FID_INIT_OID);
249
250         CHECK_VALUE(FID_SEQ_OST_MDT0);
251         CHECK_VALUE(FID_SEQ_LLOG);
252         CHECK_VALUE(FID_SEQ_ECHO);
253         CHECK_VALUE(FID_SEQ_OST_MDT1);
254         CHECK_VALUE(FID_SEQ_OST_MAX);
255         CHECK_VALUE(FID_SEQ_RSVD);
256         CHECK_VALUE(FID_SEQ_IGIF);
257         CHECK_VALUE_64X(FID_SEQ_IGIF_MAX);
258         CHECK_VALUE_64X(FID_SEQ_IDIF);
259         CHECK_VALUE_64X(FID_SEQ_IDIF_MAX);
260         CHECK_VALUE_64X(FID_SEQ_START);
261         CHECK_VALUE_64X(FID_SEQ_LOCAL_FILE);
262         CHECK_VALUE_64X(FID_SEQ_DOT_LUSTRE);
263         CHECK_VALUE_64X(FID_SEQ_SPECIAL);
264         CHECK_VALUE_64X(FID_SEQ_QUOTA);
265         CHECK_VALUE_64X(FID_SEQ_QUOTA_GLB);
266         CHECK_VALUE_64X(FID_SEQ_ROOT);
267         CHECK_VALUE_64X(FID_SEQ_NORMAL);
268         CHECK_VALUE_64X(FID_SEQ_LOV_DEFAULT);
269
270         CHECK_VALUE_X(FID_OID_SPECIAL_BFL);
271         CHECK_VALUE_X(FID_OID_DOT_LUSTRE);
272         CHECK_VALUE_X(FID_OID_DOT_LUSTRE_OBF);
273 }
274
275 static void
276 check_lu_dirent(void)
277 {
278         BLANK_LINE();
279         CHECK_STRUCT(lu_dirent);
280         CHECK_MEMBER(lu_dirent, lde_fid);
281         CHECK_MEMBER(lu_dirent, lde_hash);
282         CHECK_MEMBER(lu_dirent, lde_reclen);
283         CHECK_MEMBER(lu_dirent, lde_namelen);
284         CHECK_MEMBER(lu_dirent, lde_attrs);
285         CHECK_MEMBER(lu_dirent, lde_name[0]);
286
287         CHECK_VALUE_X(LUDA_FID);
288         CHECK_VALUE_X(LUDA_TYPE);
289         CHECK_VALUE_X(LUDA_64BITHASH);
290 }
291
292 static void
293 check_luda_type(void)
294 {
295         BLANK_LINE();
296         CHECK_STRUCT(luda_type);
297         CHECK_MEMBER(luda_type, lt_type);
298 }
299
300 static void
301 check_lu_dirpage(void)
302 {
303         BLANK_LINE();
304         CHECK_STRUCT(lu_dirpage);
305         CHECK_MEMBER(lu_dirpage, ldp_hash_start);
306         CHECK_MEMBER(lu_dirpage, ldp_hash_end);
307         CHECK_MEMBER(lu_dirpage, ldp_flags);
308         CHECK_MEMBER(lu_dirpage, ldp_pad0);
309         CHECK_MEMBER(lu_dirpage, ldp_entries[0]);
310
311         CHECK_VALUE(LDF_EMPTY);
312         CHECK_VALUE(LDF_COLLIDE);
313         CHECK_VALUE(LU_PAGE_SIZE);
314         CHECK_UNION(lu_page);
315 }
316
317 static void
318 check_lustre_handle(void)
319 {
320         BLANK_LINE();
321         CHECK_STRUCT(lustre_handle);
322         CHECK_MEMBER(lustre_handle, cookie);
323 }
324
325 static void
326 check_lustre_msg_v2(void)
327 {
328         BLANK_LINE();
329         CHECK_STRUCT(lustre_msg_v2);
330         CHECK_MEMBER(lustre_msg_v2, lm_bufcount);
331         CHECK_MEMBER(lustre_msg_v2, lm_secflvr);
332         CHECK_MEMBER(lustre_msg_v2, lm_magic);
333         CHECK_MEMBER(lustre_msg_v2, lm_repsize);
334         CHECK_MEMBER(lustre_msg_v2, lm_cksum);
335         CHECK_MEMBER(lustre_msg_v2, lm_flags);
336         CHECK_MEMBER(lustre_msg_v2, lm_padding_2);
337         CHECK_MEMBER(lustre_msg_v2, lm_padding_3);
338         CHECK_MEMBER(lustre_msg_v2, lm_buflens[0]);
339
340         CHECK_DEFINE_X(LUSTRE_MSG_MAGIC_V2);
341         CHECK_DEFINE_X(LUSTRE_MSG_MAGIC_V2_SWABBED);
342 }
343
344 static void
345 check_ptlrpc_body(void)
346 {
347         BLANK_LINE();
348         CHECK_STRUCT(ptlrpc_body);
349         CHECK_MEMBER(ptlrpc_body, pb_handle);
350         CHECK_MEMBER(ptlrpc_body, pb_type);
351         CHECK_MEMBER(ptlrpc_body, pb_version);
352         CHECK_MEMBER(ptlrpc_body, pb_opc);
353         CHECK_MEMBER(ptlrpc_body, pb_status);
354         CHECK_MEMBER(ptlrpc_body, pb_last_xid);
355         CHECK_MEMBER(ptlrpc_body, pb_tag);
356         CHECK_MEMBER(ptlrpc_body, pb_padding0);
357         CHECK_MEMBER(ptlrpc_body, pb_padding1);
358         CHECK_MEMBER(ptlrpc_body, pb_last_committed);
359         CHECK_MEMBER(ptlrpc_body, pb_transno);
360         CHECK_MEMBER(ptlrpc_body, pb_flags);
361         CHECK_MEMBER(ptlrpc_body, pb_op_flags);
362         CHECK_MEMBER(ptlrpc_body, pb_conn_cnt);
363         CHECK_MEMBER(ptlrpc_body, pb_timeout);
364         CHECK_MEMBER(ptlrpc_body, pb_service_time);
365         CHECK_MEMBER(ptlrpc_body, pb_limit);
366         CHECK_MEMBER(ptlrpc_body, pb_slv);
367         CHECK_CVALUE(PTLRPC_NUM_VERSIONS);
368         CHECK_MEMBER(ptlrpc_body, pb_pre_versions);
369         CHECK_MEMBER(ptlrpc_body, pb_padding);
370         CHECK_CVALUE(LUSTRE_JOBID_SIZE);
371         CHECK_MEMBER(ptlrpc_body, pb_jobid);
372
373         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_handle);
374         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_type);
375         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_version);
376         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_opc);
377         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_status);
378         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_last_xid);
379         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_tag);
380         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_padding0);
381         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_padding1);
382         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_last_committed);
383         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_transno);
384         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_flags);
385         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_op_flags);
386         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_conn_cnt);
387         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_timeout);
388         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_service_time);
389         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_limit);
390         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_slv);
391         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_pre_versions);
392         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_padding);
393
394         CHECK_VALUE(MSG_PTLRPC_BODY_OFF);
395         CHECK_VALUE(REQ_REC_OFF);
396         CHECK_VALUE(REPLY_REC_OFF);
397         CHECK_VALUE(DLM_LOCKREQ_OFF);
398         CHECK_VALUE(DLM_REQ_REC_OFF);
399         CHECK_VALUE(DLM_INTENT_IT_OFF);
400         CHECK_VALUE(DLM_INTENT_REC_OFF);
401         CHECK_VALUE(DLM_LOCKREPLY_OFF);
402         CHECK_VALUE(DLM_REPLY_REC_OFF);
403         CHECK_VALUE(MSG_PTLRPC_HEADER_OFF);
404
405         CHECK_DEFINE_X(PTLRPC_MSG_VERSION);
406         CHECK_DEFINE_X(LUSTRE_VERSION_MASK);
407         CHECK_DEFINE_X(LUSTRE_OBD_VERSION);
408         CHECK_DEFINE_X(LUSTRE_MDS_VERSION);
409         CHECK_DEFINE_X(LUSTRE_OST_VERSION);
410         CHECK_DEFINE_X(LUSTRE_DLM_VERSION);
411         CHECK_DEFINE_X(LUSTRE_LOG_VERSION);
412         CHECK_DEFINE_X(LUSTRE_MGS_VERSION);
413
414         CHECK_VALUE(MSGHDR_AT_SUPPORT);
415         CHECK_VALUE(MSGHDR_CKSUM_INCOMPAT18);
416
417         CHECK_VALUE_X(MSG_OP_FLAG_MASK);
418         CHECK_VALUE(MSG_OP_FLAG_SHIFT);
419         CHECK_VALUE_X(MSG_GEN_FLAG_MASK);
420
421         CHECK_VALUE_X(MSG_LAST_REPLAY);
422         CHECK_VALUE_X(MSG_RESENT);
423         CHECK_VALUE_X(MSG_REPLAY);
424         CHECK_VALUE_X(MSG_DELAY_REPLAY);
425         CHECK_VALUE_X(MSG_VERSION_REPLAY);
426         CHECK_VALUE_X(MSG_REQ_REPLAY_DONE);
427         CHECK_VALUE_X(MSG_LOCK_REPLAY_DONE);
428
429         CHECK_VALUE_X(MSG_CONNECT_RECOVERING);
430         CHECK_VALUE_X(MSG_CONNECT_RECONNECT);
431         CHECK_VALUE_X(MSG_CONNECT_REPLAYABLE);
432         CHECK_VALUE_X(MSG_CONNECT_LIBCLIENT);
433         CHECK_VALUE_X(MSG_CONNECT_INITIAL);
434         CHECK_VALUE_X(MSG_CONNECT_ASYNC);
435         CHECK_VALUE_X(MSG_CONNECT_NEXT_VER);
436         CHECK_VALUE_X(MSG_CONNECT_TRANSNO);
437 }
438
439 static void
440 check_obd_connect_data(void)
441 {
442         BLANK_LINE();
443         CHECK_STRUCT(obd_connect_data);
444         CHECK_MEMBER(obd_connect_data, ocd_connect_flags);
445         CHECK_MEMBER(obd_connect_data, ocd_version);
446         CHECK_MEMBER(obd_connect_data, ocd_grant);
447         CHECK_MEMBER(obd_connect_data, ocd_index);
448         CHECK_MEMBER(obd_connect_data, ocd_brw_size);
449         CHECK_MEMBER(obd_connect_data, ocd_ibits_known);
450         CHECK_MEMBER(obd_connect_data, ocd_blocksize);
451         CHECK_MEMBER(obd_connect_data, ocd_inodespace);
452         CHECK_MEMBER(obd_connect_data, ocd_grant_extent);
453         CHECK_MEMBER(obd_connect_data, ocd_unused);
454         CHECK_MEMBER(obd_connect_data, ocd_transno);
455         CHECK_MEMBER(obd_connect_data, ocd_group);
456         CHECK_MEMBER(obd_connect_data, ocd_cksum_types);
457         CHECK_MEMBER(obd_connect_data, ocd_max_easize);
458         CHECK_MEMBER(obd_connect_data, ocd_instance);
459         CHECK_MEMBER(obd_connect_data, ocd_maxbytes);
460         CHECK_MEMBER(obd_connect_data, ocd_maxmodrpcs);
461         CHECK_MEMBER(obd_connect_data, padding0);
462         CHECK_MEMBER(obd_connect_data, padding1);
463         CHECK_MEMBER(obd_connect_data, padding2);
464         CHECK_MEMBER(obd_connect_data, padding3);
465         CHECK_MEMBER(obd_connect_data, padding4);
466         CHECK_MEMBER(obd_connect_data, padding5);
467         CHECK_MEMBER(obd_connect_data, padding6);
468         CHECK_MEMBER(obd_connect_data, padding7);
469         CHECK_MEMBER(obd_connect_data, padding8);
470         CHECK_MEMBER(obd_connect_data, padding9);
471         CHECK_MEMBER(obd_connect_data, paddingA);
472         CHECK_MEMBER(obd_connect_data, paddingB);
473         CHECK_MEMBER(obd_connect_data, paddingC);
474         CHECK_MEMBER(obd_connect_data, paddingD);
475         CHECK_MEMBER(obd_connect_data, paddingE);
476         CHECK_MEMBER(obd_connect_data, paddingF);
477
478         CHECK_DEFINE_64X(OBD_CONNECT_RDONLY);
479         CHECK_DEFINE_64X(OBD_CONNECT_INDEX);
480         CHECK_DEFINE_64X(OBD_CONNECT_MDS);
481         CHECK_DEFINE_64X(OBD_CONNECT_GRANT);
482         CHECK_DEFINE_64X(OBD_CONNECT_SRVLOCK);
483         CHECK_DEFINE_64X(OBD_CONNECT_VERSION);
484         CHECK_DEFINE_64X(OBD_CONNECT_REQPORTAL);
485         CHECK_DEFINE_64X(OBD_CONNECT_ACL);
486         CHECK_DEFINE_64X(OBD_CONNECT_XATTR);
487         CHECK_DEFINE_64X(OBD_CONNECT_CROW);
488         CHECK_DEFINE_64X(OBD_CONNECT_TRUNCLOCK);
489         CHECK_DEFINE_64X(OBD_CONNECT_TRANSNO);
490         CHECK_DEFINE_64X(OBD_CONNECT_IBITS);
491         CHECK_DEFINE_64X(OBD_CONNECT_JOIN);
492         CHECK_DEFINE_64X(OBD_CONNECT_ATTRFID);
493         CHECK_DEFINE_64X(OBD_CONNECT_NODEVOH);
494         CHECK_DEFINE_64X(OBD_CONNECT_RMT_CLIENT);
495         CHECK_DEFINE_64X(OBD_CONNECT_RMT_CLIENT_FORCE);
496         CHECK_DEFINE_64X(OBD_CONNECT_BRW_SIZE);
497         CHECK_DEFINE_64X(OBD_CONNECT_QUOTA64);
498         CHECK_DEFINE_64X(OBD_CONNECT_MDS_CAPA);
499         CHECK_DEFINE_64X(OBD_CONNECT_OSS_CAPA);
500         CHECK_DEFINE_64X(OBD_CONNECT_CANCELSET);
501         CHECK_DEFINE_64X(OBD_CONNECT_SOM);
502         CHECK_DEFINE_64X(OBD_CONNECT_AT);
503         CHECK_DEFINE_64X(OBD_CONNECT_LRU_RESIZE);
504         CHECK_DEFINE_64X(OBD_CONNECT_MDS_MDS);
505         CHECK_DEFINE_64X(OBD_CONNECT_REAL);
506         CHECK_DEFINE_64X(OBD_CONNECT_CHANGE_QS);
507         CHECK_DEFINE_64X(OBD_CONNECT_CKSUM);
508         CHECK_DEFINE_64X(OBD_CONNECT_FID);
509         CHECK_DEFINE_64X(OBD_CONNECT_VBR);
510         CHECK_DEFINE_64X(OBD_CONNECT_LOV_V3);
511         CHECK_DEFINE_64X(OBD_CONNECT_GRANT_SHRINK);
512         CHECK_DEFINE_64X(OBD_CONNECT_SKIP_ORPHAN);
513         CHECK_DEFINE_64X(OBD_CONNECT_MAX_EASIZE);
514         CHECK_DEFINE_64X(OBD_CONNECT_FULL20);
515         CHECK_DEFINE_64X(OBD_CONNECT_LAYOUTLOCK);
516         CHECK_DEFINE_64X(OBD_CONNECT_64BITHASH);
517         CHECK_DEFINE_64X(OBD_CONNECT_MAXBYTES);
518         CHECK_DEFINE_64X(OBD_CONNECT_IMP_RECOV);
519         CHECK_DEFINE_64X(OBD_CONNECT_JOBSTATS);
520         CHECK_DEFINE_64X(OBD_CONNECT_UMASK);
521         CHECK_DEFINE_64X(OBD_CONNECT_EINPROGRESS);
522         CHECK_DEFINE_64X(OBD_CONNECT_GRANT_PARAM);
523         CHECK_DEFINE_64X(OBD_CONNECT_FLOCK_OWNER);
524         CHECK_DEFINE_64X(OBD_CONNECT_LVB_TYPE);
525         CHECK_DEFINE_64X(OBD_CONNECT_NANOSEC_TIME);
526         CHECK_DEFINE_64X(OBD_CONNECT_LIGHTWEIGHT);
527         CHECK_DEFINE_64X(OBD_CONNECT_SHORTIO);
528         CHECK_DEFINE_64X(OBD_CONNECT_PINGLESS);
529         CHECK_DEFINE_64X(OBD_CONNECT_FLOCK_DEAD);
530         CHECK_DEFINE_64X(OBD_CONNECT_OPEN_BY_FID);
531         CHECK_DEFINE_64X(OBD_CONNECT_LFSCK);
532         CHECK_DEFINE_64X(OBD_CONNECT_UNLINK_CLOSE);
533         CHECK_DEFINE_64X(OBD_CONNECT_MULTIMODRPCS);
534         CHECK_DEFINE_64X(OBD_CONNECT_DIR_STRIPE);
535
536         CHECK_VALUE_X(OBD_CKSUM_CRC32);
537         CHECK_VALUE_X(OBD_CKSUM_ADLER);
538         CHECK_VALUE_X(OBD_CKSUM_CRC32C);
539 }
540
541 static void
542 check_obdo(void)
543 {
544         BLANK_LINE();
545         CHECK_STRUCT(obdo);
546         CHECK_MEMBER(obdo, o_valid);
547         CHECK_MEMBER(obdo, o_oi);
548         CHECK_MEMBER(obdo, o_parent_seq);
549         CHECK_MEMBER(obdo, o_size);
550         CHECK_MEMBER(obdo, o_mtime);
551         CHECK_MEMBER(obdo, o_atime);
552         CHECK_MEMBER(obdo, o_ctime);
553         CHECK_MEMBER(obdo, o_blocks);
554         CHECK_MEMBER(obdo, o_grant);
555         CHECK_MEMBER(obdo, o_blksize);
556         CHECK_MEMBER(obdo, o_mode);
557         CHECK_MEMBER(obdo, o_uid);
558         CHECK_MEMBER(obdo, o_gid);
559         CHECK_MEMBER(obdo, o_flags);
560         CHECK_MEMBER(obdo, o_nlink);
561         CHECK_MEMBER(obdo, o_parent_oid);
562         CHECK_MEMBER(obdo, o_misc);
563         CHECK_MEMBER(obdo, o_ioepoch);
564         CHECK_MEMBER(obdo, o_stripe_idx);
565         CHECK_MEMBER(obdo, o_parent_ver);
566         CHECK_MEMBER(obdo, o_handle);
567         CHECK_MEMBER(obdo, o_lcookie);
568         CHECK_MEMBER(obdo, o_uid_h);
569         CHECK_MEMBER(obdo, o_gid_h);
570         CHECK_MEMBER(obdo, o_data_version);
571         CHECK_MEMBER(obdo, o_padding_4);
572         CHECK_MEMBER(obdo, o_padding_5);
573         CHECK_MEMBER(obdo, o_padding_6);
574
575         CHECK_DEFINE_64X(OBD_MD_FLID);
576         CHECK_DEFINE_64X(OBD_MD_FLATIME);
577         CHECK_DEFINE_64X(OBD_MD_FLMTIME);
578         CHECK_DEFINE_64X(OBD_MD_FLCTIME);
579         CHECK_DEFINE_64X(OBD_MD_FLSIZE);
580         CHECK_DEFINE_64X(OBD_MD_FLBLOCKS);
581         CHECK_DEFINE_64X(OBD_MD_FLBLKSZ);
582         CHECK_DEFINE_64X(OBD_MD_FLMODE);
583         CHECK_DEFINE_64X(OBD_MD_FLTYPE);
584         CHECK_DEFINE_64X(OBD_MD_FLUID);
585         CHECK_DEFINE_64X(OBD_MD_FLGID);
586         CHECK_DEFINE_64X(OBD_MD_FLFLAGS);
587         CHECK_DEFINE_64X(OBD_MD_FLNLINK);
588         CHECK_DEFINE_64X(OBD_MD_FLGENER);
589         CHECK_DEFINE_64X(OBD_MD_FLRDEV);
590         CHECK_DEFINE_64X(OBD_MD_FLEASIZE);
591         CHECK_DEFINE_64X(OBD_MD_LINKNAME);
592         CHECK_DEFINE_64X(OBD_MD_FLHANDLE);
593         CHECK_DEFINE_64X(OBD_MD_FLCKSUM);
594         CHECK_DEFINE_64X(OBD_MD_FLQOS);
595         CHECK_DEFINE_64X(OBD_MD_FLCOOKIE);
596         CHECK_DEFINE_64X(OBD_MD_FLGROUP);
597         CHECK_DEFINE_64X(OBD_MD_FLFID);
598         CHECK_DEFINE_64X(OBD_MD_FLEPOCH);
599         CHECK_DEFINE_64X(OBD_MD_FLGRANT);
600         CHECK_DEFINE_64X(OBD_MD_FLDIREA);
601         CHECK_DEFINE_64X(OBD_MD_FLUSRQUOTA);
602         CHECK_DEFINE_64X(OBD_MD_FLGRPQUOTA);
603         CHECK_DEFINE_64X(OBD_MD_FLMODEASIZE);
604         CHECK_DEFINE_64X(OBD_MD_MDS);
605         CHECK_DEFINE_64X(OBD_MD_REINT);
606         CHECK_DEFINE_64X(OBD_MD_MEA);
607         CHECK_DEFINE_64X(OBD_MD_TSTATE);
608         CHECK_DEFINE_64X(OBD_MD_FLXATTR);
609         CHECK_DEFINE_64X(OBD_MD_FLXATTRLS);
610         CHECK_DEFINE_64X(OBD_MD_FLXATTRRM);
611         CHECK_DEFINE_64X(OBD_MD_FLACL);
612         CHECK_DEFINE_64X(OBD_MD_FLRMTPERM);
613         CHECK_DEFINE_64X(OBD_MD_FLMDSCAPA);
614         CHECK_DEFINE_64X(OBD_MD_FLOSSCAPA);
615         CHECK_DEFINE_64X(OBD_MD_FLCKSPLIT);
616         CHECK_DEFINE_64X(OBD_MD_FLCROSSREF);
617         CHECK_DEFINE_64X(OBD_MD_FLGETATTRLOCK);
618         CHECK_DEFINE_64X(OBD_MD_FLRMTLSETFACL);
619         CHECK_DEFINE_64X(OBD_MD_FLRMTLGETFACL);
620         CHECK_DEFINE_64X(OBD_MD_FLRMTRSETFACL);
621         CHECK_DEFINE_64X(OBD_MD_FLRMTRGETFACL);
622         CHECK_DEFINE_64X(OBD_MD_FLDATAVERSION);
623
624         CHECK_CVALUE_X(OBD_FL_INLINEDATA);
625         CHECK_CVALUE_X(OBD_FL_OBDMDEXISTS);
626         CHECK_CVALUE_X(OBD_FL_DELORPHAN);
627         CHECK_CVALUE_X(OBD_FL_NORPC);
628         CHECK_CVALUE_X(OBD_FL_IDONLY);
629         CHECK_CVALUE_X(OBD_FL_RECREATE_OBJS);
630         CHECK_CVALUE_X(OBD_FL_DEBUG_CHECK);
631         CHECK_CVALUE_X(OBD_FL_NO_USRQUOTA);
632         CHECK_CVALUE_X(OBD_FL_NO_GRPQUOTA);
633         CHECK_CVALUE_X(OBD_FL_CREATE_CROW);
634         CHECK_CVALUE_X(OBD_FL_SRVLOCK);
635         CHECK_CVALUE_X(OBD_FL_CKSUM_CRC32);
636         CHECK_CVALUE_X(OBD_FL_CKSUM_ADLER);
637         CHECK_CVALUE_X(OBD_FL_CKSUM_CRC32C);
638         CHECK_CVALUE_X(OBD_FL_CKSUM_RSVD2);
639         CHECK_CVALUE_X(OBD_FL_CKSUM_RSVD3);
640         CHECK_CVALUE_X(OBD_FL_SHRINK_GRANT);
641         CHECK_CVALUE_X(OBD_FL_MMAP);
642         CHECK_CVALUE_X(OBD_FL_RECOV_RESEND);
643         CHECK_CVALUE_X(OBD_FL_NOSPC_BLK);
644         CHECK_CVALUE_X(OBD_FL_FLUSH);
645         CHECK_CVALUE_X(OBD_FL_SHORT_IO);
646         CHECK_CVALUE_X(OBD_FL_LOCAL_MASK);
647 }
648
649 static void
650 check_lov_ost_data_v1(void)
651 {
652         BLANK_LINE();
653         CHECK_STRUCT(lov_ost_data_v1);
654         CHECK_MEMBER(lov_ost_data_v1, l_ost_oi);
655         CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
656         CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
657 }
658
659 static void
660 check_lov_mds_md_v1(void)
661 {
662         BLANK_LINE();
663         CHECK_STRUCT(lov_mds_md_v1);
664         CHECK_MEMBER(lov_mds_md_v1, lmm_magic);
665         CHECK_MEMBER(lov_mds_md_v1, lmm_pattern);
666         CHECK_MEMBER(lov_mds_md_v1, lmm_oi);
667         CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_size);
668         CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_count);
669         CHECK_MEMBER(lov_mds_md_v1, lmm_layout_gen);
670         CHECK_MEMBER(lov_mds_md_v1, lmm_objects[0]);
671
672         CHECK_CDEFINE(LOV_MAGIC_V1);
673 }
674
675 static void
676 check_lov_mds_md_v3(void)
677 {
678         BLANK_LINE();
679         CHECK_STRUCT(lov_mds_md_v3);
680         CHECK_MEMBER(lov_mds_md_v3, lmm_magic);
681         CHECK_MEMBER(lov_mds_md_v3, lmm_pattern);
682         CHECK_MEMBER(lov_mds_md_v3, lmm_oi);
683         CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_size);
684         CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_count);
685         CHECK_MEMBER(lov_mds_md_v3, lmm_layout_gen);
686         CHECK_CVALUE(LOV_MAXPOOLNAME);
687         CHECK_MEMBER(lov_mds_md_v3, lmm_pool_name[LOV_MAXPOOLNAME + 1]);
688         CHECK_MEMBER(lov_mds_md_v3, lmm_objects[0]);
689
690         CHECK_CDEFINE(LOV_MAGIC_V3);
691
692         CHECK_VALUE_X(LOV_PATTERN_RAID0);
693         CHECK_VALUE_X(LOV_PATTERN_RAID1);
694         CHECK_VALUE_X(LOV_PATTERN_FIRST);
695         CHECK_VALUE_X(LOV_PATTERN_CMOBD);
696 }
697
698 static void
699 check_lmv_mds_md_v1(void)
700 {
701         BLANK_LINE();
702         CHECK_STRUCT(lmv_mds_md_v1);
703         CHECK_MEMBER(lmv_mds_md_v1, lmv_magic);
704         CHECK_MEMBER(lmv_mds_md_v1, lmv_stripe_count);
705         CHECK_MEMBER(lmv_mds_md_v1, lmv_master_mdt_index);
706         CHECK_MEMBER(lmv_mds_md_v1, lmv_hash_type);
707         CHECK_MEMBER(lmv_mds_md_v1, lmv_layout_version);
708         CHECK_MEMBER(lmv_mds_md_v1, lmv_padding1);
709         CHECK_MEMBER(lmv_mds_md_v1, lmv_padding2);
710         CHECK_MEMBER(lmv_mds_md_v1, lmv_padding3);
711         CHECK_MEMBER(lmv_mds_md_v1, lmv_pool_name[LOV_MAXPOOLNAME]);
712         CHECK_MEMBER(lmv_mds_md_v1, lmv_stripe_fids[0]);
713
714         CHECK_CDEFINE(LMV_MAGIC_V1);
715         CHECK_CDEFINE(LMV_MAGIC_STRIPE);
716         CHECK_CDEFINE(LMV_HASH_TYPE_MASK);
717         CHECK_CDEFINE(LMV_HASH_FLAG_MIGRATION);
718         CHECK_CDEFINE(LMV_HASH_FLAG_DEAD);
719         CHECK_CDEFINE(LMV_HASH_FLAG_BAD_TYPE);
720         CHECK_CDEFINE(LMV_HASH_FLAG_LOST_LMV);
721 }
722
723 static void
724 check_obd_statfs(void)
725 {
726         BLANK_LINE();
727         CHECK_STRUCT(obd_statfs);
728         CHECK_MEMBER(obd_statfs, os_type);
729         CHECK_MEMBER(obd_statfs, os_blocks);
730         CHECK_MEMBER(obd_statfs, os_bfree);
731         CHECK_MEMBER(obd_statfs, os_bavail);
732         CHECK_MEMBER(obd_statfs, os_ffree);
733         CHECK_MEMBER(obd_statfs, os_fsid);
734         CHECK_MEMBER(obd_statfs, os_bsize);
735         CHECK_MEMBER(obd_statfs, os_namelen);
736         CHECK_MEMBER(obd_statfs, os_state);
737         CHECK_MEMBER(obd_statfs, os_fprecreated);
738         CHECK_MEMBER(obd_statfs, os_spare2);
739         CHECK_MEMBER(obd_statfs, os_spare3);
740         CHECK_MEMBER(obd_statfs, os_spare4);
741         CHECK_MEMBER(obd_statfs, os_spare5);
742         CHECK_MEMBER(obd_statfs, os_spare6);
743         CHECK_MEMBER(obd_statfs, os_spare7);
744         CHECK_MEMBER(obd_statfs, os_spare8);
745         CHECK_MEMBER(obd_statfs, os_spare9);
746 }
747
748 static void
749 check_obd_ioobj(void)
750 {
751         BLANK_LINE();
752         CHECK_STRUCT(obd_ioobj);
753         CHECK_MEMBER(obd_ioobj, ioo_oid);
754         CHECK_MEMBER(obd_ioobj, ioo_max_brw);
755         CHECK_MEMBER(obd_ioobj, ioo_bufcnt);
756 }
757
758 static void
759 check_obd_quotactl(void)
760 {
761
762         BLANK_LINE();
763         CHECK_UNION(lquota_id);
764
765         BLANK_LINE();
766         CHECK_VALUE(QUOTABLOCK_BITS);
767         CHECK_VALUE(QUOTABLOCK_SIZE);
768
769         BLANK_LINE();
770         CHECK_STRUCT(obd_quotactl);
771         CHECK_MEMBER(obd_quotactl, qc_cmd);
772         CHECK_MEMBER(obd_quotactl, qc_type);
773         CHECK_MEMBER(obd_quotactl, qc_id);
774         CHECK_MEMBER(obd_quotactl, qc_stat);
775         CHECK_MEMBER(obd_quotactl, qc_dqinfo);
776         CHECK_MEMBER(obd_quotactl, qc_dqblk);
777
778         BLANK_LINE();
779         CHECK_STRUCT(obd_dqinfo);
780         CHECK_MEMBER(obd_dqinfo, dqi_bgrace);
781         CHECK_MEMBER(obd_dqinfo, dqi_igrace);
782         CHECK_MEMBER(obd_dqinfo, dqi_flags);
783         CHECK_MEMBER(obd_dqinfo, dqi_valid);
784
785         BLANK_LINE();
786         CHECK_STRUCT(obd_dqblk);
787         CHECK_MEMBER(obd_dqblk, dqb_bhardlimit);
788         CHECK_MEMBER(obd_dqblk, dqb_bsoftlimit);
789         CHECK_MEMBER(obd_dqblk, dqb_curspace);
790         CHECK_MEMBER(obd_dqblk, dqb_ihardlimit);
791         CHECK_MEMBER(obd_dqblk, dqb_isoftlimit);
792         CHECK_MEMBER(obd_dqblk, dqb_curinodes);
793         CHECK_MEMBER(obd_dqblk, dqb_btime);
794         CHECK_MEMBER(obd_dqblk, dqb_itime);
795         CHECK_MEMBER(obd_dqblk, dqb_valid);
796         CHECK_MEMBER(obd_dqblk, dqb_padding);
797
798         CHECK_DEFINE_X(Q_QUOTACHECK);
799         CHECK_DEFINE_X(Q_INITQUOTA);
800         CHECK_DEFINE_X(Q_GETOINFO);
801         CHECK_DEFINE_X(Q_GETOQUOTA);
802         CHECK_DEFINE_X(Q_FINVALIDATE);
803
804         BLANK_LINE();
805         CHECK_STRUCT(lquota_acct_rec);
806         CHECK_MEMBER(lquota_acct_rec, bspace);
807         CHECK_MEMBER(lquota_acct_rec, ispace);
808
809         BLANK_LINE();
810         CHECK_STRUCT(lquota_glb_rec);
811         CHECK_MEMBER(lquota_glb_rec, qbr_hardlimit);
812         CHECK_MEMBER(lquota_glb_rec, qbr_softlimit);
813         CHECK_MEMBER(lquota_glb_rec, qbr_time);
814         CHECK_MEMBER(lquota_glb_rec, qbr_granted);
815
816         BLANK_LINE();
817         CHECK_STRUCT(lquota_slv_rec);
818         CHECK_MEMBER(lquota_slv_rec, qsr_granted);
819
820 }
821
822 static void
823 check_obd_idx_read(void)
824 {
825         BLANK_LINE();
826         CHECK_STRUCT(idx_info);
827         CHECK_MEMBER(idx_info, ii_magic);
828         CHECK_MEMBER(idx_info, ii_flags);
829         CHECK_MEMBER(idx_info, ii_count);
830         CHECK_MEMBER(idx_info, ii_pad0);
831         CHECK_MEMBER(idx_info, ii_attrs);
832         CHECK_MEMBER(idx_info, ii_fid);
833         CHECK_MEMBER(idx_info, ii_version);
834         CHECK_MEMBER(idx_info, ii_hash_start);
835         CHECK_MEMBER(idx_info, ii_hash_end);
836         CHECK_MEMBER(idx_info, ii_keysize);
837         CHECK_MEMBER(idx_info, ii_recsize);
838         CHECK_MEMBER(idx_info, ii_pad1);
839         CHECK_MEMBER(idx_info, ii_pad2);
840         CHECK_MEMBER(idx_info, ii_pad3);
841         CHECK_CDEFINE(IDX_INFO_MAGIC);
842
843         BLANK_LINE();
844         CHECK_STRUCT(lu_idxpage);
845         CHECK_MEMBER(lu_idxpage, lip_magic);
846         CHECK_MEMBER(lu_idxpage, lip_flags);
847         CHECK_MEMBER(lu_idxpage, lip_nr);
848         CHECK_MEMBER(lu_idxpage, lip_pad0);
849
850         CHECK_CDEFINE(LIP_MAGIC);
851         CHECK_VALUE(LIP_HDR_SIZE);
852
853         CHECK_VALUE(II_FL_NOHASH);
854         CHECK_VALUE(II_FL_VARKEY);
855         CHECK_VALUE(II_FL_VARREC);
856         CHECK_VALUE(II_FL_NONUNQ);
857 }
858
859 static void
860 check_niobuf_remote(void)
861 {
862         BLANK_LINE();
863         CHECK_STRUCT(niobuf_remote);
864         CHECK_MEMBER(niobuf_remote, rnb_offset);
865         CHECK_MEMBER(niobuf_remote, rnb_len);
866         CHECK_MEMBER(niobuf_remote, rnb_flags);
867
868         CHECK_DEFINE_X(OBD_BRW_READ);
869         CHECK_DEFINE_X(OBD_BRW_WRITE);
870         CHECK_DEFINE_X(OBD_BRW_SYNC);
871         CHECK_DEFINE_X(OBD_BRW_CHECK);
872         CHECK_DEFINE_X(OBD_BRW_FROM_GRANT);
873         CHECK_DEFINE_X(OBD_BRW_GRANTED);
874         CHECK_DEFINE_X(OBD_BRW_NOCACHE);
875         CHECK_DEFINE_X(OBD_BRW_NOQUOTA);
876         CHECK_DEFINE_X(OBD_BRW_SRVLOCK);
877         CHECK_DEFINE_X(OBD_BRW_ASYNC);
878         CHECK_DEFINE_X(OBD_BRW_MEMALLOC);
879         CHECK_DEFINE_X(OBD_BRW_OVER_USRQUOTA);
880         CHECK_DEFINE_X(OBD_BRW_OVER_GRPQUOTA);
881         CHECK_DEFINE_X(OBD_BRW_SOFT_SYNC);
882 }
883
884 static void
885 check_ost_body(void)
886 {
887         BLANK_LINE();
888         CHECK_STRUCT(ost_body);
889         CHECK_MEMBER(ost_body, oa);
890 }
891
892 static void
893 check_ll_fid(void)
894 {
895         BLANK_LINE();
896         CHECK_STRUCT(ll_fid);
897         CHECK_MEMBER(ll_fid, id);
898         CHECK_MEMBER(ll_fid, generation);
899         CHECK_MEMBER(ll_fid, f_type);
900 }
901
902 static void
903 check_mdt_body(void)
904 {
905         BLANK_LINE();
906         CHECK_STRUCT(mdt_body);
907         CHECK_MEMBER(mdt_body, mbo_fid1);
908         CHECK_MEMBER(mdt_body, mbo_fid2);
909         CHECK_MEMBER(mdt_body, mbo_handle);
910         CHECK_MEMBER(mdt_body, mbo_valid);
911         CHECK_MEMBER(mdt_body, mbo_size);
912         CHECK_MEMBER(mdt_body, mbo_mtime);
913         CHECK_MEMBER(mdt_body, mbo_atime);
914         CHECK_MEMBER(mdt_body, mbo_ctime);
915         CHECK_MEMBER(mdt_body, mbo_blocks);
916         CHECK_MEMBER(mdt_body, mbo_t_state);
917         CHECK_MEMBER(mdt_body, mbo_fsuid);
918         CHECK_MEMBER(mdt_body, mbo_fsgid);
919         CHECK_MEMBER(mdt_body, mbo_capability);
920         CHECK_MEMBER(mdt_body, mbo_mode);
921         CHECK_MEMBER(mdt_body, mbo_uid);
922         CHECK_MEMBER(mdt_body, mbo_gid);
923         CHECK_MEMBER(mdt_body, mbo_flags);
924         CHECK_MEMBER(mdt_body, mbo_rdev);
925         CHECK_MEMBER(mdt_body, mbo_nlink);
926         CHECK_MEMBER(mdt_body, mbo_unused2);
927         CHECK_MEMBER(mdt_body, mbo_suppgid);
928         CHECK_MEMBER(mdt_body, mbo_eadatasize);
929         CHECK_MEMBER(mdt_body, mbo_aclsize);
930         CHECK_MEMBER(mdt_body, mbo_max_mdsize);
931         CHECK_MEMBER(mdt_body, mbo_max_cookiesize);
932         CHECK_MEMBER(mdt_body, mbo_uid_h);
933         CHECK_MEMBER(mdt_body, mbo_gid_h);
934         CHECK_MEMBER(mdt_body, mbo_padding_5);
935         CHECK_MEMBER(mdt_body, mbo_padding_6);
936         CHECK_MEMBER(mdt_body, mbo_padding_7);
937         CHECK_MEMBER(mdt_body, mbo_padding_8);
938         CHECK_MEMBER(mdt_body, mbo_padding_9);
939         CHECK_MEMBER(mdt_body, mbo_padding_10);
940
941         CHECK_VALUE_O(MDS_FMODE_CLOSED);
942         CHECK_VALUE_O(MDS_FMODE_EXEC);
943         CHECK_VALUE_O(MDS_FMODE_EPOCH);
944         CHECK_VALUE_O(MDS_FMODE_TRUNC);
945         CHECK_VALUE_O(MDS_FMODE_SOM);
946
947         CHECK_VALUE_O(MDS_OPEN_CREATED);
948         CHECK_VALUE_O(MDS_OPEN_CROSS);
949         CHECK_VALUE_O(MDS_OPEN_CREAT);
950         CHECK_VALUE_O(MDS_OPEN_EXCL);
951         CHECK_VALUE_O(MDS_OPEN_TRUNC);
952         CHECK_VALUE_O(MDS_OPEN_APPEND);
953         CHECK_VALUE_O(MDS_OPEN_SYNC);
954         CHECK_VALUE_O(MDS_OPEN_DIRECTORY);
955         CHECK_VALUE_O(MDS_OPEN_BY_FID);
956         CHECK_VALUE_O(MDS_OPEN_DELAY_CREATE);
957         CHECK_VALUE_O(MDS_OPEN_OWNEROVERRIDE);
958         CHECK_VALUE_O(MDS_OPEN_JOIN_FILE);
959         CHECK_VALUE_O(MDS_OPEN_LOCK);
960         CHECK_VALUE_O(MDS_OPEN_HAS_EA);
961         CHECK_VALUE_O(MDS_OPEN_HAS_OBJS);
962         CHECK_VALUE_64O(MDS_OPEN_NORESTORE);
963         CHECK_VALUE_64O(MDS_OPEN_NEWSTRIPE);
964         CHECK_VALUE_64O(MDS_OPEN_VOLATILE);
965
966         /* these should be identical to their EXT3_*_FL counterparts, and
967          * are redefined only to avoid dragging in ext3_fs.h */
968         CHECK_DEFINE_X(LUSTRE_SYNC_FL);
969         CHECK_DEFINE_X(LUSTRE_IMMUTABLE_FL);
970         CHECK_DEFINE_X(LUSTRE_APPEND_FL);
971         CHECK_DEFINE_X(LUSTRE_NOATIME_FL);
972         CHECK_DEFINE_X(LUSTRE_DIRSYNC_FL);
973
974         CHECK_DEFINE_X(MDS_INODELOCK_LOOKUP);
975         CHECK_DEFINE_X(MDS_INODELOCK_UPDATE);
976         CHECK_DEFINE_X(MDS_INODELOCK_OPEN);
977         CHECK_DEFINE_X(MDS_INODELOCK_LAYOUT);
978 }
979
980 static void
981 check_mdt_ioepoch(void)
982 {
983         BLANK_LINE();
984         CHECK_STRUCT(mdt_ioepoch);
985         CHECK_MEMBER(mdt_ioepoch, handle);
986         CHECK_MEMBER(mdt_ioepoch, ioepoch);
987         CHECK_MEMBER(mdt_ioepoch, flags);
988         CHECK_MEMBER(mdt_ioepoch, padding);
989 }
990
991 static void
992 check_mdt_remote_perm(void)
993 {
994         BLANK_LINE();
995         CHECK_STRUCT(mdt_remote_perm);
996         CHECK_MEMBER(mdt_remote_perm, rp_uid);
997         CHECK_MEMBER(mdt_remote_perm, rp_gid);
998         CHECK_MEMBER(mdt_remote_perm, rp_fsuid);
999         CHECK_MEMBER(mdt_remote_perm, rp_fsgid);
1000         CHECK_MEMBER(mdt_remote_perm, rp_access_perm);
1001         CHECK_MEMBER(mdt_remote_perm, rp_padding);
1002
1003         CHECK_VALUE_X(CFS_SETUID_PERM);
1004         CHECK_VALUE_X(CFS_SETGID_PERM);
1005         CHECK_VALUE_X(CFS_SETGRP_PERM);
1006         CHECK_VALUE_X(CFS_RMTACL_PERM);
1007         CHECK_VALUE_X(CFS_RMTOWN_PERM);
1008 }
1009
1010 static void
1011 check_mdt_rec_setattr(void)
1012 {
1013         BLANK_LINE();
1014         CHECK_STRUCT(mdt_rec_setattr);
1015         CHECK_MEMBER(mdt_rec_setattr, sa_opcode);
1016         CHECK_MEMBER(mdt_rec_setattr, sa_cap);
1017         CHECK_MEMBER(mdt_rec_setattr, sa_fsuid);
1018         CHECK_MEMBER(mdt_rec_setattr, sa_fsuid_h);
1019         CHECK_MEMBER(mdt_rec_setattr, sa_fsgid);
1020         CHECK_MEMBER(mdt_rec_setattr, sa_fsgid_h);
1021         CHECK_MEMBER(mdt_rec_setattr, sa_suppgid);
1022         CHECK_MEMBER(mdt_rec_setattr, sa_suppgid_h);
1023         CHECK_MEMBER(mdt_rec_setattr, sa_padding_1);
1024         CHECK_MEMBER(mdt_rec_setattr, sa_padding_1_h);
1025         CHECK_MEMBER(mdt_rec_setattr, sa_fid);
1026         CHECK_MEMBER(mdt_rec_setattr, sa_valid);
1027         CHECK_MEMBER(mdt_rec_setattr, sa_uid);
1028         CHECK_MEMBER(mdt_rec_setattr, sa_gid);
1029         CHECK_MEMBER(mdt_rec_setattr, sa_size);
1030         CHECK_MEMBER(mdt_rec_setattr, sa_blocks);
1031         CHECK_MEMBER(mdt_rec_setattr, sa_mtime);
1032         CHECK_MEMBER(mdt_rec_setattr, sa_atime);
1033         CHECK_MEMBER(mdt_rec_setattr, sa_ctime);
1034         CHECK_MEMBER(mdt_rec_setattr, sa_attr_flags);
1035         CHECK_MEMBER(mdt_rec_setattr, sa_mode);
1036         CHECK_MEMBER(mdt_rec_setattr, sa_bias);
1037         CHECK_MEMBER(mdt_rec_setattr, sa_padding_3);
1038         CHECK_MEMBER(mdt_rec_setattr, sa_padding_4);
1039         CHECK_MEMBER(mdt_rec_setattr, sa_padding_5);
1040 }
1041
1042 static void
1043 check_mdt_rec_create(void)
1044 {
1045         BLANK_LINE();
1046         CHECK_STRUCT(mdt_rec_create);
1047         CHECK_MEMBER(mdt_rec_create, cr_opcode);
1048         CHECK_MEMBER(mdt_rec_create, cr_cap);
1049         CHECK_MEMBER(mdt_rec_create, cr_fsuid);
1050         CHECK_MEMBER(mdt_rec_create, cr_fsuid_h);
1051         CHECK_MEMBER(mdt_rec_create, cr_fsgid);
1052         CHECK_MEMBER(mdt_rec_create, cr_fsgid_h);
1053         CHECK_MEMBER(mdt_rec_create, cr_suppgid1);
1054         CHECK_MEMBER(mdt_rec_create, cr_suppgid1_h);
1055         CHECK_MEMBER(mdt_rec_create, cr_suppgid2);
1056         CHECK_MEMBER(mdt_rec_create, cr_suppgid2_h);
1057         CHECK_MEMBER(mdt_rec_create, cr_fid1);
1058         CHECK_MEMBER(mdt_rec_create, cr_fid2);
1059         CHECK_MEMBER(mdt_rec_create, cr_old_handle);
1060         CHECK_MEMBER(mdt_rec_create, cr_time);
1061         CHECK_MEMBER(mdt_rec_create, cr_rdev);
1062         CHECK_MEMBER(mdt_rec_create, cr_ioepoch);
1063         CHECK_MEMBER(mdt_rec_create, cr_padding_1);
1064         CHECK_MEMBER(mdt_rec_create, cr_mode);
1065         CHECK_MEMBER(mdt_rec_create, cr_bias);
1066         CHECK_MEMBER(mdt_rec_create, cr_flags_l);
1067         CHECK_MEMBER(mdt_rec_create, cr_flags_h);
1068         CHECK_MEMBER(mdt_rec_create, cr_umask);
1069         CHECK_MEMBER(mdt_rec_create, cr_padding_4);
1070 }
1071
1072 static void
1073 check_mdt_rec_link(void)
1074 {
1075         BLANK_LINE();
1076         CHECK_STRUCT(mdt_rec_link);
1077         CHECK_MEMBER(mdt_rec_link, lk_opcode);
1078         CHECK_MEMBER(mdt_rec_link, lk_cap);
1079         CHECK_MEMBER(mdt_rec_link, lk_fsuid);
1080         CHECK_MEMBER(mdt_rec_link, lk_fsuid_h);
1081         CHECK_MEMBER(mdt_rec_link, lk_fsgid);
1082         CHECK_MEMBER(mdt_rec_link, lk_fsgid_h);
1083         CHECK_MEMBER(mdt_rec_link, lk_suppgid1);
1084         CHECK_MEMBER(mdt_rec_link, lk_suppgid1_h);
1085         CHECK_MEMBER(mdt_rec_link, lk_suppgid2);
1086         CHECK_MEMBER(mdt_rec_link, lk_suppgid2_h);
1087         CHECK_MEMBER(mdt_rec_link, lk_fid1);
1088         CHECK_MEMBER(mdt_rec_link, lk_fid2);
1089         CHECK_MEMBER(mdt_rec_link, lk_time);
1090         CHECK_MEMBER(mdt_rec_link, lk_padding_1);
1091         CHECK_MEMBER(mdt_rec_link, lk_padding_2);
1092         CHECK_MEMBER(mdt_rec_link, lk_padding_3);
1093         CHECK_MEMBER(mdt_rec_link, lk_padding_4);
1094         CHECK_MEMBER(mdt_rec_link, lk_bias);
1095         CHECK_MEMBER(mdt_rec_link, lk_padding_5);
1096         CHECK_MEMBER(mdt_rec_link, lk_padding_6);
1097         CHECK_MEMBER(mdt_rec_link, lk_padding_7);
1098         CHECK_MEMBER(mdt_rec_link, lk_padding_8);
1099         CHECK_MEMBER(mdt_rec_link, lk_padding_9);
1100 }
1101
1102 static void
1103 check_mdt_rec_unlink(void)
1104 {
1105         BLANK_LINE();
1106         CHECK_STRUCT(mdt_rec_unlink);
1107         CHECK_MEMBER(mdt_rec_unlink, ul_opcode);
1108         CHECK_MEMBER(mdt_rec_unlink, ul_cap);
1109         CHECK_MEMBER(mdt_rec_unlink, ul_fsuid);
1110         CHECK_MEMBER(mdt_rec_unlink, ul_fsuid_h);
1111         CHECK_MEMBER(mdt_rec_unlink, ul_fsgid);
1112         CHECK_MEMBER(mdt_rec_unlink, ul_fsgid_h);
1113         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid1);
1114         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid1_h);
1115         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid2);
1116         CHECK_MEMBER(mdt_rec_unlink, ul_suppgid2_h);
1117         CHECK_MEMBER(mdt_rec_unlink, ul_fid1);
1118         CHECK_MEMBER(mdt_rec_unlink, ul_fid2);
1119         CHECK_MEMBER(mdt_rec_unlink, ul_time);
1120         CHECK_MEMBER(mdt_rec_unlink, ul_padding_2);
1121         CHECK_MEMBER(mdt_rec_unlink, ul_padding_3);
1122         CHECK_MEMBER(mdt_rec_unlink, ul_padding_4);
1123         CHECK_MEMBER(mdt_rec_unlink, ul_padding_5);
1124         CHECK_MEMBER(mdt_rec_unlink, ul_bias);
1125         CHECK_MEMBER(mdt_rec_unlink, ul_mode);
1126         CHECK_MEMBER(mdt_rec_unlink, ul_padding_6);
1127         CHECK_MEMBER(mdt_rec_unlink, ul_padding_7);
1128         CHECK_MEMBER(mdt_rec_unlink, ul_padding_8);
1129         CHECK_MEMBER(mdt_rec_unlink, ul_padding_9);
1130 }
1131
1132 static void
1133 check_mdt_rec_rename(void)
1134 {
1135         BLANK_LINE();
1136         CHECK_STRUCT(mdt_rec_rename);
1137         CHECK_MEMBER(mdt_rec_rename, rn_opcode);
1138         CHECK_MEMBER(mdt_rec_rename, rn_cap);
1139         CHECK_MEMBER(mdt_rec_rename, rn_fsuid);
1140         CHECK_MEMBER(mdt_rec_rename, rn_fsuid_h);
1141         CHECK_MEMBER(mdt_rec_rename, rn_fsgid);
1142         CHECK_MEMBER(mdt_rec_rename, rn_fsgid_h);
1143         CHECK_MEMBER(mdt_rec_rename, rn_suppgid1);
1144         CHECK_MEMBER(mdt_rec_rename, rn_suppgid1_h);
1145         CHECK_MEMBER(mdt_rec_rename, rn_suppgid2);
1146         CHECK_MEMBER(mdt_rec_rename, rn_suppgid2_h);
1147         CHECK_MEMBER(mdt_rec_rename, rn_fid1);
1148         CHECK_MEMBER(mdt_rec_rename, rn_fid2);
1149         CHECK_MEMBER(mdt_rec_rename, rn_time);
1150         CHECK_MEMBER(mdt_rec_rename, rn_padding_1);
1151         CHECK_MEMBER(mdt_rec_rename, rn_padding_2);
1152         CHECK_MEMBER(mdt_rec_rename, rn_padding_3);
1153         CHECK_MEMBER(mdt_rec_rename, rn_padding_4);
1154         CHECK_MEMBER(mdt_rec_rename, rn_bias);
1155         CHECK_MEMBER(mdt_rec_rename, rn_mode);
1156         CHECK_MEMBER(mdt_rec_rename, rn_padding_5);
1157         CHECK_MEMBER(mdt_rec_rename, rn_padding_6);
1158         CHECK_MEMBER(mdt_rec_rename, rn_padding_7);
1159         CHECK_MEMBER(mdt_rec_rename, rn_padding_8);
1160 }
1161
1162 static void
1163 check_mdt_rec_setxattr(void)
1164 {
1165         BLANK_LINE();
1166         CHECK_STRUCT(mdt_rec_setxattr);
1167         CHECK_MEMBER(mdt_rec_setxattr, sx_opcode);
1168         CHECK_MEMBER(mdt_rec_setxattr, sx_cap);
1169         CHECK_MEMBER(mdt_rec_setxattr, sx_fsuid);
1170         CHECK_MEMBER(mdt_rec_setxattr, sx_fsuid_h);
1171         CHECK_MEMBER(mdt_rec_setxattr, sx_fsgid);
1172         CHECK_MEMBER(mdt_rec_setxattr, sx_fsgid_h);
1173         CHECK_MEMBER(mdt_rec_setxattr, sx_suppgid1);
1174         CHECK_MEMBER(mdt_rec_setxattr, sx_suppgid1_h);
1175         CHECK_MEMBER(mdt_rec_setxattr, sx_suppgid2);
1176         CHECK_MEMBER(mdt_rec_setxattr, sx_suppgid2_h);
1177         CHECK_MEMBER(mdt_rec_setxattr, sx_fid);
1178         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_1);
1179         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_2);
1180         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_3);
1181         CHECK_MEMBER(mdt_rec_setxattr, sx_valid);
1182         CHECK_MEMBER(mdt_rec_setxattr, sx_time);
1183         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_5);
1184         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_6);
1185         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_7);
1186         CHECK_MEMBER(mdt_rec_setxattr, sx_size);
1187         CHECK_MEMBER(mdt_rec_setxattr, sx_flags);
1188         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_8);
1189         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_9);
1190         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_10);
1191         CHECK_MEMBER(mdt_rec_setxattr, sx_padding_11);
1192 }
1193
1194 static void
1195 check_mdt_rec_reint(void)
1196 {
1197         BLANK_LINE();
1198         CHECK_STRUCT(mdt_rec_reint);
1199         CHECK_MEMBER(mdt_rec_reint, rr_opcode);
1200         CHECK_MEMBER(mdt_rec_reint, rr_cap);
1201         CHECK_MEMBER(mdt_rec_reint, rr_fsuid);
1202         CHECK_MEMBER(mdt_rec_reint, rr_fsuid_h);
1203         CHECK_MEMBER(mdt_rec_reint, rr_fsgid);
1204         CHECK_MEMBER(mdt_rec_reint, rr_fsgid_h);
1205         CHECK_MEMBER(mdt_rec_reint, rr_suppgid1);
1206         CHECK_MEMBER(mdt_rec_reint, rr_suppgid1_h);
1207         CHECK_MEMBER(mdt_rec_reint, rr_suppgid2);
1208         CHECK_MEMBER(mdt_rec_reint, rr_suppgid2_h);
1209         CHECK_MEMBER(mdt_rec_reint, rr_fid1);
1210         CHECK_MEMBER(mdt_rec_reint, rr_fid2);
1211         CHECK_MEMBER(mdt_rec_reint, rr_mtime);
1212         CHECK_MEMBER(mdt_rec_reint, rr_atime);
1213         CHECK_MEMBER(mdt_rec_reint, rr_ctime);
1214         CHECK_MEMBER(mdt_rec_reint, rr_size);
1215         CHECK_MEMBER(mdt_rec_reint, rr_blocks);
1216         CHECK_MEMBER(mdt_rec_reint, rr_bias);
1217         CHECK_MEMBER(mdt_rec_reint, rr_mode);
1218         CHECK_MEMBER(mdt_rec_reint, rr_flags);
1219         CHECK_MEMBER(mdt_rec_reint, rr_flags_h);
1220         CHECK_MEMBER(mdt_rec_reint, rr_umask);
1221         CHECK_MEMBER(mdt_rec_reint, rr_padding_4);
1222 }
1223
1224 static void
1225 check_lmv_desc(void)
1226 {
1227         BLANK_LINE();
1228         CHECK_STRUCT(lmv_desc);
1229         CHECK_MEMBER(lmv_desc, ld_tgt_count);
1230         CHECK_MEMBER(lmv_desc, ld_active_tgt_count);
1231         CHECK_MEMBER(lmv_desc, ld_default_stripe_count);
1232         CHECK_MEMBER(lmv_desc, ld_pattern);
1233         CHECK_MEMBER(lmv_desc, ld_default_hash_size);
1234         CHECK_MEMBER(lmv_desc, ld_padding_1);
1235         CHECK_MEMBER(lmv_desc, ld_padding_2);
1236         CHECK_MEMBER(lmv_desc, ld_qos_maxage);
1237         CHECK_MEMBER(lmv_desc, ld_padding_3);
1238         CHECK_MEMBER(lmv_desc, ld_padding_4);
1239         CHECK_MEMBER(lmv_desc, ld_uuid);
1240 }
1241
1242 static void
1243 check_lov_desc(void)
1244 {
1245         BLANK_LINE();
1246         CHECK_STRUCT(lov_desc);
1247         CHECK_MEMBER(lov_desc, ld_tgt_count);
1248         CHECK_MEMBER(lov_desc, ld_active_tgt_count);
1249         CHECK_MEMBER(lov_desc, ld_default_stripe_count);
1250         CHECK_MEMBER(lov_desc, ld_pattern);
1251         CHECK_MEMBER(lov_desc, ld_default_stripe_size);
1252         CHECK_MEMBER(lov_desc, ld_default_stripe_offset);
1253         CHECK_MEMBER(lov_desc, ld_padding_0);
1254         CHECK_MEMBER(lov_desc, ld_qos_maxage);
1255         CHECK_MEMBER(lov_desc, ld_padding_1);
1256         CHECK_MEMBER(lov_desc, ld_padding_2);
1257         CHECK_MEMBER(lov_desc, ld_uuid);
1258
1259         CHECK_CDEFINE(LOV_DESC_MAGIC);
1260 }
1261
1262 static void
1263 check_ldlm_res_id(void)
1264 {
1265         BLANK_LINE();
1266         CHECK_STRUCT(ldlm_res_id);
1267         CHECK_CVALUE(RES_NAME_SIZE);
1268         CHECK_MEMBER(ldlm_res_id, name[RES_NAME_SIZE]);
1269 }
1270
1271 static void
1272 check_ldlm_extent(void)
1273 {
1274         BLANK_LINE();
1275         CHECK_STRUCT(ldlm_extent);
1276         CHECK_MEMBER(ldlm_extent, start);
1277         CHECK_MEMBER(ldlm_extent, end);
1278         CHECK_MEMBER(ldlm_extent, gid);
1279 }
1280
1281 static void
1282 check_ldlm_inodebits(void)
1283 {
1284         BLANK_LINE();
1285         CHECK_STRUCT(ldlm_inodebits);
1286         CHECK_MEMBER(ldlm_inodebits, bits);
1287 }
1288
1289 static void
1290 check_ldlm_flock(void)
1291 {
1292         BLANK_LINE();
1293         CHECK_STRUCT(ldlm_flock_wire);
1294         CHECK_MEMBER(ldlm_flock_wire, lfw_start);
1295         CHECK_MEMBER(ldlm_flock_wire, lfw_end);
1296         CHECK_MEMBER(ldlm_flock_wire, lfw_owner);
1297         CHECK_MEMBER(ldlm_flock_wire, lfw_padding);
1298         CHECK_MEMBER(ldlm_flock_wire, lfw_pid);
1299 }
1300
1301 static void
1302 check_ldlm_intent(void)
1303 {
1304         BLANK_LINE();
1305         CHECK_STRUCT(ldlm_intent);
1306         CHECK_MEMBER(ldlm_intent, opc);
1307 }
1308
1309 static void
1310 check_ldlm_resource_desc(void)
1311 {
1312         BLANK_LINE();
1313         CHECK_STRUCT(ldlm_resource_desc);
1314         CHECK_MEMBER(ldlm_resource_desc, lr_type);
1315         CHECK_MEMBER(ldlm_resource_desc, lr_padding);
1316         CHECK_MEMBER(ldlm_resource_desc, lr_name);
1317 }
1318
1319 static void
1320 check_ldlm_lock_desc(void)
1321 {
1322         BLANK_LINE();
1323         CHECK_STRUCT(ldlm_lock_desc);
1324         CHECK_MEMBER(ldlm_lock_desc, l_resource);
1325         CHECK_MEMBER(ldlm_lock_desc, l_req_mode);
1326         CHECK_MEMBER(ldlm_lock_desc, l_granted_mode);
1327         CHECK_MEMBER(ldlm_lock_desc, l_policy_data);
1328 }
1329
1330 static void
1331 check_ldlm_request(void)
1332 {
1333         BLANK_LINE();
1334         CHECK_STRUCT(ldlm_request);
1335         CHECK_MEMBER(ldlm_request, lock_flags);
1336         CHECK_MEMBER(ldlm_request, lock_count);
1337         CHECK_MEMBER(ldlm_request, lock_desc);
1338         CHECK_MEMBER(ldlm_request, lock_handle);
1339 }
1340
1341 static void
1342 check_ldlm_reply(void)
1343 {
1344         BLANK_LINE();
1345         CHECK_STRUCT(ldlm_reply);
1346         CHECK_MEMBER(ldlm_reply, lock_flags);
1347         CHECK_MEMBER(ldlm_reply, lock_padding);
1348         CHECK_MEMBER(ldlm_reply, lock_desc);
1349         CHECK_MEMBER(ldlm_reply, lock_handle);
1350         CHECK_MEMBER(ldlm_reply, lock_policy_res1);
1351         CHECK_MEMBER(ldlm_reply, lock_policy_res2);
1352 }
1353
1354 static void
1355 check_ldlm_ost_lvb_v1(void)
1356 {
1357         BLANK_LINE();
1358         CHECK_STRUCT(ost_lvb_v1);
1359         CHECK_MEMBER(ost_lvb_v1, lvb_size);
1360         CHECK_MEMBER(ost_lvb_v1, lvb_mtime);
1361         CHECK_MEMBER(ost_lvb_v1, lvb_atime);
1362         CHECK_MEMBER(ost_lvb_v1, lvb_ctime);
1363         CHECK_MEMBER(ost_lvb_v1, lvb_blocks);
1364 }
1365
1366 static void
1367 check_ldlm_ost_lvb(void)
1368 {
1369         BLANK_LINE();
1370         CHECK_STRUCT(ost_lvb);
1371         CHECK_MEMBER(ost_lvb, lvb_size);
1372         CHECK_MEMBER(ost_lvb, lvb_mtime);
1373         CHECK_MEMBER(ost_lvb, lvb_atime);
1374         CHECK_MEMBER(ost_lvb, lvb_ctime);
1375         CHECK_MEMBER(ost_lvb, lvb_blocks);
1376         CHECK_MEMBER(ost_lvb, lvb_mtime_ns);
1377         CHECK_MEMBER(ost_lvb, lvb_atime_ns);
1378         CHECK_MEMBER(ost_lvb, lvb_ctime_ns);
1379         CHECK_MEMBER(ost_lvb, lvb_padding);
1380 }
1381
1382 static void
1383 check_ldlm_lquota_lvb(void)
1384 {
1385         BLANK_LINE();
1386         CHECK_STRUCT(lquota_lvb);
1387         CHECK_MEMBER(lquota_lvb, lvb_flags);
1388         CHECK_MEMBER(lquota_lvb, lvb_id_may_rel);
1389         CHECK_MEMBER(lquota_lvb, lvb_id_rel);
1390         CHECK_MEMBER(lquota_lvb, lvb_id_qunit);
1391         CHECK_MEMBER(lquota_lvb, lvb_pad1);
1392         CHECK_VALUE(LQUOTA_FL_EDQUOT);
1393 }
1394
1395 static void
1396 check_ldlm_gl_lquota_desc(void)
1397 {
1398         BLANK_LINE();
1399         CHECK_STRUCT(ldlm_gl_lquota_desc);
1400         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_id);
1401         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_flags);
1402         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_ver);
1403         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_hardlimit);
1404         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_softlimit);
1405         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_time);
1406         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_pad2);
1407 }
1408
1409
1410 static void
1411 check_mgs_send_param(void)
1412 {
1413         BLANK_LINE();
1414         CHECK_STRUCT(mgs_send_param);
1415         CHECK_CVALUE(MGS_PARAM_MAXLEN);
1416         CHECK_MEMBER(mgs_send_param, mgs_param[MGS_PARAM_MAXLEN]);
1417 }
1418
1419 static void
1420 check_cfg_marker(void)
1421 {
1422         BLANK_LINE();
1423         CHECK_STRUCT(cfg_marker);
1424         CHECK_MEMBER(cfg_marker, cm_step);
1425         CHECK_MEMBER(cfg_marker, cm_flags);
1426         CHECK_MEMBER(cfg_marker, cm_vers);
1427         CHECK_MEMBER(cfg_marker, cm_padding);
1428         CHECK_MEMBER(cfg_marker, cm_createtime);
1429         CHECK_MEMBER(cfg_marker, cm_canceltime);
1430         CHECK_MEMBER(cfg_marker, cm_tgtname);
1431         CHECK_MEMBER(cfg_marker, cm_comment);
1432 }
1433
1434 static void
1435 check_llog_logid(void)
1436 {
1437         BLANK_LINE();
1438         CHECK_STRUCT(llog_logid);
1439         CHECK_MEMBER(llog_logid, lgl_oi);
1440         CHECK_MEMBER(llog_logid, lgl_ogen);
1441
1442         CHECK_CVALUE(OST_SZ_REC);
1443         CHECK_CVALUE(MDS_UNLINK_REC);
1444         CHECK_CVALUE(MDS_UNLINK64_REC);
1445         CHECK_CVALUE(MDS_SETATTR64_REC);
1446         CHECK_CVALUE(OBD_CFG_REC);
1447         CHECK_CVALUE(LLOG_GEN_REC);
1448         CHECK_CVALUE(CHANGELOG_REC);
1449         CHECK_CVALUE(CHANGELOG_USER_REC);
1450         CHECK_CVALUE(LLOG_HDR_MAGIC);
1451         CHECK_CVALUE(LLOG_LOGID_MAGIC);
1452 }
1453
1454 static void
1455 check_llog_catid(void)
1456 {
1457         BLANK_LINE();
1458         CHECK_STRUCT(llog_catid);
1459         CHECK_MEMBER(llog_catid, lci_logid);
1460         CHECK_MEMBER(llog_catid, lci_padding1);
1461         CHECK_MEMBER(llog_catid, lci_padding2);
1462         CHECK_MEMBER(llog_catid, lci_padding3);
1463 }
1464
1465 static void
1466 check_llog_rec_hdr(void)
1467 {
1468         BLANK_LINE();
1469         CHECK_STRUCT(llog_rec_hdr);
1470         CHECK_MEMBER(llog_rec_hdr, lrh_len);
1471         CHECK_MEMBER(llog_rec_hdr, lrh_index);
1472         CHECK_MEMBER(llog_rec_hdr, lrh_type);
1473         CHECK_MEMBER(llog_rec_hdr, lrh_id);
1474 }
1475
1476 static void
1477 check_llog_rec_tail(void)
1478 {
1479         BLANK_LINE();
1480         CHECK_STRUCT(llog_rec_tail);
1481         CHECK_MEMBER(llog_rec_tail, lrt_len);
1482         CHECK_MEMBER(llog_rec_tail, lrt_index);
1483 }
1484
1485 static void
1486 check_llog_logid_rec(void)
1487 {
1488         BLANK_LINE();
1489         CHECK_STRUCT(llog_logid_rec);
1490         CHECK_MEMBER(llog_logid_rec, lid_hdr);
1491         CHECK_MEMBER(llog_logid_rec, lid_id);
1492         CHECK_MEMBER(llog_logid_rec, lid_padding1);
1493         CHECK_MEMBER(llog_logid_rec, lid_padding2);
1494         CHECK_MEMBER(llog_logid_rec, lid_padding3);
1495         CHECK_MEMBER(llog_logid_rec, lid_tail);
1496 }
1497
1498 static void
1499 check_llog_unlink_rec(void)
1500 {
1501         BLANK_LINE();
1502         CHECK_STRUCT(llog_unlink_rec);
1503         CHECK_MEMBER(llog_unlink_rec, lur_hdr);
1504         CHECK_MEMBER(llog_unlink_rec, lur_oid);
1505         CHECK_MEMBER(llog_unlink_rec, lur_oseq);
1506         CHECK_MEMBER(llog_unlink_rec, lur_count);
1507         CHECK_MEMBER(llog_unlink_rec, lur_tail);
1508 }
1509
1510 static void
1511 check_llog_unlink64_rec(void)
1512 {
1513         CHECK_STRUCT(llog_unlink64_rec);
1514         CHECK_MEMBER(llog_unlink64_rec, lur_hdr);
1515         CHECK_MEMBER(llog_unlink64_rec, lur_fid);
1516         CHECK_MEMBER(llog_unlink64_rec, lur_count);
1517         CHECK_MEMBER(llog_unlink64_rec, lur_tail);
1518         CHECK_MEMBER(llog_unlink64_rec, lur_padding1);
1519         CHECK_MEMBER(llog_unlink64_rec, lur_padding2);
1520         CHECK_MEMBER(llog_unlink64_rec, lur_padding3);
1521 }
1522
1523 static void
1524 check_llog_setattr64_rec(void)
1525 {
1526         BLANK_LINE();
1527         CHECK_STRUCT(llog_setattr64_rec);
1528         CHECK_MEMBER(llog_setattr64_rec, lsr_hdr);
1529         CHECK_MEMBER(llog_setattr64_rec, lsr_oi);
1530         CHECK_MEMBER(llog_setattr64_rec, lsr_uid);
1531         CHECK_MEMBER(llog_setattr64_rec, lsr_uid_h);
1532         CHECK_MEMBER(llog_setattr64_rec, lsr_gid);
1533         CHECK_MEMBER(llog_setattr64_rec, lsr_gid_h);
1534         CHECK_MEMBER(llog_setattr64_rec, lsr_valid);
1535         CHECK_MEMBER(llog_setattr64_rec, lsr_tail);
1536 }
1537
1538 static void
1539 check_llog_size_change_rec(void)
1540 {
1541         BLANK_LINE();
1542         CHECK_STRUCT(llog_size_change_rec);
1543         CHECK_MEMBER(llog_size_change_rec, lsc_hdr);
1544         CHECK_MEMBER(llog_size_change_rec, lsc_fid);
1545         CHECK_MEMBER(llog_size_change_rec, lsc_ioepoch);
1546         CHECK_MEMBER(llog_size_change_rec, lsc_padding1);
1547         CHECK_MEMBER(llog_size_change_rec, lsc_padding2);
1548         CHECK_MEMBER(llog_size_change_rec, lsc_padding3);
1549         CHECK_MEMBER(llog_size_change_rec, lsc_tail);
1550 }
1551
1552 static void
1553 check_changelog_rec(void)
1554 {
1555         BLANK_LINE();
1556         CHECK_STRUCT(changelog_rec);
1557         CHECK_MEMBER(changelog_rec, cr_namelen);
1558         CHECK_MEMBER(changelog_rec, cr_flags);
1559         CHECK_MEMBER(changelog_rec, cr_type);
1560         CHECK_MEMBER(changelog_rec, cr_index);
1561         CHECK_MEMBER(changelog_rec, cr_prev);
1562         CHECK_MEMBER(changelog_rec, cr_time);
1563         CHECK_MEMBER(changelog_rec, cr_tfid);
1564         CHECK_MEMBER(changelog_rec, cr_pfid);
1565 }
1566
1567 static void
1568 check_changelog_ext_rename(void)
1569 {
1570         BLANK_LINE();
1571         CHECK_STRUCT(changelog_ext_rename);
1572         CHECK_MEMBER(changelog_ext_rename, cr_sfid);
1573         CHECK_MEMBER(changelog_ext_rename, cr_spfid);
1574 }
1575
1576 static void
1577 check_changelog_ext_jobid(void)
1578 {
1579         BLANK_LINE();
1580         CHECK_STRUCT(changelog_ext_jobid);
1581         CHECK_MEMBER(changelog_ext_jobid, cr_jobid);
1582 }
1583
1584 static void
1585 check_changelog_setinfo(void)
1586 {
1587         BLANK_LINE();
1588         CHECK_STRUCT(changelog_setinfo);
1589         CHECK_MEMBER(changelog_setinfo, cs_recno);
1590         CHECK_MEMBER(changelog_setinfo, cs_id);
1591 }
1592
1593 static void
1594 check_llog_changelog_rec(void)
1595 {
1596         BLANK_LINE();
1597         CHECK_STRUCT(llog_changelog_rec);
1598         CHECK_MEMBER(llog_changelog_rec, cr_hdr);
1599         CHECK_MEMBER(llog_changelog_rec, cr);
1600         CHECK_MEMBER(llog_changelog_rec, cr_do_not_use);
1601 }
1602
1603 static void
1604 check_llog_changelog_user_rec(void)
1605 {
1606         BLANK_LINE();
1607         CHECK_STRUCT(llog_changelog_user_rec);
1608         CHECK_MEMBER(llog_changelog_user_rec, cur_hdr);
1609         CHECK_MEMBER(llog_changelog_user_rec, cur_id);
1610         CHECK_MEMBER(llog_changelog_user_rec, cur_padding);
1611         CHECK_MEMBER(llog_changelog_user_rec, cur_endrec);
1612         CHECK_MEMBER(llog_changelog_user_rec, cur_tail);
1613 }
1614
1615 static void
1616 check_llog_gen(void)
1617 {
1618         BLANK_LINE();
1619         CHECK_STRUCT(llog_gen);
1620         CHECK_MEMBER(llog_gen, mnt_cnt);
1621         CHECK_MEMBER(llog_gen, conn_cnt);
1622 }
1623
1624 static void
1625 check_llog_gen_rec(void)
1626 {
1627         BLANK_LINE();
1628         CHECK_STRUCT(llog_gen_rec);
1629         CHECK_MEMBER(llog_gen_rec, lgr_hdr);
1630         CHECK_MEMBER(llog_gen_rec, lgr_gen);
1631         CHECK_MEMBER(llog_gen_rec, lgr_tail);
1632 }
1633
1634 static void
1635 check_llog_log_hdr(void)
1636 {
1637         BLANK_LINE();
1638         CHECK_STRUCT(llog_log_hdr);
1639         CHECK_MEMBER(llog_log_hdr, llh_hdr);
1640         CHECK_MEMBER(llog_log_hdr, llh_timestamp);
1641         CHECK_MEMBER(llog_log_hdr, llh_count);
1642         CHECK_MEMBER(llog_log_hdr, llh_bitmap_offset);
1643         CHECK_MEMBER(llog_log_hdr, llh_size);
1644         CHECK_MEMBER(llog_log_hdr, llh_flags);
1645         CHECK_MEMBER(llog_log_hdr, llh_cat_idx);
1646         CHECK_MEMBER(llog_log_hdr, llh_tgtuuid);
1647         CHECK_MEMBER(llog_log_hdr, llh_reserved);
1648         CHECK_MEMBER(llog_log_hdr, llh_bitmap);
1649         CHECK_MEMBER(llog_log_hdr, llh_tail);
1650 }
1651
1652 static void
1653 check_llog_cookie(void)
1654 {
1655         BLANK_LINE();
1656         CHECK_STRUCT(llog_cookie);
1657         CHECK_MEMBER(llog_cookie, lgc_lgl);
1658         CHECK_MEMBER(llog_cookie, lgc_subsys);
1659         CHECK_MEMBER(llog_cookie, lgc_index);
1660         CHECK_MEMBER(llog_cookie, lgc_padding);
1661 }
1662
1663 static void
1664 check_llogd_body(void)
1665 {
1666         BLANK_LINE();
1667         CHECK_STRUCT(llogd_body);
1668         CHECK_MEMBER(llogd_body, lgd_logid);
1669         CHECK_MEMBER(llogd_body, lgd_ctxt_idx);
1670         CHECK_MEMBER(llogd_body, lgd_llh_flags);
1671         CHECK_MEMBER(llogd_body, lgd_index);
1672         CHECK_MEMBER(llogd_body, lgd_saved_index);
1673         CHECK_MEMBER(llogd_body, lgd_len);
1674         CHECK_MEMBER(llogd_body, lgd_cur_offset);
1675
1676         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_CREATE);
1677         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
1678         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_READ_HEADER);
1679         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_WRITE_REC);
1680         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_CLOSE);
1681         CHECK_CVALUE(LLOG_ORIGIN_CONNECT);
1682         CHECK_CVALUE(LLOG_CATINFO);
1683         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_PREV_BLOCK);
1684         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_DESTROY);
1685         CHECK_CVALUE(LLOG_FIRST_OPC);
1686         CHECK_CVALUE(LLOG_LAST_OPC);
1687
1688         CHECK_CVALUE(LLOG_CONFIG_ORIG_CTXT);
1689         CHECK_CVALUE(LLOG_CONFIG_REPL_CTXT);
1690         CHECK_CVALUE(LLOG_MDS_OST_ORIG_CTXT);
1691         CHECK_CVALUE(LLOG_MDS_OST_REPL_CTXT);
1692         CHECK_CVALUE(LLOG_SIZE_ORIG_CTXT);
1693         CHECK_CVALUE(LLOG_SIZE_REPL_CTXT);
1694         CHECK_CVALUE(LLOG_TEST_ORIG_CTXT);
1695         CHECK_CVALUE(LLOG_TEST_REPL_CTXT);
1696         CHECK_CVALUE(LLOG_CHANGELOG_ORIG_CTXT);
1697         CHECK_CVALUE(LLOG_CHANGELOG_REPL_CTXT);
1698         CHECK_CVALUE(LLOG_CHANGELOG_USER_ORIG_CTXT);
1699         CHECK_CVALUE(LLOG_AGENT_ORIG_CTXT);
1700         CHECK_CVALUE(LLOG_MAX_CTXTS);
1701 }
1702
1703 static void
1704 check_llogd_conn_body(void)
1705 {
1706         BLANK_LINE();
1707         CHECK_STRUCT(llogd_conn_body);
1708         CHECK_MEMBER(llogd_conn_body, lgdc_gen);
1709         CHECK_MEMBER(llogd_conn_body, lgdc_logid);
1710         CHECK_MEMBER(llogd_conn_body, lgdc_ctxt_idx);
1711 }
1712
1713 static void
1714 check_ll_fiemap_info_key(void)
1715 {
1716         BLANK_LINE();
1717         CHECK_STRUCT(ll_fiemap_info_key);
1718         CHECK_MEMBER(ll_fiemap_info_key, name[8]);
1719         CHECK_MEMBER(ll_fiemap_info_key, oa);
1720         CHECK_MEMBER(ll_fiemap_info_key, fiemap);
1721 }
1722
1723 static void
1724 check_quota_body(void)
1725 {
1726         BLANK_LINE();
1727         CHECK_STRUCT(quota_body);
1728         CHECK_MEMBER(quota_body, qb_fid);
1729         CHECK_MEMBER(quota_body, qb_id);
1730         CHECK_MEMBER(quota_body, qb_flags);
1731         CHECK_MEMBER(quota_body, qb_padding);
1732         CHECK_MEMBER(quota_body, qb_count);
1733         CHECK_MEMBER(quota_body, qb_usage);
1734         CHECK_MEMBER(quota_body, qb_slv_ver);
1735         CHECK_MEMBER(quota_body, qb_lockh);
1736         CHECK_MEMBER(quota_body, qb_glb_lockh);
1737         CHECK_MEMBER(quota_body, qb_padding1[4]);
1738 }
1739
1740 static void
1741 check_mgs_target_info(void)
1742 {
1743         BLANK_LINE();
1744         CHECK_STRUCT(mgs_target_info);
1745         CHECK_MEMBER(mgs_target_info, mti_lustre_ver);
1746         CHECK_MEMBER(mgs_target_info, mti_stripe_index);
1747         CHECK_MEMBER(mgs_target_info, mti_config_ver);
1748         CHECK_MEMBER(mgs_target_info, mti_flags);
1749         CHECK_MEMBER(mgs_target_info, mti_nid_count);
1750         CHECK_MEMBER(mgs_target_info, mti_instance);
1751         CHECK_MEMBER(mgs_target_info, mti_fsname);
1752         CHECK_MEMBER(mgs_target_info, mti_svname);
1753         CHECK_MEMBER(mgs_target_info, mti_uuid);
1754         CHECK_MEMBER(mgs_target_info, mti_nids);
1755         CHECK_MEMBER(mgs_target_info, mti_params);
1756 }
1757
1758 static void
1759 check_lustre_capa(void)
1760 {
1761         BLANK_LINE();
1762         CHECK_STRUCT(lustre_capa);
1763         CHECK_MEMBER(lustre_capa, lc_fid);
1764         CHECK_MEMBER(lustre_capa, lc_opc);
1765         CHECK_MEMBER(lustre_capa, lc_uid);
1766         CHECK_MEMBER(lustre_capa, lc_gid);
1767         CHECK_MEMBER(lustre_capa, lc_flags);
1768         CHECK_MEMBER(lustre_capa, lc_keyid);
1769         CHECK_MEMBER(lustre_capa, lc_timeout);
1770         CHECK_MEMBER(lustre_capa, lc_expiry);
1771         CHECK_CVALUE(CAPA_HMAC_MAX_LEN);
1772         CHECK_MEMBER(lustre_capa, lc_hmac[CAPA_HMAC_MAX_LEN]);
1773 }
1774
1775 static void
1776 check_lustre_capa_key(void)
1777 {
1778         BLANK_LINE();
1779         CHECK_STRUCT(lustre_capa_key);
1780         CHECK_MEMBER(lustre_capa_key, lk_seq);
1781         CHECK_MEMBER(lustre_capa_key, lk_keyid);
1782         CHECK_MEMBER(lustre_capa_key, lk_padding);
1783         CHECK_CVALUE(CAPA_HMAC_KEY_MAX_LEN);
1784         CHECK_MEMBER(lustre_capa_key, lk_key[CAPA_HMAC_KEY_MAX_LEN]);
1785 }
1786
1787 static void
1788 check_getinfo_fid2path(void)
1789 {
1790         BLANK_LINE();
1791         CHECK_STRUCT(getinfo_fid2path);
1792         CHECK_MEMBER(getinfo_fid2path, gf_fid);
1793         CHECK_MEMBER(getinfo_fid2path, gf_recno);
1794         CHECK_MEMBER(getinfo_fid2path, gf_linkno);
1795         CHECK_MEMBER(getinfo_fid2path, gf_pathlen);
1796         CHECK_MEMBER(getinfo_fid2path, gf_path[0]);
1797 }
1798
1799 /* We don't control the definitions of posix_acl_xattr_{entry,header}
1800  * and so we shouldn't have used them in our wire protocol. But it's
1801  * too late now and so we emit checks against the *fixed* definitions
1802  * below. See LU-5607. */
1803
1804 typedef struct {
1805         __u16                   e_tag;
1806         __u16                   e_perm;
1807         __u32                   e_id;
1808 } posix_acl_xattr_entry;
1809
1810 typedef struct {
1811         __u32                   a_version;
1812         posix_acl_xattr_entry   a_entries[0];
1813 } posix_acl_xattr_header;
1814
1815 static void
1816 check_posix_acl_xattr_entry(void)
1817 {
1818         BLANK_LINE();
1819         printf("#ifdef CONFIG_FS_POSIX_ACL\n");
1820         CHECK_STRUCT_TYPEDEF(posix_acl_xattr_entry);
1821         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_tag);
1822         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_perm);
1823         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_id);
1824         printf("#endif /* CONFIG_FS_POSIX_ACL */\n");
1825 }
1826
1827 static void
1828 check_posix_acl_xattr_header(void)
1829 {
1830         BLANK_LINE();
1831         printf("#ifdef CONFIG_FS_POSIX_ACL\n");
1832         CHECK_STRUCT_TYPEDEF(posix_acl_xattr_header);
1833         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_version);
1834         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_entries);
1835         printf("#endif /* CONFIG_FS_POSIX_ACL */\n");
1836 }
1837
1838 static void
1839 check_ll_user_fiemap(void)
1840 {
1841         BLANK_LINE();
1842         CHECK_STRUCT(ll_user_fiemap);
1843         CHECK_MEMBER(ll_user_fiemap, fm_start);
1844         CHECK_MEMBER(ll_user_fiemap, fm_length);
1845         CHECK_MEMBER(ll_user_fiemap, fm_flags);
1846         CHECK_MEMBER(ll_user_fiemap, fm_mapped_extents);
1847         CHECK_MEMBER(ll_user_fiemap, fm_extent_count);
1848         CHECK_MEMBER(ll_user_fiemap, fm_reserved);
1849         CHECK_MEMBER(ll_user_fiemap, fm_extents);
1850
1851         CHECK_CDEFINE(FIEMAP_FLAG_SYNC);
1852         CHECK_CDEFINE(FIEMAP_FLAG_XATTR);
1853         CHECK_CDEFINE(FIEMAP_FLAG_DEVICE_ORDER);
1854 }
1855
1856 static void
1857 check_ll_fiemap_extent(void)
1858 {
1859         BLANK_LINE();
1860         CHECK_STRUCT(ll_fiemap_extent);
1861         CHECK_MEMBER(ll_fiemap_extent, fe_logical);
1862         CHECK_MEMBER(ll_fiemap_extent, fe_physical);
1863         CHECK_MEMBER(ll_fiemap_extent, fe_length);
1864         CHECK_MEMBER(ll_fiemap_extent, fe_flags);
1865         CHECK_MEMBER(ll_fiemap_extent, fe_device);
1866
1867         CHECK_CDEFINE(FIEMAP_EXTENT_LAST);
1868         CHECK_CDEFINE(FIEMAP_EXTENT_UNKNOWN);
1869         CHECK_CDEFINE(FIEMAP_EXTENT_DELALLOC);
1870         CHECK_CDEFINE(FIEMAP_EXTENT_ENCODED);
1871         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_ENCRYPTED);
1872         CHECK_CDEFINE(FIEMAP_EXTENT_NOT_ALIGNED);
1873         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_INLINE);
1874         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_TAIL);
1875         CHECK_CDEFINE(FIEMAP_EXTENT_UNWRITTEN);
1876         CHECK_CDEFINE(FIEMAP_EXTENT_MERGED);
1877         CHECK_CDEFINE(FIEMAP_EXTENT_NO_DIRECT);
1878         CHECK_CDEFINE(FIEMAP_EXTENT_NET);
1879 }
1880
1881 static void
1882 check_link_ea_header(void)
1883 {
1884         BLANK_LINE();
1885         CHECK_STRUCT(link_ea_header);
1886         CHECK_MEMBER(link_ea_header, leh_magic);
1887         CHECK_MEMBER(link_ea_header, leh_reccount);
1888         CHECK_MEMBER(link_ea_header, leh_len);
1889         CHECK_MEMBER(link_ea_header, padding1);
1890         CHECK_MEMBER(link_ea_header, padding2);
1891
1892         CHECK_CDEFINE(LINK_EA_MAGIC);
1893 }
1894
1895 static void
1896 check_link_ea_entry(void)
1897 {
1898         BLANK_LINE();
1899         CHECK_STRUCT(link_ea_entry);
1900         CHECK_MEMBER(link_ea_entry, lee_reclen);
1901         CHECK_MEMBER(link_ea_entry, lee_parent_fid);
1902         CHECK_MEMBER(link_ea_entry, lee_name);
1903 }
1904
1905 static void
1906 check_hsm_user_item(void)
1907 {
1908         BLANK_LINE();
1909         CHECK_STRUCT(hsm_user_item);
1910         CHECK_MEMBER(hsm_user_item, hui_fid);
1911         CHECK_MEMBER(hsm_user_item, hui_extent);
1912 }
1913
1914 static void
1915 check_hsm_user_state(void)
1916 {
1917         BLANK_LINE();
1918         CHECK_STRUCT(hsm_user_state);
1919         CHECK_MEMBER(hsm_user_state, hus_states);
1920         CHECK_MEMBER(hsm_user_state, hus_archive_id);
1921         CHECK_MEMBER(hsm_user_state, hus_in_progress_state);
1922         CHECK_MEMBER(hsm_user_state, hus_in_progress_action);
1923         CHECK_MEMBER(hsm_user_state, hus_in_progress_location);
1924 }
1925
1926 static void
1927 check_hsm_action_item(void)
1928 {
1929         BLANK_LINE();
1930         CHECK_STRUCT(hsm_action_item);
1931         CHECK_MEMBER(hsm_action_item, hai_len);
1932         CHECK_MEMBER(hsm_action_item, hai_action);
1933         CHECK_MEMBER(hsm_action_item, hai_fid);
1934         CHECK_MEMBER(hsm_action_item, hai_dfid);
1935         CHECK_MEMBER(hsm_action_item, hai_extent);
1936         CHECK_MEMBER(hsm_action_item, hai_cookie);
1937         CHECK_MEMBER(hsm_action_item, hai_gid);
1938         CHECK_MEMBER(hsm_action_item, hai_data);
1939 }
1940
1941 static void
1942 check_hsm_action_list(void)
1943 {
1944         BLANK_LINE();
1945         CHECK_STRUCT(hsm_action_list);
1946         CHECK_MEMBER(hsm_action_list, hal_version);
1947         CHECK_MEMBER(hsm_action_list, hal_count);
1948         CHECK_MEMBER(hsm_action_list, hal_compound_id);
1949         CHECK_MEMBER(hsm_action_list, hal_flags);
1950         CHECK_MEMBER(hsm_action_list, hal_archive_id);
1951         CHECK_MEMBER(hsm_action_list, padding1);
1952         CHECK_MEMBER(hsm_action_list, hal_fsname);
1953 }
1954
1955 static void
1956 check_hsm_progress_kernel(void)
1957 {
1958         BLANK_LINE();
1959         CHECK_STRUCT(hsm_progress_kernel);
1960         CHECK_MEMBER(hsm_progress_kernel, hpk_fid);
1961         CHECK_MEMBER(hsm_progress_kernel, hpk_cookie);
1962         CHECK_MEMBER(hsm_progress_kernel, hpk_extent);
1963         CHECK_MEMBER(hsm_progress_kernel, hpk_flags);
1964         CHECK_MEMBER(hsm_progress_kernel, hpk_errval);
1965         CHECK_MEMBER(hsm_progress_kernel, hpk_padding1);
1966         CHECK_MEMBER(hsm_progress_kernel, hpk_data_version);
1967         CHECK_MEMBER(hsm_progress_kernel, hpk_padding2);
1968 }
1969
1970 static void
1971 check_hsm_progress(void)
1972 {
1973         BLANK_LINE();
1974         CHECK_STRUCT(hsm_progress);
1975         CHECK_MEMBER(hsm_progress, hp_fid);
1976         CHECK_MEMBER(hsm_progress, hp_cookie);
1977         CHECK_MEMBER(hsm_progress, hp_extent);
1978         CHECK_MEMBER(hsm_progress, hp_flags);
1979         CHECK_MEMBER(hsm_progress, hp_errval);
1980         CHECK_MEMBER(hsm_progress, padding);
1981         CHECK_DEFINE_X(HP_FLAG_COMPLETED);
1982         CHECK_DEFINE_X(HP_FLAG_RETRY);
1983 }
1984
1985 static void
1986 check_hsm_copy(void)
1987 {
1988         BLANK_LINE();
1989         CHECK_MEMBER(hsm_copy, hc_data_version);
1990         CHECK_MEMBER(hsm_copy, hc_flags);
1991         CHECK_MEMBER(hsm_copy, hc_errval);
1992         CHECK_MEMBER(hsm_copy, padding);
1993         CHECK_MEMBER(hsm_copy, hc_hai);
1994 }
1995
1996 static void check_layout_intent(void)
1997 {
1998         BLANK_LINE();
1999         CHECK_STRUCT(layout_intent);
2000         CHECK_MEMBER(layout_intent, li_opc);
2001         CHECK_MEMBER(layout_intent, li_flags);
2002         CHECK_MEMBER(layout_intent, li_start);
2003         CHECK_MEMBER(layout_intent, li_end);
2004
2005         CHECK_VALUE(LAYOUT_INTENT_ACCESS);
2006         CHECK_VALUE(LAYOUT_INTENT_READ);
2007         CHECK_VALUE(LAYOUT_INTENT_WRITE);
2008         CHECK_VALUE(LAYOUT_INTENT_GLIMPSE);
2009         CHECK_VALUE(LAYOUT_INTENT_TRUNC);
2010         CHECK_VALUE(LAYOUT_INTENT_RELEASE);
2011         CHECK_VALUE(LAYOUT_INTENT_RESTORE);
2012 }
2013
2014 static void check_hsm_state_set(void)
2015 {
2016         BLANK_LINE();
2017         CHECK_STRUCT(hsm_state_set);
2018         CHECK_MEMBER(hsm_state_set, hss_valid);
2019         CHECK_MEMBER(hsm_state_set, hss_archive_id);
2020         CHECK_MEMBER(hsm_state_set, hss_setmask);
2021         CHECK_MEMBER(hsm_state_set, hss_clearmask);
2022 }
2023
2024 static void check_hsm_current_action(void)
2025 {
2026         BLANK_LINE();
2027         CHECK_STRUCT(hsm_current_action);
2028         CHECK_MEMBER(hsm_current_action, hca_state);
2029         CHECK_MEMBER(hsm_current_action, hca_action);
2030         CHECK_MEMBER(hsm_current_action, hca_location);
2031 }
2032
2033 static void check_hsm_request(void)
2034 {
2035         BLANK_LINE();
2036         CHECK_STRUCT(hsm_request);
2037         CHECK_MEMBER(hsm_request, hr_action);
2038         CHECK_MEMBER(hsm_request, hr_archive_id);
2039         CHECK_MEMBER(hsm_request, hr_flags);
2040         CHECK_MEMBER(hsm_request, hr_itemcount);
2041         CHECK_MEMBER(hsm_request, hr_data_len);
2042         CHECK_VALUE_X(HSM_FORCE_ACTION);
2043         CHECK_VALUE_X(HSM_GHOST_COPY);
2044 }
2045
2046 static void check_hsm_user_request(void)
2047 {
2048         BLANK_LINE();
2049         CHECK_STRUCT(hsm_user_request);
2050         CHECK_MEMBER(hsm_user_request, hur_request);
2051         CHECK_MEMBER(hsm_user_request, hur_user_item);
2052 }
2053
2054 static void check_hsm_user_import(void)
2055 {
2056         BLANK_LINE();
2057         CHECK_STRUCT(hsm_user_import);
2058         CHECK_MEMBER(hsm_user_import, hui_size);
2059         CHECK_MEMBER(hsm_user_import, hui_uid);
2060         CHECK_MEMBER(hsm_user_import, hui_gid);
2061         CHECK_MEMBER(hsm_user_import, hui_mode);
2062         CHECK_MEMBER(hsm_user_import, hui_atime);
2063         CHECK_MEMBER(hsm_user_import, hui_atime_ns);
2064         CHECK_MEMBER(hsm_user_import, hui_mtime);
2065         CHECK_MEMBER(hsm_user_import, hui_mtime_ns);
2066         CHECK_MEMBER(hsm_user_import, hui_archive_id);
2067 }
2068
2069 static void check_object_update_param(void)
2070 {
2071         BLANK_LINE();
2072         CHECK_STRUCT(object_update_param);
2073         CHECK_MEMBER(object_update_param, oup_len);
2074         CHECK_MEMBER(object_update_param, oup_padding);
2075         CHECK_MEMBER(object_update_param, oup_padding2);
2076         CHECK_MEMBER(object_update_param, oup_buf);
2077 }
2078
2079 static void check_object_update(void)
2080 {
2081         BLANK_LINE();
2082         CHECK_STRUCT(object_update);
2083         CHECK_MEMBER(object_update, ou_type);
2084         CHECK_MEMBER(object_update, ou_params_count);
2085         CHECK_MEMBER(object_update, ou_master_index);
2086         CHECK_MEMBER(object_update, ou_flags);
2087         CHECK_MEMBER(object_update, ou_padding1);
2088         CHECK_MEMBER(object_update, ou_batchid);
2089         CHECK_MEMBER(object_update, ou_fid);
2090         CHECK_MEMBER(object_update, ou_params);
2091 }
2092
2093 static void check_object_update_request(void)
2094 {
2095         BLANK_LINE();
2096         CHECK_STRUCT(object_update_request);
2097         CHECK_MEMBER(object_update_request, ourq_magic);
2098         CHECK_MEMBER(object_update_request, ourq_count);
2099         CHECK_MEMBER(object_update_request, ourq_padding);
2100         CHECK_MEMBER(object_update_request, ourq_updates);
2101 }
2102
2103 static void check_object_update_result(void)
2104 {
2105         BLANK_LINE();
2106         CHECK_STRUCT(object_update_result);
2107         CHECK_MEMBER(object_update_result, our_rc);
2108         CHECK_MEMBER(object_update_result, our_datalen);
2109         CHECK_MEMBER(object_update_result, our_padding);
2110         CHECK_MEMBER(object_update_result, our_data);
2111 }
2112
2113 static void check_object_update_reply(void)
2114 {
2115         BLANK_LINE();
2116         CHECK_STRUCT(object_update_reply);
2117         CHECK_MEMBER(object_update_reply, ourp_magic);
2118         CHECK_MEMBER(object_update_reply, ourp_count);
2119         CHECK_MEMBER(object_update_reply, ourp_padding);
2120         CHECK_MEMBER(object_update_reply, ourp_lens);
2121 }
2122
2123 static void check_lfsck_request(void)
2124 {
2125         BLANK_LINE();
2126         CHECK_STRUCT(lfsck_request);
2127         CHECK_MEMBER(lfsck_request, lr_event);
2128         CHECK_MEMBER(lfsck_request, lr_index);
2129         CHECK_MEMBER(lfsck_request, lr_flags);
2130         CHECK_MEMBER(lfsck_request, lr_valid);
2131         CHECK_MEMBER(lfsck_request, lr_speed);
2132         CHECK_MEMBER(lfsck_request, lr_version);
2133         CHECK_MEMBER(lfsck_request, lr_active);
2134         CHECK_MEMBER(lfsck_request, lr_param);
2135         CHECK_MEMBER(lfsck_request, lr_async_windows);
2136         CHECK_MEMBER(lfsck_request, lr_flags);
2137         CHECK_MEMBER(lfsck_request, lr_fid);
2138         CHECK_MEMBER(lfsck_request, lr_fid2);
2139         CHECK_MEMBER(lfsck_request, lr_fid3);
2140         CHECK_MEMBER(lfsck_request, lr_padding_1);
2141         CHECK_MEMBER(lfsck_request, lr_padding_2);
2142
2143         CHECK_VALUE_X(LFSCK_TYPE_SCRUB);
2144         CHECK_VALUE_X(LFSCK_TYPE_LAYOUT);
2145         CHECK_VALUE_X(LFSCK_TYPE_NAMESPACE);
2146
2147         CHECK_VALUE(LE_LASTID_REBUILDING);
2148         CHECK_VALUE(LE_LASTID_REBUILT);
2149         CHECK_VALUE(LE_PHASE1_DONE);
2150         CHECK_VALUE(LE_PHASE2_DONE);
2151         CHECK_VALUE(LE_START);
2152         CHECK_VALUE(LE_STOP);
2153         CHECK_VALUE(LE_QUERY);
2154         CHECK_VALUE(LE_FID_ACCESSED);
2155         CHECK_VALUE(LE_PEER_EXIT);
2156         CHECK_VALUE(LE_CONDITIONAL_DESTROY);
2157         CHECK_VALUE(LE_PAIRS_VERIFY);
2158         CHECK_VALUE(LE_SKIP_NLINK_DECLARE);
2159         CHECK_VALUE(LE_SKIP_NLINK);
2160         CHECK_VALUE(LE_SET_LMV_MASTER);
2161         CHECK_VALUE(LE_SET_LMV_SLAVE);
2162
2163         CHECK_VALUE_X(LEF_TO_OST);
2164         CHECK_VALUE_X(LEF_FROM_OST);
2165         CHECK_VALUE_X(LEF_SET_LMV_HASH);
2166         CHECK_VALUE_X(LEF_SET_LMV_ALL);
2167         CHECK_VALUE_X(LEF_RECHECK_NAME_HASH);
2168 }
2169
2170 static void check_lfsck_reply(void)
2171 {
2172         BLANK_LINE();
2173         CHECK_STRUCT(lfsck_reply);
2174         CHECK_MEMBER(lfsck_reply, lr_status);
2175         CHECK_MEMBER(lfsck_reply, lr_padding_1);
2176         CHECK_MEMBER(lfsck_reply, lr_padding_2);
2177 }
2178
2179 static void system_string(char *cmdline, char *str, int len)
2180 {
2181         int   fds[2];
2182         int   rc;
2183         pid_t pid;
2184
2185         rc = pipe(fds);
2186         if (rc != 0)
2187                 abort();
2188
2189         pid = fork();
2190         if (pid == 0) {
2191                 /* child */
2192                 int   fd = fileno(stdout);
2193
2194                 rc = dup2(fds[1], fd);
2195                 if (rc != fd)
2196                         abort();
2197
2198                 exit(system(cmdline));
2199                 /* notreached */
2200         } else if ((int)pid < 0) {
2201                 abort();
2202         } else {
2203                 FILE *f = fdopen(fds[0], "r");
2204
2205                 if (f == NULL)
2206                         abort();
2207
2208                 close(fds[1]);
2209
2210                 if (fgets(str, len, f) == NULL)
2211                         abort();
2212
2213                 if (waitpid(pid, &rc, 0) != pid)
2214                         abort();
2215
2216                 if (!WIFEXITED(rc) || WEXITSTATUS(rc) != 0)
2217                         abort();
2218
2219                 if (strnlen(str, len) == len)
2220                         str[len - 1] = 0;
2221
2222                 if (str[strlen(str) - 1] == '\n')
2223                         str[strlen(str) - 1] = 0;
2224
2225                 fclose(f);
2226         }
2227 }
2228
2229 int
2230 main(int argc, char **argv)
2231 {
2232         char unameinfo[80];
2233         char gccinfo[80];
2234
2235         system_string("uname -a", unameinfo, sizeof(unameinfo));
2236         system_string(CC " -v 2>&1 | tail -1", gccinfo, sizeof(gccinfo));
2237
2238         printf ("void lustre_assert_wire_constants(void)\n"
2239                 "{\n"
2240                 "        /* Wire protocol assertions generated by 'wirecheck'\n"
2241                 "         * (make -C lustre/utils newwiretest)\n"
2242                 "         * running on %s\n"
2243                 "         * with %s */\n"
2244                 "\n", unameinfo, gccinfo);
2245
2246         BLANK_LINE ();
2247
2248         COMMENT("Constants...");
2249         CHECK_VALUE(PTL_RPC_MSG_REQUEST);
2250         CHECK_VALUE(PTL_RPC_MSG_ERR);
2251         CHECK_VALUE(PTL_RPC_MSG_REPLY);
2252
2253         CHECK_DEFINE_64X(MDS_DIR_END_OFF);
2254
2255         CHECK_DEFINE_64X(DEAD_HANDLE_MAGIC);
2256
2257         CHECK_CVALUE(MTI_NAME_MAXLEN);
2258
2259         CHECK_VALUE(OST_REPLY);
2260         CHECK_VALUE(OST_GETATTR);
2261         CHECK_VALUE(OST_SETATTR);
2262         CHECK_VALUE(OST_READ);
2263         CHECK_VALUE(OST_WRITE);
2264         CHECK_VALUE(OST_CREATE);
2265         CHECK_VALUE(OST_DESTROY);
2266         CHECK_VALUE(OST_GET_INFO);
2267         CHECK_VALUE(OST_CONNECT);
2268         CHECK_VALUE(OST_DISCONNECT);
2269         CHECK_VALUE(OST_PUNCH);
2270         CHECK_VALUE(OST_OPEN);
2271         CHECK_VALUE(OST_CLOSE);
2272         CHECK_VALUE(OST_STATFS);
2273         CHECK_VALUE(OST_SYNC);
2274         CHECK_VALUE(OST_SET_INFO);
2275         CHECK_VALUE(OST_QUOTACHECK);
2276         CHECK_VALUE(OST_QUOTACTL);
2277         CHECK_VALUE(OST_QUOTA_ADJUST_QUNIT);
2278         CHECK_VALUE(OST_LAST_OPC);
2279
2280         CHECK_DEFINE_64X(OBD_OBJECT_EOF);
2281
2282         CHECK_VALUE(OST_MIN_PRECREATE);
2283         CHECK_VALUE(OST_MAX_PRECREATE);
2284
2285         CHECK_DEFINE_64X(OST_LVB_ERR_INIT);
2286         CHECK_DEFINE_64X(OST_LVB_ERR_MASK);
2287
2288         CHECK_VALUE(MDS_FIRST_OPC);
2289         CHECK_VALUE(MDS_GETATTR);
2290         CHECK_VALUE(MDS_GETATTR_NAME);
2291         CHECK_VALUE(MDS_CLOSE);
2292         CHECK_VALUE(MDS_REINT);
2293         CHECK_VALUE(MDS_READPAGE);
2294         CHECK_VALUE(MDS_CONNECT);
2295         CHECK_VALUE(MDS_DISCONNECT);
2296         CHECK_VALUE(MDS_GETSTATUS);
2297         CHECK_VALUE(MDS_STATFS);
2298         CHECK_VALUE(MDS_PIN);
2299         CHECK_VALUE(MDS_UNPIN);
2300         CHECK_VALUE(MDS_SYNC);
2301         CHECK_VALUE(MDS_DONE_WRITING);
2302         CHECK_VALUE(MDS_SET_INFO);
2303         CHECK_VALUE(MDS_QUOTACHECK);
2304         CHECK_VALUE(MDS_QUOTACTL);
2305         CHECK_VALUE(MDS_GETXATTR);
2306         CHECK_VALUE(MDS_SETXATTR);
2307         CHECK_VALUE(MDS_WRITEPAGE);
2308         CHECK_VALUE(MDS_IS_SUBDIR);
2309         CHECK_VALUE(MDS_GET_INFO);
2310         CHECK_VALUE(MDS_HSM_STATE_GET);
2311         CHECK_VALUE(MDS_HSM_STATE_SET);
2312         CHECK_VALUE(MDS_HSM_ACTION);
2313         CHECK_VALUE(MDS_HSM_PROGRESS);
2314         CHECK_VALUE(MDS_HSM_REQUEST);
2315         CHECK_VALUE(MDS_HSM_CT_REGISTER);
2316         CHECK_VALUE(MDS_HSM_CT_UNREGISTER);
2317         CHECK_VALUE(MDS_SWAP_LAYOUTS);
2318         CHECK_VALUE(MDS_LAST_OPC);
2319
2320         CHECK_VALUE(REINT_SETATTR);
2321         CHECK_VALUE(REINT_CREATE);
2322         CHECK_VALUE(REINT_LINK);
2323         CHECK_VALUE(REINT_UNLINK);
2324         CHECK_VALUE(REINT_RENAME);
2325         CHECK_VALUE(REINT_OPEN);
2326         CHECK_VALUE(REINT_SETXATTR);
2327         CHECK_VALUE(REINT_RMENTRY);
2328         CHECK_VALUE(REINT_MIGRATE);
2329         CHECK_VALUE(REINT_MAX);
2330
2331         CHECK_VALUE_X(DISP_IT_EXECD);
2332         CHECK_VALUE_X(DISP_LOOKUP_EXECD);
2333         CHECK_VALUE_X(DISP_LOOKUP_NEG);
2334         CHECK_VALUE_X(DISP_LOOKUP_POS);
2335         CHECK_VALUE_X(DISP_OPEN_CREATE);
2336         CHECK_VALUE_X(DISP_OPEN_OPEN);
2337         CHECK_VALUE_X(DISP_ENQ_COMPLETE);
2338         CHECK_VALUE_X(DISP_ENQ_OPEN_REF);
2339         CHECK_VALUE_X(DISP_ENQ_CREATE_REF);
2340         CHECK_VALUE_X(DISP_OPEN_LOCK);
2341
2342         CHECK_VALUE(MDS_STATUS_CONN);
2343         CHECK_VALUE(MDS_STATUS_LOV);
2344
2345         CHECK_VALUE(LUSTRE_BFLAG_UNCOMMITTED_WRITES);
2346
2347         CHECK_VALUE_X(MF_SOM_CHANGE);
2348         CHECK_VALUE_X(MF_EPOCH_OPEN);
2349         CHECK_VALUE_X(MF_EPOCH_CLOSE);
2350         CHECK_VALUE_X(MF_MDC_CANCEL_FID1);
2351         CHECK_VALUE_X(MF_MDC_CANCEL_FID2);
2352         CHECK_VALUE_X(MF_MDC_CANCEL_FID3);
2353         CHECK_VALUE_X(MF_MDC_CANCEL_FID4);
2354         CHECK_VALUE_X(MF_SOM_AU);
2355         CHECK_VALUE_X(MF_GETATTR_LOCK);
2356
2357         CHECK_VALUE_64X(MDS_ATTR_MODE);
2358         CHECK_VALUE_64X(MDS_ATTR_UID);
2359         CHECK_VALUE_64X(MDS_ATTR_GID);
2360         CHECK_VALUE_64X(MDS_ATTR_SIZE);
2361         CHECK_VALUE_64X(MDS_ATTR_ATIME);
2362         CHECK_VALUE_64X(MDS_ATTR_MTIME);
2363         CHECK_VALUE_64X(MDS_ATTR_CTIME);
2364         CHECK_VALUE_64X(MDS_ATTR_ATIME_SET);
2365         CHECK_VALUE_64X(MDS_ATTR_MTIME_SET);
2366         CHECK_VALUE_64X(MDS_ATTR_FORCE);
2367         CHECK_VALUE_64X(MDS_ATTR_ATTR_FLAG);
2368         CHECK_VALUE_64X(MDS_ATTR_KILL_SUID);
2369         CHECK_VALUE_64X(MDS_ATTR_KILL_SGID);
2370         CHECK_VALUE_64X(MDS_ATTR_CTIME_SET);
2371         CHECK_VALUE_64X(MDS_ATTR_FROM_OPEN);
2372         CHECK_VALUE_64X(MDS_ATTR_BLOCKS);
2373
2374         CHECK_VALUE(FLD_QUERY);
2375         CHECK_VALUE(FLD_READ);
2376         CHECK_VALUE(FLD_FIRST_OPC);
2377         CHECK_VALUE(FLD_LAST_OPC);
2378
2379         CHECK_VALUE(SEQ_QUERY);
2380         CHECK_VALUE(SEQ_FIRST_OPC);
2381         CHECK_VALUE(SEQ_LAST_OPC);
2382
2383         CHECK_VALUE(LFSCK_NOTIFY);
2384         CHECK_VALUE(LFSCK_QUERY);
2385         CHECK_VALUE(LFSCK_FIRST_OPC);
2386         CHECK_VALUE(LFSCK_LAST_OPC);
2387
2388         CHECK_VALUE(SEQ_ALLOC_SUPER);
2389         CHECK_VALUE(SEQ_ALLOC_META);
2390
2391         CHECK_VALUE(LDLM_ENQUEUE);
2392         CHECK_VALUE(LDLM_CONVERT);
2393         CHECK_VALUE(LDLM_CANCEL);
2394         CHECK_VALUE(LDLM_BL_CALLBACK);
2395         CHECK_VALUE(LDLM_CP_CALLBACK);
2396         CHECK_VALUE(LDLM_GL_CALLBACK);
2397         CHECK_VALUE(LDLM_SET_INFO);
2398         CHECK_VALUE(LDLM_LAST_OPC);
2399
2400         CHECK_VALUE(LCK_MINMODE);
2401         CHECK_VALUE(LCK_EX);
2402         CHECK_VALUE(LCK_PW);
2403         CHECK_VALUE(LCK_PR);
2404         CHECK_VALUE(LCK_CW);
2405         CHECK_VALUE(LCK_CR);
2406         CHECK_VALUE(LCK_NL);
2407         CHECK_VALUE(LCK_GROUP);
2408         CHECK_VALUE(LCK_COS);
2409         CHECK_VALUE(LCK_MAXMODE);
2410         CHECK_VALUE(LCK_MODE_NUM);
2411
2412         CHECK_CVALUE(LDLM_PLAIN);
2413         CHECK_CVALUE(LDLM_EXTENT);
2414         CHECK_CVALUE(LDLM_FLOCK);
2415         CHECK_CVALUE(LDLM_IBITS);
2416         CHECK_CVALUE(LDLM_MAX_TYPE);
2417
2418         CHECK_CVALUE(LUSTRE_RES_ID_SEQ_OFF);
2419         CHECK_CVALUE(LUSTRE_RES_ID_VER_OID_OFF);
2420         /* CHECK_CVALUE(LUSTRE_RES_ID_WAS_VER_OFF); packed with OID */
2421
2422         CHECK_VALUE(OUT_UPDATE);
2423         CHECK_VALUE(OUT_UPDATE_LAST_OPC);
2424         CHECK_CVALUE(LUSTRE_RES_ID_QUOTA_SEQ_OFF);
2425         CHECK_CVALUE(LUSTRE_RES_ID_QUOTA_VER_OID_OFF);
2426         CHECK_CVALUE(LUSTRE_RES_ID_HSH_OFF);
2427
2428         CHECK_CVALUE(LQUOTA_TYPE_USR);
2429         CHECK_CVALUE(LQUOTA_TYPE_GRP);
2430
2431         CHECK_CVALUE(LQUOTA_RES_MD);
2432         CHECK_CVALUE(LQUOTA_RES_DT);
2433
2434         CHECK_VALUE(OBD_PING);
2435         CHECK_VALUE(OBD_LOG_CANCEL);
2436         CHECK_VALUE(OBD_QC_CALLBACK);
2437         CHECK_VALUE(OBD_IDX_READ);
2438         CHECK_VALUE(OBD_LAST_OPC);
2439
2440         CHECK_VALUE(QUOTA_DQACQ);
2441         CHECK_VALUE(QUOTA_DQREL);
2442         CHECK_VALUE(QUOTA_LAST_OPC);
2443
2444         CHECK_VALUE(MGS_CONNECT);
2445         CHECK_VALUE(MGS_DISCONNECT);
2446         CHECK_VALUE(MGS_EXCEPTION);
2447         CHECK_VALUE(MGS_TARGET_REG);
2448         CHECK_VALUE(MGS_TARGET_DEL);
2449         CHECK_VALUE(MGS_SET_INFO);
2450         CHECK_VALUE(MGS_LAST_OPC);
2451
2452         CHECK_VALUE(SEC_CTX_INIT);
2453         CHECK_VALUE(SEC_CTX_INIT_CONT);
2454         CHECK_VALUE(SEC_CTX_FINI);
2455         CHECK_VALUE(SEC_LAST_OPC);
2456
2457         COMMENT("Sizes and Offsets");
2458         BLANK_LINE();
2459         CHECK_STRUCT(obd_uuid);
2460         check_lu_seq_range();
2461         check_lustre_mdt_attrs();
2462
2463         CHECK_VALUE(OUT_CREATE);
2464         CHECK_VALUE(OUT_DESTROY);
2465         CHECK_VALUE(OUT_REF_ADD);
2466         CHECK_VALUE(OUT_REF_DEL);
2467         CHECK_VALUE(OUT_ATTR_SET);
2468         CHECK_VALUE(OUT_ATTR_GET);
2469         CHECK_VALUE(OUT_XATTR_SET);
2470         CHECK_VALUE(OUT_XATTR_GET);
2471         CHECK_VALUE(OUT_INDEX_LOOKUP);
2472         CHECK_VALUE(OUT_INDEX_LOOKUP);
2473         CHECK_VALUE(OUT_INDEX_INSERT);
2474         CHECK_VALUE(OUT_INDEX_DELETE);
2475
2476         check_som_attrs();
2477         check_hsm_attrs();
2478         check_ost_id();
2479         check_lu_dirent();
2480         check_luda_type();
2481         check_lu_dirpage();
2482         check_lustre_handle();
2483         check_lustre_msg_v2();
2484         check_ptlrpc_body();
2485         check_obd_connect_data();
2486         check_obdo();
2487         check_lov_ost_data_v1();
2488         check_lov_mds_md_v1();
2489         check_lov_mds_md_v3();
2490         check_lmv_mds_md_v1();
2491         check_obd_statfs();
2492         check_obd_ioobj();
2493         check_obd_quotactl();
2494         check_obd_idx_read();
2495         check_niobuf_remote();
2496         check_ost_body();
2497         check_ll_fid();
2498         check_mdt_body();
2499         check_mdt_ioepoch();
2500         check_mdt_remote_perm();
2501         check_mdt_rec_setattr();
2502         check_mdt_rec_create();
2503         check_mdt_rec_link();
2504         check_mdt_rec_unlink();
2505         check_mdt_rec_rename();
2506         check_mdt_rec_setxattr();
2507         check_mdt_rec_reint();
2508         check_lmv_desc();
2509         check_lov_desc();
2510         check_ldlm_res_id();
2511         check_ldlm_extent();
2512         check_ldlm_inodebits();
2513         check_ldlm_flock();
2514         check_ldlm_intent();
2515         check_ldlm_resource_desc();
2516         check_ldlm_lock_desc();
2517         check_ldlm_request();
2518         check_ldlm_reply();
2519         check_ldlm_ost_lvb_v1();
2520         check_ldlm_ost_lvb();
2521         check_ldlm_lquota_lvb();
2522         check_ldlm_gl_lquota_desc();
2523         check_mgs_send_param();
2524         check_cfg_marker();
2525         check_llog_logid();
2526         check_llog_catid();
2527         check_llog_rec_hdr();
2528         check_llog_rec_tail();
2529         check_llog_logid_rec();
2530         check_llog_unlink_rec();
2531         check_llog_unlink64_rec();
2532         check_llog_setattr64_rec();
2533         check_llog_size_change_rec();
2534         check_changelog_rec();
2535         check_changelog_ext_rename();
2536         check_changelog_ext_jobid();
2537         check_changelog_setinfo();
2538         check_llog_changelog_rec();
2539         check_llog_changelog_user_rec();
2540         check_llog_gen();
2541         check_llog_gen_rec();
2542         check_llog_log_hdr();
2543         check_llog_cookie();
2544         check_llogd_body();
2545         check_llogd_conn_body();
2546         check_ll_fiemap_info_key();
2547         check_quota_body();
2548         check_mgs_target_info();
2549         check_lustre_capa();
2550         check_lustre_capa_key();
2551         check_getinfo_fid2path();
2552         check_ll_user_fiemap();
2553         check_ll_fiemap_extent();
2554         check_posix_acl_xattr_entry();
2555         check_posix_acl_xattr_header();
2556         check_link_ea_header();
2557         check_link_ea_entry();
2558         check_layout_intent();
2559         check_hsm_action_item();
2560         check_hsm_action_list();
2561         check_hsm_progress();
2562         check_hsm_copy();
2563         check_hsm_progress_kernel();
2564         check_hsm_user_item();
2565         check_hsm_user_state();
2566         check_hsm_state_set();
2567         check_hsm_current_action();
2568         check_hsm_request();
2569         check_hsm_user_request();
2570         check_hsm_user_import();
2571
2572         check_object_update_param();
2573         check_object_update();
2574         check_object_update_request();
2575         check_object_update_result();
2576         check_object_update_reply();
2577
2578         check_lfsck_request();
2579         check_lfsck_reply();
2580
2581         printf("}\n\n");
2582
2583         return 0;
2584 }