Whamcloud - gitweb
LU-7543 obd: reserve connection flag OBD_CONNECT_LOCK_AHEAD
[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, 2015, 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 <unistd.h>
39 #include <sys/types.h>
40 #include <sys/wait.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_NOT_IN_OI);
213         CHECK_VALUE_X(LMAC_FID_ON_OST);
214 }
215
216 static void
217 check_hsm_attrs(void)
218 {
219         BLANK_LINE();
220         CHECK_STRUCT(hsm_attrs);
221         CHECK_MEMBER(hsm_attrs, hsm_compat);
222         CHECK_MEMBER(hsm_attrs, hsm_flags);
223         CHECK_MEMBER(hsm_attrs, hsm_arch_id);
224         CHECK_MEMBER(hsm_attrs, hsm_arch_ver);
225 }
226
227 static void
228 check_ost_id(void)
229 {
230         BLANK_LINE();
231         CHECK_STRUCT(ost_id);
232         CHECK_MEMBER(ost_id, oi);
233
234         CHECK_VALUE(LUSTRE_FID_INIT_OID);
235
236         CHECK_VALUE(FID_SEQ_OST_MDT0);
237         CHECK_VALUE(FID_SEQ_LLOG);
238         CHECK_VALUE(FID_SEQ_ECHO);
239         CHECK_VALUE(FID_SEQ_UNUSED_START);
240         CHECK_VALUE(FID_SEQ_UNUSED_END);
241         CHECK_VALUE(FID_SEQ_RSVD);
242         CHECK_VALUE(FID_SEQ_IGIF);
243         CHECK_VALUE_64X(FID_SEQ_IGIF_MAX);
244         CHECK_VALUE_64X(FID_SEQ_IDIF);
245         CHECK_VALUE_64X(FID_SEQ_IDIF_MAX);
246         CHECK_VALUE_64X(FID_SEQ_START);
247         CHECK_VALUE_64X(FID_SEQ_LOCAL_FILE);
248         CHECK_VALUE_64X(FID_SEQ_DOT_LUSTRE);
249         CHECK_VALUE_64X(FID_SEQ_SPECIAL);
250         CHECK_VALUE_64X(FID_SEQ_QUOTA);
251         CHECK_VALUE_64X(FID_SEQ_QUOTA_GLB);
252         CHECK_VALUE_64X(FID_SEQ_ROOT);
253         CHECK_VALUE_64X(FID_SEQ_LAYOUT_RBTREE);
254         CHECK_VALUE_64X(FID_SEQ_UPDATE_LOG);
255         CHECK_VALUE_64X(FID_SEQ_UPDATE_LOG_DIR);
256         CHECK_VALUE_64X(FID_SEQ_NORMAL);
257         CHECK_VALUE_64X(FID_SEQ_LOV_DEFAULT);
258
259         CHECK_VALUE_X(FID_OID_SPECIAL_BFL);
260         CHECK_VALUE_X(FID_OID_DOT_LUSTRE);
261         CHECK_VALUE_X(FID_OID_DOT_LUSTRE_OBF);
262 }
263
264 static void
265 check_lu_dirent(void)
266 {
267         BLANK_LINE();
268         CHECK_STRUCT(lu_dirent);
269         CHECK_MEMBER(lu_dirent, lde_fid);
270         CHECK_MEMBER(lu_dirent, lde_hash);
271         CHECK_MEMBER(lu_dirent, lde_reclen);
272         CHECK_MEMBER(lu_dirent, lde_namelen);
273         CHECK_MEMBER(lu_dirent, lde_attrs);
274         CHECK_MEMBER(lu_dirent, lde_name[0]);
275
276         CHECK_VALUE_X(LUDA_FID);
277         CHECK_VALUE_X(LUDA_TYPE);
278         CHECK_VALUE_X(LUDA_64BITHASH);
279 }
280
281 static void
282 check_luda_type(void)
283 {
284         BLANK_LINE();
285         CHECK_STRUCT(luda_type);
286         CHECK_MEMBER(luda_type, lt_type);
287 }
288
289 static void
290 check_lu_dirpage(void)
291 {
292         BLANK_LINE();
293         CHECK_STRUCT(lu_dirpage);
294         CHECK_MEMBER(lu_dirpage, ldp_hash_start);
295         CHECK_MEMBER(lu_dirpage, ldp_hash_end);
296         CHECK_MEMBER(lu_dirpage, ldp_flags);
297         CHECK_MEMBER(lu_dirpage, ldp_pad0);
298         CHECK_MEMBER(lu_dirpage, ldp_entries[0]);
299
300         CHECK_VALUE(LDF_EMPTY);
301         CHECK_VALUE(LDF_COLLIDE);
302         CHECK_VALUE(LU_PAGE_SIZE);
303         CHECK_UNION(lu_page);
304 }
305
306 static void
307 check_lustre_handle(void)
308 {
309         BLANK_LINE();
310         CHECK_STRUCT(lustre_handle);
311         CHECK_MEMBER(lustre_handle, cookie);
312 }
313
314 static void
315 check_lustre_msg_v2(void)
316 {
317         BLANK_LINE();
318         CHECK_STRUCT(lustre_msg_v2);
319         CHECK_MEMBER(lustre_msg_v2, lm_bufcount);
320         CHECK_MEMBER(lustre_msg_v2, lm_secflvr);
321         CHECK_MEMBER(lustre_msg_v2, lm_magic);
322         CHECK_MEMBER(lustre_msg_v2, lm_repsize);
323         CHECK_MEMBER(lustre_msg_v2, lm_cksum);
324         CHECK_MEMBER(lustre_msg_v2, lm_flags);
325         CHECK_MEMBER(lustre_msg_v2, lm_padding_2);
326         CHECK_MEMBER(lustre_msg_v2, lm_padding_3);
327         CHECK_MEMBER(lustre_msg_v2, lm_buflens[0]);
328
329         CHECK_DEFINE_X(LUSTRE_MSG_MAGIC_V2);
330         CHECK_DEFINE_X(LUSTRE_MSG_MAGIC_V2_SWABBED);
331 }
332
333 static void
334 check_ptlrpc_body(void)
335 {
336         BLANK_LINE();
337         CHECK_STRUCT(ptlrpc_body);
338         CHECK_MEMBER(ptlrpc_body, pb_handle);
339         CHECK_MEMBER(ptlrpc_body, pb_type);
340         CHECK_MEMBER(ptlrpc_body, pb_version);
341         CHECK_MEMBER(ptlrpc_body, pb_opc);
342         CHECK_MEMBER(ptlrpc_body, pb_status);
343         CHECK_MEMBER(ptlrpc_body, pb_last_xid);
344         CHECK_MEMBER(ptlrpc_body, pb_tag);
345         CHECK_MEMBER(ptlrpc_body, pb_padding0);
346         CHECK_MEMBER(ptlrpc_body, pb_padding1);
347         CHECK_MEMBER(ptlrpc_body, pb_last_committed);
348         CHECK_MEMBER(ptlrpc_body, pb_transno);
349         CHECK_MEMBER(ptlrpc_body, pb_flags);
350         CHECK_MEMBER(ptlrpc_body, pb_op_flags);
351         CHECK_MEMBER(ptlrpc_body, pb_conn_cnt);
352         CHECK_MEMBER(ptlrpc_body, pb_timeout);
353         CHECK_MEMBER(ptlrpc_body, pb_service_time);
354         CHECK_MEMBER(ptlrpc_body, pb_limit);
355         CHECK_MEMBER(ptlrpc_body, pb_slv);
356         CHECK_CVALUE(PTLRPC_NUM_VERSIONS);
357         CHECK_MEMBER(ptlrpc_body, pb_pre_versions);
358         CHECK_MEMBER(ptlrpc_body, pb_mbits);
359         CHECK_MEMBER(ptlrpc_body, pb_padding64_0);
360         CHECK_MEMBER(ptlrpc_body, pb_padding64_1);
361         CHECK_MEMBER(ptlrpc_body, pb_padding64_2);
362         CHECK_CVALUE(LUSTRE_JOBID_SIZE);
363         CHECK_MEMBER(ptlrpc_body, pb_jobid);
364
365         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_handle);
366         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_type);
367         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_version);
368         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_opc);
369         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_status);
370         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_last_xid);
371         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_tag);
372         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_padding0);
373         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_padding1);
374         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_last_committed);
375         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_transno);
376         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_flags);
377         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_op_flags);
378         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_conn_cnt);
379         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_timeout);
380         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_service_time);
381         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_limit);
382         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_slv);
383         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_pre_versions);
384         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_mbits);
385         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_padding64_0);
386         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_padding64_1);
387         CHECK_MEMBER_SAME(ptlrpc_body_v3, ptlrpc_body_v2, pb_padding64_2);
388
389         CHECK_VALUE(MSG_PTLRPC_BODY_OFF);
390         CHECK_VALUE(REQ_REC_OFF);
391         CHECK_VALUE(REPLY_REC_OFF);
392         CHECK_VALUE(DLM_LOCKREQ_OFF);
393         CHECK_VALUE(DLM_REQ_REC_OFF);
394         CHECK_VALUE(DLM_INTENT_IT_OFF);
395         CHECK_VALUE(DLM_INTENT_REC_OFF);
396         CHECK_VALUE(DLM_LOCKREPLY_OFF);
397         CHECK_VALUE(DLM_REPLY_REC_OFF);
398         CHECK_VALUE(MSG_PTLRPC_HEADER_OFF);
399
400         CHECK_DEFINE_X(PTLRPC_MSG_VERSION);
401         CHECK_DEFINE_X(LUSTRE_VERSION_MASK);
402         CHECK_DEFINE_X(LUSTRE_OBD_VERSION);
403         CHECK_DEFINE_X(LUSTRE_MDS_VERSION);
404         CHECK_DEFINE_X(LUSTRE_OST_VERSION);
405         CHECK_DEFINE_X(LUSTRE_DLM_VERSION);
406         CHECK_DEFINE_X(LUSTRE_LOG_VERSION);
407         CHECK_DEFINE_X(LUSTRE_MGS_VERSION);
408
409         CHECK_VALUE(MSGHDR_AT_SUPPORT);
410         CHECK_VALUE(MSGHDR_CKSUM_INCOMPAT18);
411
412         CHECK_VALUE_X(MSG_OP_FLAG_MASK);
413         CHECK_VALUE(MSG_OP_FLAG_SHIFT);
414         CHECK_VALUE_X(MSG_GEN_FLAG_MASK);
415
416         CHECK_VALUE_X(MSG_LAST_REPLAY);
417         CHECK_VALUE_X(MSG_RESENT);
418         CHECK_VALUE_X(MSG_REPLAY);
419         CHECK_VALUE_X(MSG_DELAY_REPLAY);
420         CHECK_VALUE_X(MSG_VERSION_REPLAY);
421         CHECK_VALUE_X(MSG_REQ_REPLAY_DONE);
422         CHECK_VALUE_X(MSG_LOCK_REPLAY_DONE);
423
424         CHECK_VALUE_X(MSG_CONNECT_RECOVERING);
425         CHECK_VALUE_X(MSG_CONNECT_RECONNECT);
426         CHECK_VALUE_X(MSG_CONNECT_REPLAYABLE);
427         CHECK_VALUE_X(MSG_CONNECT_LIBCLIENT);
428         CHECK_VALUE_X(MSG_CONNECT_INITIAL);
429         CHECK_VALUE_X(MSG_CONNECT_ASYNC);
430         CHECK_VALUE_X(MSG_CONNECT_NEXT_VER);
431         CHECK_VALUE_X(MSG_CONNECT_TRANSNO);
432 }
433
434 static void
435 check_obd_connect_data(void)
436 {
437         BLANK_LINE();
438         CHECK_STRUCT(obd_connect_data);
439         CHECK_MEMBER(obd_connect_data, ocd_connect_flags);
440         CHECK_MEMBER(obd_connect_data, ocd_version);
441         CHECK_MEMBER(obd_connect_data, ocd_grant);
442         CHECK_MEMBER(obd_connect_data, ocd_index);
443         CHECK_MEMBER(obd_connect_data, ocd_brw_size);
444         CHECK_MEMBER(obd_connect_data, ocd_ibits_known);
445         CHECK_MEMBER(obd_connect_data, ocd_blocksize);
446         CHECK_MEMBER(obd_connect_data, ocd_inodespace);
447         CHECK_MEMBER(obd_connect_data, ocd_grant_extent);
448         CHECK_MEMBER(obd_connect_data, ocd_unused);
449         CHECK_MEMBER(obd_connect_data, ocd_transno);
450         CHECK_MEMBER(obd_connect_data, ocd_group);
451         CHECK_MEMBER(obd_connect_data, ocd_cksum_types);
452         CHECK_MEMBER(obd_connect_data, ocd_max_easize);
453         CHECK_MEMBER(obd_connect_data, ocd_instance);
454         CHECK_MEMBER(obd_connect_data, ocd_maxbytes);
455         CHECK_MEMBER(obd_connect_data, ocd_maxmodrpcs);
456         CHECK_MEMBER(obd_connect_data, padding0);
457         CHECK_MEMBER(obd_connect_data, padding1);
458         CHECK_MEMBER(obd_connect_data, padding2);
459         CHECK_MEMBER(obd_connect_data, padding3);
460         CHECK_MEMBER(obd_connect_data, padding4);
461         CHECK_MEMBER(obd_connect_data, padding5);
462         CHECK_MEMBER(obd_connect_data, padding6);
463         CHECK_MEMBER(obd_connect_data, padding7);
464         CHECK_MEMBER(obd_connect_data, padding8);
465         CHECK_MEMBER(obd_connect_data, padding9);
466         CHECK_MEMBER(obd_connect_data, paddingA);
467         CHECK_MEMBER(obd_connect_data, paddingB);
468         CHECK_MEMBER(obd_connect_data, paddingC);
469         CHECK_MEMBER(obd_connect_data, paddingD);
470         CHECK_MEMBER(obd_connect_data, paddingE);
471         CHECK_MEMBER(obd_connect_data, paddingF);
472
473         CHECK_DEFINE_64X(OBD_CONNECT_RDONLY);
474         CHECK_DEFINE_64X(OBD_CONNECT_INDEX);
475         CHECK_DEFINE_64X(OBD_CONNECT_MDS);
476         CHECK_DEFINE_64X(OBD_CONNECT_GRANT);
477         CHECK_DEFINE_64X(OBD_CONNECT_SRVLOCK);
478         CHECK_DEFINE_64X(OBD_CONNECT_VERSION);
479         CHECK_DEFINE_64X(OBD_CONNECT_REQPORTAL);
480         CHECK_DEFINE_64X(OBD_CONNECT_ACL);
481         CHECK_DEFINE_64X(OBD_CONNECT_XATTR);
482         CHECK_DEFINE_64X(OBD_CONNECT_CROW);
483         CHECK_DEFINE_64X(OBD_CONNECT_TRUNCLOCK);
484         CHECK_DEFINE_64X(OBD_CONNECT_TRANSNO);
485         CHECK_DEFINE_64X(OBD_CONNECT_IBITS);
486         CHECK_DEFINE_64X(OBD_CONNECT_JOIN);
487         CHECK_DEFINE_64X(OBD_CONNECT_ATTRFID);
488         CHECK_DEFINE_64X(OBD_CONNECT_NODEVOH);
489         CHECK_DEFINE_64X(OBD_CONNECT_RMT_CLIENT);
490         CHECK_DEFINE_64X(OBD_CONNECT_RMT_CLIENT_FORCE);
491         CHECK_DEFINE_64X(OBD_CONNECT_BRW_SIZE);
492         CHECK_DEFINE_64X(OBD_CONNECT_QUOTA64);
493         CHECK_DEFINE_64X(OBD_CONNECT_MDS_CAPA);
494         CHECK_DEFINE_64X(OBD_CONNECT_OSS_CAPA);
495         CHECK_DEFINE_64X(OBD_CONNECT_CANCELSET);
496         CHECK_DEFINE_64X(OBD_CONNECT_SOM);
497         CHECK_DEFINE_64X(OBD_CONNECT_AT);
498         CHECK_DEFINE_64X(OBD_CONNECT_LRU_RESIZE);
499         CHECK_DEFINE_64X(OBD_CONNECT_MDS_MDS);
500         CHECK_DEFINE_64X(OBD_CONNECT_REAL);
501         CHECK_DEFINE_64X(OBD_CONNECT_CHANGE_QS);
502         CHECK_DEFINE_64X(OBD_CONNECT_CKSUM);
503         CHECK_DEFINE_64X(OBD_CONNECT_FID);
504         CHECK_DEFINE_64X(OBD_CONNECT_VBR);
505         CHECK_DEFINE_64X(OBD_CONNECT_LOV_V3);
506         CHECK_DEFINE_64X(OBD_CONNECT_GRANT_SHRINK);
507         CHECK_DEFINE_64X(OBD_CONNECT_SKIP_ORPHAN);
508         CHECK_DEFINE_64X(OBD_CONNECT_MAX_EASIZE);
509         CHECK_DEFINE_64X(OBD_CONNECT_FULL20);
510         CHECK_DEFINE_64X(OBD_CONNECT_LAYOUTLOCK);
511         CHECK_DEFINE_64X(OBD_CONNECT_64BITHASH);
512         CHECK_DEFINE_64X(OBD_CONNECT_MAXBYTES);
513         CHECK_DEFINE_64X(OBD_CONNECT_IMP_RECOV);
514         CHECK_DEFINE_64X(OBD_CONNECT_JOBSTATS);
515         CHECK_DEFINE_64X(OBD_CONNECT_UMASK);
516         CHECK_DEFINE_64X(OBD_CONNECT_EINPROGRESS);
517         CHECK_DEFINE_64X(OBD_CONNECT_GRANT_PARAM);
518         CHECK_DEFINE_64X(OBD_CONNECT_FLOCK_OWNER);
519         CHECK_DEFINE_64X(OBD_CONNECT_LVB_TYPE);
520         CHECK_DEFINE_64X(OBD_CONNECT_NANOSEC_TIME);
521         CHECK_DEFINE_64X(OBD_CONNECT_LIGHTWEIGHT);
522         CHECK_DEFINE_64X(OBD_CONNECT_SHORTIO);
523         CHECK_DEFINE_64X(OBD_CONNECT_PINGLESS);
524         CHECK_DEFINE_64X(OBD_CONNECT_FLOCK_DEAD);
525         CHECK_DEFINE_64X(OBD_CONNECT_OPEN_BY_FID);
526         CHECK_DEFINE_64X(OBD_CONNECT_LFSCK);
527         CHECK_DEFINE_64X(OBD_CONNECT_UNLINK_CLOSE);
528         CHECK_DEFINE_64X(OBD_CONNECT_MULTIMODRPCS);
529         CHECK_DEFINE_64X(OBD_CONNECT_DIR_STRIPE);
530         CHECK_DEFINE_64X(OBD_CONNECT_SUBTREE);
531         CHECK_DEFINE_64X(OBD_CONNECT_LOCK_AHEAD);
532         CHECK_DEFINE_64X(OBD_CONNECT_BULK_MBITS);
533         CHECK_DEFINE_64X(OBD_CONNECT_OBDOPACK);
534
535         CHECK_VALUE_X(OBD_CKSUM_CRC32);
536         CHECK_VALUE_X(OBD_CKSUM_ADLER);
537         CHECK_VALUE_X(OBD_CKSUM_CRC32C);
538 }
539
540 static void
541 check_obdo(void)
542 {
543         BLANK_LINE();
544         CHECK_STRUCT(obdo);
545         CHECK_MEMBER(obdo, o_valid);
546         CHECK_MEMBER(obdo, o_oi);
547         CHECK_MEMBER(obdo, o_parent_seq);
548         CHECK_MEMBER(obdo, o_size);
549         CHECK_MEMBER(obdo, o_mtime);
550         CHECK_MEMBER(obdo, o_atime);
551         CHECK_MEMBER(obdo, o_ctime);
552         CHECK_MEMBER(obdo, o_blocks);
553         CHECK_MEMBER(obdo, o_grant);
554         CHECK_MEMBER(obdo, o_blksize);
555         CHECK_MEMBER(obdo, o_mode);
556         CHECK_MEMBER(obdo, o_uid);
557         CHECK_MEMBER(obdo, o_gid);
558         CHECK_MEMBER(obdo, o_flags);
559         CHECK_MEMBER(obdo, o_nlink);
560         CHECK_MEMBER(obdo, o_parent_oid);
561         CHECK_MEMBER(obdo, o_misc);
562         CHECK_MEMBER(obdo, o_ioepoch);
563         CHECK_MEMBER(obdo, o_stripe_idx);
564         CHECK_MEMBER(obdo, o_parent_ver);
565         CHECK_MEMBER(obdo, o_handle);
566         CHECK_MEMBER(obdo, o_lcookie);
567         CHECK_MEMBER(obdo, o_uid_h);
568         CHECK_MEMBER(obdo, o_gid_h);
569         CHECK_MEMBER(obdo, o_data_version);
570         CHECK_MEMBER(obdo, o_padding_4);
571         CHECK_MEMBER(obdo, o_padding_5);
572         CHECK_MEMBER(obdo, o_padding_6);
573
574         CHECK_DEFINE_64X(OBD_MD_FLID);
575         CHECK_DEFINE_64X(OBD_MD_FLATIME);
576         CHECK_DEFINE_64X(OBD_MD_FLMTIME);
577         CHECK_DEFINE_64X(OBD_MD_FLCTIME);
578         CHECK_DEFINE_64X(OBD_MD_FLSIZE);
579         CHECK_DEFINE_64X(OBD_MD_FLBLOCKS);
580         CHECK_DEFINE_64X(OBD_MD_FLBLKSZ);
581         CHECK_DEFINE_64X(OBD_MD_FLMODE);
582         CHECK_DEFINE_64X(OBD_MD_FLTYPE);
583         CHECK_DEFINE_64X(OBD_MD_FLUID);
584         CHECK_DEFINE_64X(OBD_MD_FLGID);
585         CHECK_DEFINE_64X(OBD_MD_FLFLAGS);
586         CHECK_DEFINE_64X(OBD_MD_FLNLINK);
587         CHECK_DEFINE_64X(OBD_MD_FLGENER);
588         CHECK_DEFINE_64X(OBD_MD_FLRDEV);
589         CHECK_DEFINE_64X(OBD_MD_FLEASIZE);
590         CHECK_DEFINE_64X(OBD_MD_LINKNAME);
591         CHECK_DEFINE_64X(OBD_MD_FLHANDLE);
592         CHECK_DEFINE_64X(OBD_MD_FLCKSUM);
593         CHECK_DEFINE_64X(OBD_MD_FLQOS);
594         CHECK_DEFINE_64X(OBD_MD_FLGROUP);
595         CHECK_DEFINE_64X(OBD_MD_FLFID);
596         CHECK_DEFINE_64X(OBD_MD_FLEPOCH);
597         CHECK_DEFINE_64X(OBD_MD_FLGRANT);
598         CHECK_DEFINE_64X(OBD_MD_FLDIREA);
599         CHECK_DEFINE_64X(OBD_MD_FLUSRQUOTA);
600         CHECK_DEFINE_64X(OBD_MD_FLGRPQUOTA);
601         CHECK_DEFINE_64X(OBD_MD_FLMODEASIZE);
602         CHECK_DEFINE_64X(OBD_MD_MDS);
603         CHECK_DEFINE_64X(OBD_MD_REINT);
604         CHECK_DEFINE_64X(OBD_MD_MEA);
605         CHECK_DEFINE_64X(OBD_MD_TSTATE);
606         CHECK_DEFINE_64X(OBD_MD_FLXATTR);
607         CHECK_DEFINE_64X(OBD_MD_FLXATTRLS);
608         CHECK_DEFINE_64X(OBD_MD_FLXATTRRM);
609         CHECK_DEFINE_64X(OBD_MD_FLACL);
610         CHECK_DEFINE_64X(OBD_MD_FLRMTPERM);
611         CHECK_DEFINE_64X(OBD_MD_FLMDSCAPA);
612         CHECK_DEFINE_64X(OBD_MD_FLOSSCAPA);
613         CHECK_DEFINE_64X(OBD_MD_FLCKSPLIT);
614         CHECK_DEFINE_64X(OBD_MD_FLCROSSREF);
615         CHECK_DEFINE_64X(OBD_MD_FLGETATTRLOCK);
616         CHECK_DEFINE_64X(OBD_MD_FLRMTLSETFACL);
617         CHECK_DEFINE_64X(OBD_MD_FLRMTLGETFACL);
618         CHECK_DEFINE_64X(OBD_MD_FLRMTRSETFACL);
619         CHECK_DEFINE_64X(OBD_MD_FLRMTRGETFACL);
620         CHECK_DEFINE_64X(OBD_MD_FLDATAVERSION);
621
622         CHECK_CVALUE_X(OBD_FL_INLINEDATA);
623         CHECK_CVALUE_X(OBD_FL_OBDMDEXISTS);
624         CHECK_CVALUE_X(OBD_FL_DELORPHAN);
625         CHECK_CVALUE_X(OBD_FL_NORPC);
626         CHECK_CVALUE_X(OBD_FL_IDONLY);
627         CHECK_CVALUE_X(OBD_FL_RECREATE_OBJS);
628         CHECK_CVALUE_X(OBD_FL_DEBUG_CHECK);
629         CHECK_CVALUE_X(OBD_FL_NO_USRQUOTA);
630         CHECK_CVALUE_X(OBD_FL_NO_GRPQUOTA);
631         CHECK_CVALUE_X(OBD_FL_CREATE_CROW);
632         CHECK_CVALUE_X(OBD_FL_SRVLOCK);
633         CHECK_CVALUE_X(OBD_FL_CKSUM_CRC32);
634         CHECK_CVALUE_X(OBD_FL_CKSUM_ADLER);
635         CHECK_CVALUE_X(OBD_FL_CKSUM_CRC32C);
636         CHECK_CVALUE_X(OBD_FL_CKSUM_RSVD2);
637         CHECK_CVALUE_X(OBD_FL_CKSUM_RSVD3);
638         CHECK_CVALUE_X(OBD_FL_SHRINK_GRANT);
639         CHECK_CVALUE_X(OBD_FL_MMAP);
640         CHECK_CVALUE_X(OBD_FL_RECOV_RESEND);
641         CHECK_CVALUE_X(OBD_FL_NOSPC_BLK);
642         CHECK_CVALUE_X(OBD_FL_FLUSH);
643         CHECK_CVALUE_X(OBD_FL_SHORT_IO);
644         CHECK_CVALUE_X(OBD_FL_LOCAL_MASK);
645 }
646
647 static void
648 check_lov_ost_data_v1(void)
649 {
650         BLANK_LINE();
651         CHECK_STRUCT(lov_ost_data_v1);
652         CHECK_MEMBER(lov_ost_data_v1, l_ost_oi);
653         CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
654         CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
655 }
656
657 static void
658 check_lov_mds_md_v1(void)
659 {
660         BLANK_LINE();
661         CHECK_STRUCT(lov_mds_md_v1);
662         CHECK_MEMBER(lov_mds_md_v1, lmm_magic);
663         CHECK_MEMBER(lov_mds_md_v1, lmm_pattern);
664         CHECK_MEMBER(lov_mds_md_v1, lmm_oi);
665         CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_size);
666         CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_count);
667         CHECK_MEMBER(lov_mds_md_v1, lmm_layout_gen);
668         CHECK_MEMBER(lov_mds_md_v1, lmm_objects[0]);
669
670         CHECK_CDEFINE(LOV_MAGIC_V1);
671 }
672
673 static void
674 check_lov_mds_md_v3(void)
675 {
676         BLANK_LINE();
677         CHECK_STRUCT(lov_mds_md_v3);
678         CHECK_MEMBER(lov_mds_md_v3, lmm_magic);
679         CHECK_MEMBER(lov_mds_md_v3, lmm_pattern);
680         CHECK_MEMBER(lov_mds_md_v3, lmm_oi);
681         CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_size);
682         CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_count);
683         CHECK_MEMBER(lov_mds_md_v3, lmm_layout_gen);
684         CHECK_CVALUE(LOV_MAXPOOLNAME);
685         CHECK_MEMBER(lov_mds_md_v3, lmm_pool_name[LOV_MAXPOOLNAME + 1]);
686         CHECK_MEMBER(lov_mds_md_v3, lmm_objects[0]);
687
688         CHECK_CDEFINE(LOV_MAGIC_V3);
689
690         CHECK_VALUE_X(LOV_PATTERN_RAID0);
691         CHECK_VALUE_X(LOV_PATTERN_RAID1);
692         CHECK_VALUE_X(LOV_PATTERN_FIRST);
693         CHECK_VALUE_X(LOV_PATTERN_CMOBD);
694 }
695
696 static void
697 check_lmv_mds_md_v1(void)
698 {
699         BLANK_LINE();
700         CHECK_STRUCT(lmv_mds_md_v1);
701         CHECK_MEMBER(lmv_mds_md_v1, lmv_magic);
702         CHECK_MEMBER(lmv_mds_md_v1, lmv_stripe_count);
703         CHECK_MEMBER(lmv_mds_md_v1, lmv_master_mdt_index);
704         CHECK_MEMBER(lmv_mds_md_v1, lmv_hash_type);
705         CHECK_MEMBER(lmv_mds_md_v1, lmv_layout_version);
706         CHECK_MEMBER(lmv_mds_md_v1, lmv_padding1);
707         CHECK_MEMBER(lmv_mds_md_v1, lmv_padding2);
708         CHECK_MEMBER(lmv_mds_md_v1, lmv_padding3);
709         CHECK_MEMBER(lmv_mds_md_v1, lmv_pool_name[LOV_MAXPOOLNAME]);
710         CHECK_MEMBER(lmv_mds_md_v1, lmv_stripe_fids[0]);
711
712         CHECK_CDEFINE(LMV_MAGIC_V1);
713         CHECK_CDEFINE(LMV_MAGIC_STRIPE);
714         CHECK_CDEFINE(LMV_HASH_TYPE_MASK);
715         CHECK_CDEFINE(LMV_HASH_FLAG_MIGRATION);
716         CHECK_CDEFINE(LMV_HASH_FLAG_DEAD);
717         CHECK_CDEFINE(LMV_HASH_FLAG_BAD_TYPE);
718         CHECK_CDEFINE(LMV_HASH_FLAG_LOST_LMV);
719 }
720
721 static void
722 check_obd_statfs(void)
723 {
724         BLANK_LINE();
725         CHECK_STRUCT(obd_statfs);
726         CHECK_MEMBER(obd_statfs, os_type);
727         CHECK_MEMBER(obd_statfs, os_blocks);
728         CHECK_MEMBER(obd_statfs, os_bfree);
729         CHECK_MEMBER(obd_statfs, os_bavail);
730         CHECK_MEMBER(obd_statfs, os_ffree);
731         CHECK_MEMBER(obd_statfs, os_fsid);
732         CHECK_MEMBER(obd_statfs, os_bsize);
733         CHECK_MEMBER(obd_statfs, os_namelen);
734         CHECK_MEMBER(obd_statfs, os_state);
735         CHECK_MEMBER(obd_statfs, os_fprecreated);
736         CHECK_MEMBER(obd_statfs, os_spare2);
737         CHECK_MEMBER(obd_statfs, os_spare3);
738         CHECK_MEMBER(obd_statfs, os_spare4);
739         CHECK_MEMBER(obd_statfs, os_spare5);
740         CHECK_MEMBER(obd_statfs, os_spare6);
741         CHECK_MEMBER(obd_statfs, os_spare7);
742         CHECK_MEMBER(obd_statfs, os_spare8);
743         CHECK_MEMBER(obd_statfs, os_spare9);
744 }
745
746 static void
747 check_obd_ioobj(void)
748 {
749         BLANK_LINE();
750         CHECK_STRUCT(obd_ioobj);
751         CHECK_MEMBER(obd_ioobj, ioo_oid);
752         CHECK_MEMBER(obd_ioobj, ioo_max_brw);
753         CHECK_MEMBER(obd_ioobj, ioo_bufcnt);
754 }
755
756 static void
757 check_obd_quotactl(void)
758 {
759
760         BLANK_LINE();
761         CHECK_UNION(lquota_id);
762
763         BLANK_LINE();
764         CHECK_VALUE(QUOTABLOCK_BITS);
765         CHECK_VALUE(QUOTABLOCK_SIZE);
766
767         BLANK_LINE();
768         CHECK_STRUCT(obd_quotactl);
769         CHECK_MEMBER(obd_quotactl, qc_cmd);
770         CHECK_MEMBER(obd_quotactl, qc_type);
771         CHECK_MEMBER(obd_quotactl, qc_id);
772         CHECK_MEMBER(obd_quotactl, qc_stat);
773         CHECK_MEMBER(obd_quotactl, qc_dqinfo);
774         CHECK_MEMBER(obd_quotactl, qc_dqblk);
775
776         BLANK_LINE();
777         CHECK_STRUCT(obd_dqinfo);
778         CHECK_MEMBER(obd_dqinfo, dqi_bgrace);
779         CHECK_MEMBER(obd_dqinfo, dqi_igrace);
780         CHECK_MEMBER(obd_dqinfo, dqi_flags);
781         CHECK_MEMBER(obd_dqinfo, dqi_valid);
782
783         BLANK_LINE();
784         CHECK_STRUCT(obd_dqblk);
785         CHECK_MEMBER(obd_dqblk, dqb_bhardlimit);
786         CHECK_MEMBER(obd_dqblk, dqb_bsoftlimit);
787         CHECK_MEMBER(obd_dqblk, dqb_curspace);
788         CHECK_MEMBER(obd_dqblk, dqb_ihardlimit);
789         CHECK_MEMBER(obd_dqblk, dqb_isoftlimit);
790         CHECK_MEMBER(obd_dqblk, dqb_curinodes);
791         CHECK_MEMBER(obd_dqblk, dqb_btime);
792         CHECK_MEMBER(obd_dqblk, dqb_itime);
793         CHECK_MEMBER(obd_dqblk, dqb_valid);
794         CHECK_MEMBER(obd_dqblk, dqb_padding);
795
796         CHECK_DEFINE_X(Q_QUOTACHECK);
797         CHECK_DEFINE_X(Q_INITQUOTA);
798         CHECK_DEFINE_X(Q_GETOINFO);
799         CHECK_DEFINE_X(Q_GETOQUOTA);
800         CHECK_DEFINE_X(Q_FINVALIDATE);
801
802         BLANK_LINE();
803         CHECK_STRUCT(lquota_acct_rec);
804         CHECK_MEMBER(lquota_acct_rec, bspace);
805         CHECK_MEMBER(lquota_acct_rec, ispace);
806
807         BLANK_LINE();
808         CHECK_STRUCT(lquota_glb_rec);
809         CHECK_MEMBER(lquota_glb_rec, qbr_hardlimit);
810         CHECK_MEMBER(lquota_glb_rec, qbr_softlimit);
811         CHECK_MEMBER(lquota_glb_rec, qbr_time);
812         CHECK_MEMBER(lquota_glb_rec, qbr_granted);
813
814         BLANK_LINE();
815         CHECK_STRUCT(lquota_slv_rec);
816         CHECK_MEMBER(lquota_slv_rec, qsr_granted);
817
818 }
819
820 static void
821 check_obd_idx_read(void)
822 {
823         BLANK_LINE();
824         CHECK_STRUCT(idx_info);
825         CHECK_MEMBER(idx_info, ii_magic);
826         CHECK_MEMBER(idx_info, ii_flags);
827         CHECK_MEMBER(idx_info, ii_count);
828         CHECK_MEMBER(idx_info, ii_pad0);
829         CHECK_MEMBER(idx_info, ii_attrs);
830         CHECK_MEMBER(idx_info, ii_fid);
831         CHECK_MEMBER(idx_info, ii_version);
832         CHECK_MEMBER(idx_info, ii_hash_start);
833         CHECK_MEMBER(idx_info, ii_hash_end);
834         CHECK_MEMBER(idx_info, ii_keysize);
835         CHECK_MEMBER(idx_info, ii_recsize);
836         CHECK_MEMBER(idx_info, ii_pad1);
837         CHECK_MEMBER(idx_info, ii_pad2);
838         CHECK_MEMBER(idx_info, ii_pad3);
839         CHECK_CDEFINE(IDX_INFO_MAGIC);
840
841         BLANK_LINE();
842         CHECK_STRUCT(lu_idxpage);
843         CHECK_MEMBER(lu_idxpage, lip_magic);
844         CHECK_MEMBER(lu_idxpage, lip_flags);
845         CHECK_MEMBER(lu_idxpage, lip_nr);
846         CHECK_MEMBER(lu_idxpage, lip_pad0);
847
848         CHECK_CDEFINE(LIP_MAGIC);
849         CHECK_VALUE(LIP_HDR_SIZE);
850
851         CHECK_VALUE(II_FL_NOHASH);
852         CHECK_VALUE(II_FL_VARKEY);
853         CHECK_VALUE(II_FL_VARREC);
854         CHECK_VALUE(II_FL_NONUNQ);
855 }
856
857 static void
858 check_niobuf_remote(void)
859 {
860         BLANK_LINE();
861         CHECK_STRUCT(niobuf_remote);
862         CHECK_MEMBER(niobuf_remote, rnb_offset);
863         CHECK_MEMBER(niobuf_remote, rnb_len);
864         CHECK_MEMBER(niobuf_remote, rnb_flags);
865
866         CHECK_DEFINE_X(OBD_BRW_READ);
867         CHECK_DEFINE_X(OBD_BRW_WRITE);
868         CHECK_DEFINE_X(OBD_BRW_SYNC);
869         CHECK_DEFINE_X(OBD_BRW_CHECK);
870         CHECK_DEFINE_X(OBD_BRW_FROM_GRANT);
871         CHECK_DEFINE_X(OBD_BRW_GRANTED);
872         CHECK_DEFINE_X(OBD_BRW_NOCACHE);
873         CHECK_DEFINE_X(OBD_BRW_NOQUOTA);
874         CHECK_DEFINE_X(OBD_BRW_SRVLOCK);
875         CHECK_DEFINE_X(OBD_BRW_ASYNC);
876         CHECK_DEFINE_X(OBD_BRW_MEMALLOC);
877         CHECK_DEFINE_X(OBD_BRW_OVER_USRQUOTA);
878         CHECK_DEFINE_X(OBD_BRW_OVER_GRPQUOTA);
879         CHECK_DEFINE_X(OBD_BRW_SOFT_SYNC);
880 }
881
882 static void
883 check_ost_body(void)
884 {
885         BLANK_LINE();
886         CHECK_STRUCT(ost_body);
887         CHECK_MEMBER(ost_body, oa);
888 }
889
890 static void
891 check_ll_fid(void)
892 {
893         BLANK_LINE();
894         CHECK_STRUCT(ll_fid);
895         CHECK_MEMBER(ll_fid, id);
896         CHECK_MEMBER(ll_fid, generation);
897         CHECK_MEMBER(ll_fid, f_type);
898 }
899
900 static void
901 check_mdt_body(void)
902 {
903         BLANK_LINE();
904         CHECK_STRUCT(mdt_body);
905         CHECK_MEMBER(mdt_body, mbo_fid1);
906         CHECK_MEMBER(mdt_body, mbo_fid2);
907         CHECK_MEMBER(mdt_body, mbo_handle);
908         CHECK_MEMBER(mdt_body, mbo_valid);
909         CHECK_MEMBER(mdt_body, mbo_size);
910         CHECK_MEMBER(mdt_body, mbo_mtime);
911         CHECK_MEMBER(mdt_body, mbo_atime);
912         CHECK_MEMBER(mdt_body, mbo_ctime);
913         CHECK_MEMBER(mdt_body, mbo_blocks);
914         CHECK_MEMBER(mdt_body, mbo_t_state);
915         CHECK_MEMBER(mdt_body, mbo_fsuid);
916         CHECK_MEMBER(mdt_body, mbo_fsgid);
917         CHECK_MEMBER(mdt_body, mbo_capability);
918         CHECK_MEMBER(mdt_body, mbo_mode);
919         CHECK_MEMBER(mdt_body, mbo_uid);
920         CHECK_MEMBER(mdt_body, mbo_gid);
921         CHECK_MEMBER(mdt_body, mbo_flags);
922         CHECK_MEMBER(mdt_body, mbo_rdev);
923         CHECK_MEMBER(mdt_body, mbo_nlink);
924         CHECK_MEMBER(mdt_body, mbo_unused2);
925         CHECK_MEMBER(mdt_body, mbo_suppgid);
926         CHECK_MEMBER(mdt_body, mbo_eadatasize);
927         CHECK_MEMBER(mdt_body, mbo_aclsize);
928         CHECK_MEMBER(mdt_body, mbo_max_mdsize);
929         CHECK_MEMBER(mdt_body, mbo_unused3);
930         CHECK_MEMBER(mdt_body, mbo_uid_h);
931         CHECK_MEMBER(mdt_body, mbo_gid_h);
932         CHECK_MEMBER(mdt_body, mbo_padding_5);
933         CHECK_MEMBER(mdt_body, mbo_padding_6);
934         CHECK_MEMBER(mdt_body, mbo_padding_7);
935         CHECK_MEMBER(mdt_body, mbo_padding_8);
936         CHECK_MEMBER(mdt_body, mbo_padding_9);
937         CHECK_MEMBER(mdt_body, mbo_padding_10);
938
939         CHECK_VALUE_O(MDS_FMODE_CLOSED);
940         CHECK_VALUE_O(MDS_FMODE_EXEC);
941
942         CHECK_VALUE_O(MDS_OPEN_CREATED);
943         CHECK_VALUE_O(MDS_OPEN_CROSS);
944         CHECK_VALUE_O(MDS_OPEN_CREAT);
945         CHECK_VALUE_O(MDS_OPEN_EXCL);
946         CHECK_VALUE_O(MDS_OPEN_TRUNC);
947         CHECK_VALUE_O(MDS_OPEN_APPEND);
948         CHECK_VALUE_O(MDS_OPEN_SYNC);
949         CHECK_VALUE_O(MDS_OPEN_DIRECTORY);
950         CHECK_VALUE_O(MDS_OPEN_BY_FID);
951         CHECK_VALUE_O(MDS_OPEN_DELAY_CREATE);
952         CHECK_VALUE_O(MDS_OPEN_OWNEROVERRIDE);
953         CHECK_VALUE_O(MDS_OPEN_JOIN_FILE);
954         CHECK_VALUE_O(MDS_OPEN_LOCK);
955         CHECK_VALUE_O(MDS_OPEN_HAS_EA);
956         CHECK_VALUE_O(MDS_OPEN_HAS_OBJS);
957         CHECK_VALUE_64O(MDS_OPEN_NORESTORE);
958         CHECK_VALUE_64O(MDS_OPEN_NEWSTRIPE);
959         CHECK_VALUE_64O(MDS_OPEN_VOLATILE);
960
961         /* these should be identical to their EXT3_*_FL counterparts, and
962          * are redefined only to avoid dragging in ext3_fs.h */
963         CHECK_DEFINE_X(LUSTRE_SYNC_FL);
964         CHECK_DEFINE_X(LUSTRE_IMMUTABLE_FL);
965         CHECK_DEFINE_X(LUSTRE_APPEND_FL);
966         CHECK_DEFINE_X(LUSTRE_NODUMP_FL);
967         CHECK_DEFINE_X(LUSTRE_NOATIME_FL);
968         CHECK_DEFINE_X(LUSTRE_INDEX_FL);
969         CHECK_DEFINE_X(LUSTRE_DIRSYNC_FL);
970         CHECK_DEFINE_X(LUSTRE_TOPDIR_FL);
971         CHECK_DEFINE_X(LUSTRE_DIRECTIO_FL);
972         CHECK_DEFINE_X(LUSTRE_INLINE_DATA_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, mio_handle);
986         CHECK_MEMBER(mdt_ioepoch, mio_unused1);
987         CHECK_MEMBER(mdt_ioepoch, mio_unused2);
988         CHECK_MEMBER(mdt_ioepoch, mio_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         CHECK_VALUE(IT_OPEN);
1308         CHECK_VALUE(IT_CREAT);
1309         CHECK_VALUE(IT_READDIR);
1310         CHECK_VALUE(IT_GETATTR);
1311         CHECK_VALUE(IT_LOOKUP);
1312         CHECK_VALUE(IT_UNLINK);
1313         CHECK_VALUE(IT_TRUNC);
1314         CHECK_VALUE(IT_GETXATTR);
1315         CHECK_VALUE(IT_EXEC);
1316         CHECK_VALUE(IT_PIN);
1317         CHECK_VALUE(IT_LAYOUT);
1318         CHECK_VALUE(IT_QUOTA_DQACQ);
1319         CHECK_VALUE(IT_QUOTA_CONN);
1320         CHECK_VALUE(IT_SETXATTR);
1321 }
1322
1323 static void
1324 check_ldlm_resource_desc(void)
1325 {
1326         BLANK_LINE();
1327         CHECK_STRUCT(ldlm_resource_desc);
1328         CHECK_MEMBER(ldlm_resource_desc, lr_type);
1329         CHECK_MEMBER(ldlm_resource_desc, lr_pad);
1330         CHECK_MEMBER(ldlm_resource_desc, lr_name);
1331 }
1332
1333 static void
1334 check_ldlm_lock_desc(void)
1335 {
1336         BLANK_LINE();
1337         CHECK_STRUCT(ldlm_lock_desc);
1338         CHECK_MEMBER(ldlm_lock_desc, l_resource);
1339         CHECK_MEMBER(ldlm_lock_desc, l_req_mode);
1340         CHECK_MEMBER(ldlm_lock_desc, l_granted_mode);
1341         CHECK_MEMBER(ldlm_lock_desc, l_policy_data);
1342 }
1343
1344 static void
1345 check_ldlm_request(void)
1346 {
1347         BLANK_LINE();
1348         CHECK_STRUCT(ldlm_request);
1349         CHECK_MEMBER(ldlm_request, lock_flags);
1350         CHECK_MEMBER(ldlm_request, lock_count);
1351         CHECK_MEMBER(ldlm_request, lock_desc);
1352         CHECK_MEMBER(ldlm_request, lock_handle);
1353 }
1354
1355 static void
1356 check_ldlm_reply(void)
1357 {
1358         BLANK_LINE();
1359         CHECK_STRUCT(ldlm_reply);
1360         CHECK_MEMBER(ldlm_reply, lock_flags);
1361         CHECK_MEMBER(ldlm_reply, lock_padding);
1362         CHECK_MEMBER(ldlm_reply, lock_desc);
1363         CHECK_MEMBER(ldlm_reply, lock_handle);
1364         CHECK_MEMBER(ldlm_reply, lock_policy_res1);
1365         CHECK_MEMBER(ldlm_reply, lock_policy_res2);
1366 }
1367
1368 static void
1369 check_ldlm_ost_lvb_v1(void)
1370 {
1371         BLANK_LINE();
1372         CHECK_STRUCT(ost_lvb_v1);
1373         CHECK_MEMBER(ost_lvb_v1, lvb_size);
1374         CHECK_MEMBER(ost_lvb_v1, lvb_mtime);
1375         CHECK_MEMBER(ost_lvb_v1, lvb_atime);
1376         CHECK_MEMBER(ost_lvb_v1, lvb_ctime);
1377         CHECK_MEMBER(ost_lvb_v1, lvb_blocks);
1378 }
1379
1380 static void
1381 check_ldlm_ost_lvb(void)
1382 {
1383         BLANK_LINE();
1384         CHECK_STRUCT(ost_lvb);
1385         CHECK_MEMBER(ost_lvb, lvb_size);
1386         CHECK_MEMBER(ost_lvb, lvb_mtime);
1387         CHECK_MEMBER(ost_lvb, lvb_atime);
1388         CHECK_MEMBER(ost_lvb, lvb_ctime);
1389         CHECK_MEMBER(ost_lvb, lvb_blocks);
1390         CHECK_MEMBER(ost_lvb, lvb_mtime_ns);
1391         CHECK_MEMBER(ost_lvb, lvb_atime_ns);
1392         CHECK_MEMBER(ost_lvb, lvb_ctime_ns);
1393         CHECK_MEMBER(ost_lvb, lvb_padding);
1394 }
1395
1396 static void
1397 check_ldlm_lquota_lvb(void)
1398 {
1399         BLANK_LINE();
1400         CHECK_STRUCT(lquota_lvb);
1401         CHECK_MEMBER(lquota_lvb, lvb_flags);
1402         CHECK_MEMBER(lquota_lvb, lvb_id_may_rel);
1403         CHECK_MEMBER(lquota_lvb, lvb_id_rel);
1404         CHECK_MEMBER(lquota_lvb, lvb_id_qunit);
1405         CHECK_MEMBER(lquota_lvb, lvb_pad1);
1406         CHECK_VALUE(LQUOTA_FL_EDQUOT);
1407 }
1408
1409 static void
1410 check_ldlm_gl_lquota_desc(void)
1411 {
1412         BLANK_LINE();
1413         CHECK_STRUCT(ldlm_gl_lquota_desc);
1414         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_id);
1415         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_flags);
1416         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_ver);
1417         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_hardlimit);
1418         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_softlimit);
1419         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_time);
1420         CHECK_MEMBER(ldlm_gl_lquota_desc, gl_pad2);
1421 }
1422
1423
1424 static void
1425 check_mgs_send_param(void)
1426 {
1427         BLANK_LINE();
1428         CHECK_STRUCT(mgs_send_param);
1429         CHECK_CVALUE(MGS_PARAM_MAXLEN);
1430         CHECK_MEMBER(mgs_send_param, mgs_param[MGS_PARAM_MAXLEN]);
1431 }
1432
1433 static void
1434 check_cfg_marker(void)
1435 {
1436         BLANK_LINE();
1437         CHECK_STRUCT(cfg_marker);
1438         CHECK_MEMBER(cfg_marker, cm_step);
1439         CHECK_MEMBER(cfg_marker, cm_flags);
1440         CHECK_MEMBER(cfg_marker, cm_vers);
1441         CHECK_MEMBER(cfg_marker, cm_padding);
1442         CHECK_MEMBER(cfg_marker, cm_createtime);
1443         CHECK_MEMBER(cfg_marker, cm_canceltime);
1444         CHECK_MEMBER(cfg_marker, cm_tgtname);
1445         CHECK_MEMBER(cfg_marker, cm_comment);
1446 }
1447
1448 static void
1449 check_llog_logid(void)
1450 {
1451         BLANK_LINE();
1452         CHECK_STRUCT(llog_logid);
1453         CHECK_MEMBER(llog_logid, lgl_oi);
1454         CHECK_MEMBER(llog_logid, lgl_ogen);
1455
1456         CHECK_CVALUE(OST_SZ_REC);
1457         CHECK_CVALUE(MDS_UNLINK_REC);
1458         CHECK_CVALUE(MDS_UNLINK64_REC);
1459         CHECK_CVALUE(MDS_SETATTR64_REC);
1460         CHECK_CVALUE(OBD_CFG_REC);
1461         CHECK_CVALUE(LLOG_GEN_REC);
1462         CHECK_CVALUE(CHANGELOG_REC);
1463         CHECK_CVALUE(CHANGELOG_USER_REC);
1464         CHECK_CVALUE(LLOG_HDR_MAGIC);
1465         CHECK_CVALUE(LLOG_LOGID_MAGIC);
1466 }
1467
1468 static void
1469 check_llog_catid(void)
1470 {
1471         BLANK_LINE();
1472         CHECK_STRUCT(llog_catid);
1473         CHECK_MEMBER(llog_catid, lci_logid);
1474         CHECK_MEMBER(llog_catid, lci_padding1);
1475         CHECK_MEMBER(llog_catid, lci_padding2);
1476         CHECK_MEMBER(llog_catid, lci_padding3);
1477 }
1478
1479 static void
1480 check_llog_rec_hdr(void)
1481 {
1482         BLANK_LINE();
1483         CHECK_STRUCT(llog_rec_hdr);
1484         CHECK_MEMBER(llog_rec_hdr, lrh_len);
1485         CHECK_MEMBER(llog_rec_hdr, lrh_index);
1486         CHECK_MEMBER(llog_rec_hdr, lrh_type);
1487         CHECK_MEMBER(llog_rec_hdr, lrh_id);
1488 }
1489
1490 static void
1491 check_llog_rec_tail(void)
1492 {
1493         BLANK_LINE();
1494         CHECK_STRUCT(llog_rec_tail);
1495         CHECK_MEMBER(llog_rec_tail, lrt_len);
1496         CHECK_MEMBER(llog_rec_tail, lrt_index);
1497 }
1498
1499 static void
1500 check_llog_logid_rec(void)
1501 {
1502         BLANK_LINE();
1503         CHECK_STRUCT(llog_logid_rec);
1504         CHECK_MEMBER(llog_logid_rec, lid_hdr);
1505         CHECK_MEMBER(llog_logid_rec, lid_id);
1506         CHECK_MEMBER(llog_logid_rec, lid_padding1);
1507         CHECK_MEMBER(llog_logid_rec, lid_padding2);
1508         CHECK_MEMBER(llog_logid_rec, lid_padding3);
1509         CHECK_MEMBER(llog_logid_rec, lid_tail);
1510 }
1511
1512 static void
1513 check_llog_unlink_rec(void)
1514 {
1515         BLANK_LINE();
1516         CHECK_STRUCT(llog_unlink_rec);
1517         CHECK_MEMBER(llog_unlink_rec, lur_hdr);
1518         CHECK_MEMBER(llog_unlink_rec, lur_oid);
1519         CHECK_MEMBER(llog_unlink_rec, lur_oseq);
1520         CHECK_MEMBER(llog_unlink_rec, lur_count);
1521         CHECK_MEMBER(llog_unlink_rec, lur_tail);
1522 }
1523
1524 static void
1525 check_llog_unlink64_rec(void)
1526 {
1527         CHECK_STRUCT(llog_unlink64_rec);
1528         CHECK_MEMBER(llog_unlink64_rec, lur_hdr);
1529         CHECK_MEMBER(llog_unlink64_rec, lur_fid);
1530         CHECK_MEMBER(llog_unlink64_rec, lur_count);
1531         CHECK_MEMBER(llog_unlink64_rec, lur_tail);
1532         CHECK_MEMBER(llog_unlink64_rec, lur_padding1);
1533         CHECK_MEMBER(llog_unlink64_rec, lur_padding2);
1534         CHECK_MEMBER(llog_unlink64_rec, lur_padding3);
1535 }
1536
1537 static void
1538 check_llog_setattr64_rec(void)
1539 {
1540         BLANK_LINE();
1541         CHECK_STRUCT(llog_setattr64_rec);
1542         CHECK_MEMBER(llog_setattr64_rec, lsr_hdr);
1543         CHECK_MEMBER(llog_setattr64_rec, lsr_oi);
1544         CHECK_MEMBER(llog_setattr64_rec, lsr_uid);
1545         CHECK_MEMBER(llog_setattr64_rec, lsr_uid_h);
1546         CHECK_MEMBER(llog_setattr64_rec, lsr_gid);
1547         CHECK_MEMBER(llog_setattr64_rec, lsr_gid_h);
1548         CHECK_MEMBER(llog_setattr64_rec, lsr_valid);
1549         CHECK_MEMBER(llog_setattr64_rec, lsr_tail);
1550 }
1551
1552 static void
1553 check_llog_size_change_rec(void)
1554 {
1555         BLANK_LINE();
1556         CHECK_STRUCT(llog_size_change_rec);
1557         CHECK_MEMBER(llog_size_change_rec, lsc_hdr);
1558         CHECK_MEMBER(llog_size_change_rec, lsc_fid);
1559         CHECK_MEMBER(llog_size_change_rec, lsc_ioepoch);
1560         CHECK_MEMBER(llog_size_change_rec, lsc_padding1);
1561         CHECK_MEMBER(llog_size_change_rec, lsc_padding2);
1562         CHECK_MEMBER(llog_size_change_rec, lsc_padding3);
1563         CHECK_MEMBER(llog_size_change_rec, lsc_tail);
1564 }
1565
1566 static void
1567 check_changelog_rec(void)
1568 {
1569         BLANK_LINE();
1570         CHECK_STRUCT(changelog_rec);
1571         CHECK_MEMBER(changelog_rec, cr_namelen);
1572         CHECK_MEMBER(changelog_rec, cr_flags);
1573         CHECK_MEMBER(changelog_rec, cr_type);
1574         CHECK_MEMBER(changelog_rec, cr_index);
1575         CHECK_MEMBER(changelog_rec, cr_prev);
1576         CHECK_MEMBER(changelog_rec, cr_time);
1577         CHECK_MEMBER(changelog_rec, cr_tfid);
1578         CHECK_MEMBER(changelog_rec, cr_pfid);
1579 }
1580
1581 static void
1582 check_changelog_ext_rename(void)
1583 {
1584         BLANK_LINE();
1585         CHECK_STRUCT(changelog_ext_rename);
1586         CHECK_MEMBER(changelog_ext_rename, cr_sfid);
1587         CHECK_MEMBER(changelog_ext_rename, cr_spfid);
1588 }
1589
1590 static void
1591 check_changelog_ext_jobid(void)
1592 {
1593         BLANK_LINE();
1594         CHECK_STRUCT(changelog_ext_jobid);
1595         CHECK_MEMBER(changelog_ext_jobid, cr_jobid);
1596 }
1597
1598 static void
1599 check_changelog_setinfo(void)
1600 {
1601         BLANK_LINE();
1602         CHECK_STRUCT(changelog_setinfo);
1603         CHECK_MEMBER(changelog_setinfo, cs_recno);
1604         CHECK_MEMBER(changelog_setinfo, cs_id);
1605 }
1606
1607 static void
1608 check_llog_changelog_rec(void)
1609 {
1610         BLANK_LINE();
1611         CHECK_STRUCT(llog_changelog_rec);
1612         CHECK_MEMBER(llog_changelog_rec, cr_hdr);
1613         CHECK_MEMBER(llog_changelog_rec, cr);
1614         CHECK_MEMBER(llog_changelog_rec, cr_do_not_use);
1615 }
1616
1617 static void
1618 check_llog_changelog_user_rec(void)
1619 {
1620         BLANK_LINE();
1621         CHECK_STRUCT(llog_changelog_user_rec);
1622         CHECK_MEMBER(llog_changelog_user_rec, cur_hdr);
1623         CHECK_MEMBER(llog_changelog_user_rec, cur_id);
1624         CHECK_MEMBER(llog_changelog_user_rec, cur_padding);
1625         CHECK_MEMBER(llog_changelog_user_rec, cur_endrec);
1626         CHECK_MEMBER(llog_changelog_user_rec, cur_tail);
1627 }
1628
1629 static void
1630 check_llog_gen(void)
1631 {
1632         BLANK_LINE();
1633         CHECK_STRUCT(llog_gen);
1634         CHECK_MEMBER(llog_gen, mnt_cnt);
1635         CHECK_MEMBER(llog_gen, conn_cnt);
1636 }
1637
1638 static void
1639 check_llog_gen_rec(void)
1640 {
1641         BLANK_LINE();
1642         CHECK_STRUCT(llog_gen_rec);
1643         CHECK_MEMBER(llog_gen_rec, lgr_hdr);
1644         CHECK_MEMBER(llog_gen_rec, lgr_gen);
1645         CHECK_MEMBER(llog_gen_rec, lgr_tail);
1646 }
1647
1648 static void
1649 check_llog_log_hdr(void)
1650 {
1651         BLANK_LINE();
1652         CHECK_STRUCT(llog_log_hdr);
1653         CHECK_MEMBER(llog_log_hdr, llh_hdr);
1654         CHECK_MEMBER(llog_log_hdr, llh_timestamp);
1655         CHECK_MEMBER(llog_log_hdr, llh_count);
1656         CHECK_MEMBER(llog_log_hdr, llh_bitmap_offset);
1657         CHECK_MEMBER(llog_log_hdr, llh_size);
1658         CHECK_MEMBER(llog_log_hdr, llh_flags);
1659         CHECK_MEMBER(llog_log_hdr, llh_cat_idx);
1660         CHECK_MEMBER(llog_log_hdr, llh_tgtuuid);
1661 }
1662
1663 static void
1664 check_llog_cookie(void)
1665 {
1666         BLANK_LINE();
1667         CHECK_STRUCT(llog_cookie);
1668         CHECK_MEMBER(llog_cookie, lgc_lgl);
1669         CHECK_MEMBER(llog_cookie, lgc_subsys);
1670         CHECK_MEMBER(llog_cookie, lgc_index);
1671         CHECK_MEMBER(llog_cookie, lgc_padding);
1672 }
1673
1674 static void
1675 check_llogd_body(void)
1676 {
1677         BLANK_LINE();
1678         CHECK_STRUCT(llogd_body);
1679         CHECK_MEMBER(llogd_body, lgd_logid);
1680         CHECK_MEMBER(llogd_body, lgd_ctxt_idx);
1681         CHECK_MEMBER(llogd_body, lgd_llh_flags);
1682         CHECK_MEMBER(llogd_body, lgd_index);
1683         CHECK_MEMBER(llogd_body, lgd_saved_index);
1684         CHECK_MEMBER(llogd_body, lgd_len);
1685         CHECK_MEMBER(llogd_body, lgd_cur_offset);
1686
1687         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_CREATE);
1688         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
1689         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_READ_HEADER);
1690         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_WRITE_REC);
1691         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_CLOSE);
1692         CHECK_CVALUE(LLOG_ORIGIN_CONNECT);
1693         CHECK_CVALUE(LLOG_CATINFO);
1694         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_PREV_BLOCK);
1695         CHECK_CVALUE(LLOG_ORIGIN_HANDLE_DESTROY);
1696         CHECK_CVALUE(LLOG_FIRST_OPC);
1697         CHECK_CVALUE(LLOG_LAST_OPC);
1698
1699         CHECK_CVALUE(LLOG_CONFIG_ORIG_CTXT);
1700         CHECK_CVALUE(LLOG_CONFIG_REPL_CTXT);
1701         CHECK_CVALUE(LLOG_MDS_OST_ORIG_CTXT);
1702         CHECK_CVALUE(LLOG_MDS_OST_REPL_CTXT);
1703         CHECK_CVALUE(LLOG_SIZE_ORIG_CTXT);
1704         CHECK_CVALUE(LLOG_SIZE_REPL_CTXT);
1705         CHECK_CVALUE(LLOG_TEST_ORIG_CTXT);
1706         CHECK_CVALUE(LLOG_TEST_REPL_CTXT);
1707         CHECK_CVALUE(LLOG_CHANGELOG_ORIG_CTXT);
1708         CHECK_CVALUE(LLOG_CHANGELOG_REPL_CTXT);
1709         CHECK_CVALUE(LLOG_CHANGELOG_USER_ORIG_CTXT);
1710         CHECK_CVALUE(LLOG_AGENT_ORIG_CTXT);
1711         CHECK_CVALUE(LLOG_UPDATELOG_ORIG_CTXT);
1712         CHECK_CVALUE(LLOG_UPDATELOG_REPL_CTXT);
1713         CHECK_CVALUE(LLOG_MAX_CTXTS);
1714 }
1715
1716 static void
1717 check_llogd_conn_body(void)
1718 {
1719         BLANK_LINE();
1720         CHECK_STRUCT(llogd_conn_body);
1721         CHECK_MEMBER(llogd_conn_body, lgdc_gen);
1722         CHECK_MEMBER(llogd_conn_body, lgdc_logid);
1723         CHECK_MEMBER(llogd_conn_body, lgdc_ctxt_idx);
1724 }
1725
1726 static void
1727 check_ll_fiemap_info_key(void)
1728 {
1729         BLANK_LINE();
1730         CHECK_STRUCT(ll_fiemap_info_key);
1731         CHECK_MEMBER(ll_fiemap_info_key, lfik_name[8]);
1732         CHECK_MEMBER(ll_fiemap_info_key, lfik_oa);
1733         CHECK_MEMBER(ll_fiemap_info_key, lfik_fiemap);
1734 }
1735
1736 static void
1737 check_quota_body(void)
1738 {
1739         BLANK_LINE();
1740         CHECK_STRUCT(quota_body);
1741         CHECK_MEMBER(quota_body, qb_fid);
1742         CHECK_MEMBER(quota_body, qb_id);
1743         CHECK_MEMBER(quota_body, qb_flags);
1744         CHECK_MEMBER(quota_body, qb_padding);
1745         CHECK_MEMBER(quota_body, qb_count);
1746         CHECK_MEMBER(quota_body, qb_usage);
1747         CHECK_MEMBER(quota_body, qb_slv_ver);
1748         CHECK_MEMBER(quota_body, qb_lockh);
1749         CHECK_MEMBER(quota_body, qb_glb_lockh);
1750         CHECK_MEMBER(quota_body, qb_padding1[4]);
1751 }
1752
1753 static void
1754 check_mgs_target_info(void)
1755 {
1756         BLANK_LINE();
1757         CHECK_STRUCT(mgs_target_info);
1758         CHECK_MEMBER(mgs_target_info, mti_lustre_ver);
1759         CHECK_MEMBER(mgs_target_info, mti_stripe_index);
1760         CHECK_MEMBER(mgs_target_info, mti_config_ver);
1761         CHECK_MEMBER(mgs_target_info, mti_flags);
1762         CHECK_MEMBER(mgs_target_info, mti_nid_count);
1763         CHECK_MEMBER(mgs_target_info, mti_instance);
1764         CHECK_MEMBER(mgs_target_info, mti_fsname);
1765         CHECK_MEMBER(mgs_target_info, mti_svname);
1766         CHECK_MEMBER(mgs_target_info, mti_uuid);
1767         CHECK_MEMBER(mgs_target_info, mti_nids);
1768         CHECK_MEMBER(mgs_target_info, mti_params);
1769 }
1770
1771 static void
1772 check_lustre_capa(void)
1773 {
1774         BLANK_LINE();
1775         CHECK_STRUCT(lustre_capa);
1776         CHECK_MEMBER(lustre_capa, lc_fid);
1777         CHECK_MEMBER(lustre_capa, lc_opc);
1778         CHECK_MEMBER(lustre_capa, lc_uid);
1779         CHECK_MEMBER(lustre_capa, lc_gid);
1780         CHECK_MEMBER(lustre_capa, lc_flags);
1781         CHECK_MEMBER(lustre_capa, lc_keyid);
1782         CHECK_MEMBER(lustre_capa, lc_timeout);
1783         CHECK_MEMBER(lustre_capa, lc_expiry);
1784         CHECK_CVALUE(CAPA_HMAC_MAX_LEN);
1785         CHECK_MEMBER(lustre_capa, lc_hmac[CAPA_HMAC_MAX_LEN]);
1786 }
1787
1788 static void
1789 check_lustre_capa_key(void)
1790 {
1791         BLANK_LINE();
1792         CHECK_STRUCT(lustre_capa_key);
1793         CHECK_MEMBER(lustre_capa_key, lk_seq);
1794         CHECK_MEMBER(lustre_capa_key, lk_keyid);
1795         CHECK_MEMBER(lustre_capa_key, lk_padding);
1796         CHECK_CVALUE(CAPA_HMAC_KEY_MAX_LEN);
1797         CHECK_MEMBER(lustre_capa_key, lk_key[CAPA_HMAC_KEY_MAX_LEN]);
1798 }
1799
1800 static void
1801 check_getinfo_fid2path(void)
1802 {
1803         BLANK_LINE();
1804         CHECK_STRUCT(getinfo_fid2path);
1805         CHECK_MEMBER(getinfo_fid2path, gf_fid);
1806         CHECK_MEMBER(getinfo_fid2path, gf_recno);
1807         CHECK_MEMBER(getinfo_fid2path, gf_linkno);
1808         CHECK_MEMBER(getinfo_fid2path, gf_pathlen);
1809         CHECK_MEMBER(getinfo_fid2path, gf_path[0]);
1810 }
1811
1812 /* We don't control the definitions of posix_acl_xattr_{entry,header}
1813  * and so we shouldn't have used them in our wire protocol. But it's
1814  * too late now and so we emit checks against the *fixed* definitions
1815  * below. See LU-5607. */
1816
1817 typedef struct {
1818         __u16                   e_tag;
1819         __u16                   e_perm;
1820         __u32                   e_id;
1821 } posix_acl_xattr_entry;
1822
1823 typedef struct {
1824         __u32                   a_version;
1825         posix_acl_xattr_entry   a_entries[0];
1826 } posix_acl_xattr_header;
1827
1828 static void
1829 check_posix_acl_xattr_entry(void)
1830 {
1831         BLANK_LINE();
1832         printf("#ifdef CONFIG_FS_POSIX_ACL\n");
1833         CHECK_STRUCT_TYPEDEF(posix_acl_xattr_entry);
1834         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_tag);
1835         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_perm);
1836         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_id);
1837         printf("#endif /* CONFIG_FS_POSIX_ACL */\n");
1838 }
1839
1840 static void
1841 check_posix_acl_xattr_header(void)
1842 {
1843         BLANK_LINE();
1844         printf("#ifdef CONFIG_FS_POSIX_ACL\n");
1845         CHECK_STRUCT_TYPEDEF(posix_acl_xattr_header);
1846         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_version);
1847         CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_entries);
1848         printf("#endif /* CONFIG_FS_POSIX_ACL */\n");
1849 }
1850
1851 static void
1852 check_ll_user_fiemap(void)
1853 {
1854         BLANK_LINE();
1855         CHECK_STRUCT(fiemap);
1856         CHECK_MEMBER(fiemap, fm_start);
1857         CHECK_MEMBER(fiemap, fm_length);
1858         CHECK_MEMBER(fiemap, fm_flags);
1859         CHECK_MEMBER(fiemap, fm_mapped_extents);
1860         CHECK_MEMBER(fiemap, fm_extent_count);
1861         CHECK_MEMBER(fiemap, fm_reserved);
1862         CHECK_MEMBER(fiemap, fm_extents);
1863
1864         CHECK_CDEFINE(FIEMAP_FLAG_SYNC);
1865         CHECK_CDEFINE(FIEMAP_FLAG_XATTR);
1866         CHECK_CDEFINE(FIEMAP_FLAG_DEVICE_ORDER);
1867 }
1868
1869 static void
1870 check_ll_fiemap_extent(void)
1871 {
1872         BLANK_LINE();
1873         CHECK_STRUCT(fiemap_extent);
1874         CHECK_MEMBER(fiemap_extent, fe_logical);
1875         CHECK_MEMBER(fiemap_extent, fe_physical);
1876         CHECK_MEMBER(fiemap_extent, fe_length);
1877         CHECK_MEMBER(fiemap_extent, fe_flags);
1878         CHECK_MEMBER(fiemap_extent, fe_device);
1879
1880         CHECK_CDEFINE(FIEMAP_EXTENT_LAST);
1881         CHECK_CDEFINE(FIEMAP_EXTENT_UNKNOWN);
1882         CHECK_CDEFINE(FIEMAP_EXTENT_DELALLOC);
1883         CHECK_CDEFINE(FIEMAP_EXTENT_ENCODED);
1884         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_ENCRYPTED);
1885         CHECK_CDEFINE(FIEMAP_EXTENT_NOT_ALIGNED);
1886         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_INLINE);
1887         CHECK_CDEFINE(FIEMAP_EXTENT_DATA_TAIL);
1888         CHECK_CDEFINE(FIEMAP_EXTENT_UNWRITTEN);
1889         CHECK_CDEFINE(FIEMAP_EXTENT_MERGED);
1890         CHECK_CDEFINE(FIEMAP_EXTENT_NO_DIRECT);
1891         CHECK_CDEFINE(FIEMAP_EXTENT_NET);
1892 }
1893
1894 static void
1895 check_link_ea_header(void)
1896 {
1897         BLANK_LINE();
1898         CHECK_STRUCT(link_ea_header);
1899         CHECK_MEMBER(link_ea_header, leh_magic);
1900         CHECK_MEMBER(link_ea_header, leh_reccount);
1901         CHECK_MEMBER(link_ea_header, leh_len);
1902         CHECK_MEMBER(link_ea_header, padding1);
1903         CHECK_MEMBER(link_ea_header, padding2);
1904
1905         CHECK_CDEFINE(LINK_EA_MAGIC);
1906 }
1907
1908 static void
1909 check_link_ea_entry(void)
1910 {
1911         BLANK_LINE();
1912         CHECK_STRUCT(link_ea_entry);
1913         CHECK_MEMBER(link_ea_entry, lee_reclen);
1914         CHECK_MEMBER(link_ea_entry, lee_parent_fid);
1915         CHECK_MEMBER(link_ea_entry, lee_name);
1916 }
1917
1918 static void
1919 check_hsm_user_item(void)
1920 {
1921         BLANK_LINE();
1922         CHECK_STRUCT(hsm_user_item);
1923         CHECK_MEMBER(hsm_user_item, hui_fid);
1924         CHECK_MEMBER(hsm_user_item, hui_extent);
1925 }
1926
1927 static void
1928 check_hsm_user_state(void)
1929 {
1930         BLANK_LINE();
1931         CHECK_STRUCT(hsm_user_state);
1932         CHECK_MEMBER(hsm_user_state, hus_states);
1933         CHECK_MEMBER(hsm_user_state, hus_archive_id);
1934         CHECK_MEMBER(hsm_user_state, hus_in_progress_state);
1935         CHECK_MEMBER(hsm_user_state, hus_in_progress_action);
1936         CHECK_MEMBER(hsm_user_state, hus_in_progress_location);
1937 }
1938
1939 static void
1940 check_hsm_action_item(void)
1941 {
1942         BLANK_LINE();
1943         CHECK_STRUCT(hsm_action_item);
1944         CHECK_MEMBER(hsm_action_item, hai_len);
1945         CHECK_MEMBER(hsm_action_item, hai_action);
1946         CHECK_MEMBER(hsm_action_item, hai_fid);
1947         CHECK_MEMBER(hsm_action_item, hai_dfid);
1948         CHECK_MEMBER(hsm_action_item, hai_extent);
1949         CHECK_MEMBER(hsm_action_item, hai_cookie);
1950         CHECK_MEMBER(hsm_action_item, hai_gid);
1951         CHECK_MEMBER(hsm_action_item, hai_data);
1952 }
1953
1954 static void
1955 check_hsm_action_list(void)
1956 {
1957         BLANK_LINE();
1958         CHECK_STRUCT(hsm_action_list);
1959         CHECK_MEMBER(hsm_action_list, hal_version);
1960         CHECK_MEMBER(hsm_action_list, hal_count);
1961         CHECK_MEMBER(hsm_action_list, hal_compound_id);
1962         CHECK_MEMBER(hsm_action_list, hal_flags);
1963         CHECK_MEMBER(hsm_action_list, hal_archive_id);
1964         CHECK_MEMBER(hsm_action_list, padding1);
1965         CHECK_MEMBER(hsm_action_list, hal_fsname);
1966 }
1967
1968 static void
1969 check_hsm_progress_kernel(void)
1970 {
1971         BLANK_LINE();
1972         CHECK_STRUCT(hsm_progress_kernel);
1973         CHECK_MEMBER(hsm_progress_kernel, hpk_fid);
1974         CHECK_MEMBER(hsm_progress_kernel, hpk_cookie);
1975         CHECK_MEMBER(hsm_progress_kernel, hpk_extent);
1976         CHECK_MEMBER(hsm_progress_kernel, hpk_flags);
1977         CHECK_MEMBER(hsm_progress_kernel, hpk_errval);
1978         CHECK_MEMBER(hsm_progress_kernel, hpk_padding1);
1979         CHECK_MEMBER(hsm_progress_kernel, hpk_data_version);
1980         CHECK_MEMBER(hsm_progress_kernel, hpk_padding2);
1981 }
1982
1983 static void
1984 check_hsm_progress(void)
1985 {
1986         BLANK_LINE();
1987         CHECK_STRUCT(hsm_progress);
1988         CHECK_MEMBER(hsm_progress, hp_fid);
1989         CHECK_MEMBER(hsm_progress, hp_cookie);
1990         CHECK_MEMBER(hsm_progress, hp_extent);
1991         CHECK_MEMBER(hsm_progress, hp_flags);
1992         CHECK_MEMBER(hsm_progress, hp_errval);
1993         CHECK_MEMBER(hsm_progress, padding);
1994         CHECK_DEFINE_X(HP_FLAG_COMPLETED);
1995         CHECK_DEFINE_X(HP_FLAG_RETRY);
1996 }
1997
1998 static void
1999 check_hsm_copy(void)
2000 {
2001         BLANK_LINE();
2002         CHECK_MEMBER(hsm_copy, hc_data_version);
2003         CHECK_MEMBER(hsm_copy, hc_flags);
2004         CHECK_MEMBER(hsm_copy, hc_errval);
2005         CHECK_MEMBER(hsm_copy, padding);
2006         CHECK_MEMBER(hsm_copy, hc_hai);
2007 }
2008
2009 static void check_layout_intent(void)
2010 {
2011         BLANK_LINE();
2012         CHECK_STRUCT(layout_intent);
2013         CHECK_MEMBER(layout_intent, li_opc);
2014         CHECK_MEMBER(layout_intent, li_flags);
2015         CHECK_MEMBER(layout_intent, li_start);
2016         CHECK_MEMBER(layout_intent, li_end);
2017
2018         CHECK_VALUE(LAYOUT_INTENT_ACCESS);
2019         CHECK_VALUE(LAYOUT_INTENT_READ);
2020         CHECK_VALUE(LAYOUT_INTENT_WRITE);
2021         CHECK_VALUE(LAYOUT_INTENT_GLIMPSE);
2022         CHECK_VALUE(LAYOUT_INTENT_TRUNC);
2023         CHECK_VALUE(LAYOUT_INTENT_RELEASE);
2024         CHECK_VALUE(LAYOUT_INTENT_RESTORE);
2025 }
2026
2027 static void check_hsm_state_set(void)
2028 {
2029         BLANK_LINE();
2030         CHECK_STRUCT(hsm_state_set);
2031         CHECK_MEMBER(hsm_state_set, hss_valid);
2032         CHECK_MEMBER(hsm_state_set, hss_archive_id);
2033         CHECK_MEMBER(hsm_state_set, hss_setmask);
2034         CHECK_MEMBER(hsm_state_set, hss_clearmask);
2035 }
2036
2037 static void check_hsm_current_action(void)
2038 {
2039         BLANK_LINE();
2040         CHECK_STRUCT(hsm_current_action);
2041         CHECK_MEMBER(hsm_current_action, hca_state);
2042         CHECK_MEMBER(hsm_current_action, hca_action);
2043         CHECK_MEMBER(hsm_current_action, hca_location);
2044 }
2045
2046 static void check_hsm_request(void)
2047 {
2048         BLANK_LINE();
2049         CHECK_STRUCT(hsm_request);
2050         CHECK_MEMBER(hsm_request, hr_action);
2051         CHECK_MEMBER(hsm_request, hr_archive_id);
2052         CHECK_MEMBER(hsm_request, hr_flags);
2053         CHECK_MEMBER(hsm_request, hr_itemcount);
2054         CHECK_MEMBER(hsm_request, hr_data_len);
2055         CHECK_VALUE_X(HSM_FORCE_ACTION);
2056         CHECK_VALUE_X(HSM_GHOST_COPY);
2057 }
2058
2059 static void check_hsm_user_request(void)
2060 {
2061         BLANK_LINE();
2062         CHECK_STRUCT(hsm_user_request);
2063         CHECK_MEMBER(hsm_user_request, hur_request);
2064         CHECK_MEMBER(hsm_user_request, hur_user_item);
2065 }
2066
2067 static void check_hsm_user_import(void)
2068 {
2069         BLANK_LINE();
2070         CHECK_STRUCT(hsm_user_import);
2071         CHECK_MEMBER(hsm_user_import, hui_size);
2072         CHECK_MEMBER(hsm_user_import, hui_uid);
2073         CHECK_MEMBER(hsm_user_import, hui_gid);
2074         CHECK_MEMBER(hsm_user_import, hui_mode);
2075         CHECK_MEMBER(hsm_user_import, hui_atime);
2076         CHECK_MEMBER(hsm_user_import, hui_atime_ns);
2077         CHECK_MEMBER(hsm_user_import, hui_mtime);
2078         CHECK_MEMBER(hsm_user_import, hui_mtime_ns);
2079         CHECK_MEMBER(hsm_user_import, hui_archive_id);
2080 }
2081
2082 static void check_object_update_param(void)
2083 {
2084         BLANK_LINE();
2085         CHECK_STRUCT(object_update_param);
2086         CHECK_MEMBER(object_update_param, oup_len);
2087         CHECK_MEMBER(object_update_param, oup_padding);
2088         CHECK_MEMBER(object_update_param, oup_padding2);
2089         CHECK_MEMBER(object_update_param, oup_buf);
2090 }
2091
2092 static void check_object_update(void)
2093 {
2094         BLANK_LINE();
2095         CHECK_STRUCT(object_update);
2096         CHECK_MEMBER(object_update, ou_type);
2097         CHECK_MEMBER(object_update, ou_params_count);
2098         CHECK_MEMBER(object_update, ou_result_size);
2099         CHECK_MEMBER(object_update, ou_flags);
2100         CHECK_MEMBER(object_update, ou_padding1);
2101         CHECK_MEMBER(object_update, ou_batchid);
2102         CHECK_MEMBER(object_update, ou_fid);
2103         CHECK_MEMBER(object_update, ou_params);
2104 }
2105
2106 static void check_object_update_request(void)
2107 {
2108         BLANK_LINE();
2109         CHECK_STRUCT(object_update_request);
2110         CHECK_MEMBER(object_update_request, ourq_magic);
2111         CHECK_MEMBER(object_update_request, ourq_count);
2112         CHECK_MEMBER(object_update_request, ourq_padding);
2113         CHECK_MEMBER(object_update_request, ourq_updates);
2114 }
2115
2116 static void check_object_update_result(void)
2117 {
2118         BLANK_LINE();
2119         CHECK_STRUCT(object_update_result);
2120         CHECK_MEMBER(object_update_result, our_rc);
2121         CHECK_MEMBER(object_update_result, our_datalen);
2122         CHECK_MEMBER(object_update_result, our_padding);
2123         CHECK_MEMBER(object_update_result, our_data);
2124 }
2125
2126 static void check_object_update_reply(void)
2127 {
2128         BLANK_LINE();
2129         CHECK_STRUCT(object_update_reply);
2130         CHECK_MEMBER(object_update_reply, ourp_magic);
2131         CHECK_MEMBER(object_update_reply, ourp_count);
2132         CHECK_MEMBER(object_update_reply, ourp_padding);
2133         CHECK_MEMBER(object_update_reply, ourp_lens);
2134 }
2135
2136 static void check_out_update_header(void)
2137 {
2138         BLANK_LINE();
2139         CHECK_STRUCT(out_update_header);
2140         CHECK_MEMBER(out_update_header, ouh_magic);
2141         CHECK_MEMBER(out_update_header, ouh_count);
2142         CHECK_MEMBER(out_update_header, ouh_inline_length);
2143         CHECK_MEMBER(out_update_header, ouh_reply_size);
2144         CHECK_MEMBER(out_update_header, ouh_inline_data);
2145 }
2146
2147 static void check_out_update_buffer(void)
2148 {
2149         BLANK_LINE();
2150         CHECK_STRUCT(out_update_buffer);
2151         CHECK_MEMBER(out_update_buffer, oub_size);
2152         CHECK_MEMBER(out_update_buffer, oub_padding);
2153 }
2154
2155 static void check_lfsck_request(void)
2156 {
2157         BLANK_LINE();
2158         CHECK_STRUCT(lfsck_request);
2159         CHECK_MEMBER(lfsck_request, lr_event);
2160         CHECK_MEMBER(lfsck_request, lr_index);
2161         CHECK_MEMBER(lfsck_request, lr_flags);
2162         CHECK_MEMBER(lfsck_request, lr_valid);
2163         CHECK_MEMBER(lfsck_request, lr_speed);
2164         CHECK_MEMBER(lfsck_request, lr_version);
2165         CHECK_MEMBER(lfsck_request, lr_active);
2166         CHECK_MEMBER(lfsck_request, lr_param);
2167         CHECK_MEMBER(lfsck_request, lr_async_windows);
2168         CHECK_MEMBER(lfsck_request, lr_flags);
2169         CHECK_MEMBER(lfsck_request, lr_fid);
2170         CHECK_MEMBER(lfsck_request, lr_fid2);
2171         CHECK_MEMBER(lfsck_request, lr_fid3);
2172         CHECK_MEMBER(lfsck_request, lr_padding_1);
2173         CHECK_MEMBER(lfsck_request, lr_padding_2);
2174
2175         CHECK_VALUE_X(LFSCK_TYPE_SCRUB);
2176         CHECK_VALUE_X(LFSCK_TYPE_LAYOUT);
2177         CHECK_VALUE_X(LFSCK_TYPE_NAMESPACE);
2178
2179         CHECK_VALUE(LE_LASTID_REBUILDING);
2180         CHECK_VALUE(LE_LASTID_REBUILT);
2181         CHECK_VALUE(LE_PHASE1_DONE);
2182         CHECK_VALUE(LE_PHASE2_DONE);
2183         CHECK_VALUE(LE_START);
2184         CHECK_VALUE(LE_STOP);
2185         CHECK_VALUE(LE_QUERY);
2186         CHECK_VALUE(LE_FID_ACCESSED);
2187         CHECK_VALUE(LE_PEER_EXIT);
2188         CHECK_VALUE(LE_CONDITIONAL_DESTROY);
2189         CHECK_VALUE(LE_PAIRS_VERIFY);
2190         CHECK_VALUE(LE_SKIP_NLINK_DECLARE);
2191         CHECK_VALUE(LE_SKIP_NLINK);
2192         CHECK_VALUE(LE_SET_LMV_MASTER);
2193         CHECK_VALUE(LE_SET_LMV_SLAVE);
2194
2195         CHECK_VALUE_X(LEF_TO_OST);
2196         CHECK_VALUE_X(LEF_FROM_OST);
2197         CHECK_VALUE_X(LEF_SET_LMV_HASH);
2198         CHECK_VALUE_X(LEF_SET_LMV_ALL);
2199         CHECK_VALUE_X(LEF_RECHECK_NAME_HASH);
2200 }
2201
2202 static void check_lfsck_reply(void)
2203 {
2204         BLANK_LINE();
2205         CHECK_STRUCT(lfsck_reply);
2206         CHECK_MEMBER(lfsck_reply, lr_status);
2207         CHECK_MEMBER(lfsck_reply, lr_padding_1);
2208         CHECK_MEMBER(lfsck_reply, lr_padding_2);
2209 }
2210
2211 static void check_update_params(void)
2212 {
2213         BLANK_LINE();
2214         CHECK_STRUCT(update_params);
2215         CHECK_MEMBER(update_params, up_params);
2216 }
2217
2218 static void check_update_op(void)
2219 {
2220         BLANK_LINE();
2221         CHECK_STRUCT(update_op);
2222         CHECK_MEMBER(update_op, uop_fid);
2223         CHECK_MEMBER(update_op, uop_type);
2224         CHECK_MEMBER(update_op, uop_param_count);
2225         CHECK_MEMBER(update_op, uop_params_off);
2226 }
2227
2228 static void check_update_ops(void)
2229 {
2230         BLANK_LINE();
2231         CHECK_STRUCT(update_ops);
2232         CHECK_MEMBER(update_ops, uops_op);
2233 }
2234
2235 static void check_update_records(void)
2236 {
2237         BLANK_LINE();
2238         CHECK_STRUCT(update_records);
2239         CHECK_MEMBER(update_records, ur_master_transno);
2240         CHECK_MEMBER(update_records, ur_batchid);
2241         CHECK_MEMBER(update_records, ur_flags);
2242         CHECK_MEMBER(update_records, ur_index);
2243         CHECK_MEMBER(update_records, ur_update_count);
2244         CHECK_MEMBER(update_records, ur_param_count);
2245
2246         CHECK_VALUE_X(UPDATE_RECORD_CONTINUE);
2247 }
2248
2249 static void check_llog_update_record(void)
2250 {
2251         BLANK_LINE();
2252         CHECK_STRUCT(llog_update_record);
2253         CHECK_MEMBER(llog_update_record, lur_hdr);
2254         CHECK_MEMBER(llog_update_record, lur_update_rec);
2255 }
2256
2257 static void system_string(char *cmdline, char *str, int len)
2258 {
2259         int   fds[2];
2260         int   rc;
2261         pid_t pid;
2262
2263         rc = pipe(fds);
2264         if (rc != 0)
2265                 abort();
2266
2267         pid = fork();
2268         if (pid == 0) {
2269                 /* child */
2270                 int   fd = fileno(stdout);
2271
2272                 rc = dup2(fds[1], fd);
2273                 if (rc != fd)
2274                         abort();
2275
2276                 exit(system(cmdline));
2277                 /* notreached */
2278         } else if ((int)pid < 0) {
2279                 abort();
2280         } else {
2281                 FILE *f = fdopen(fds[0], "r");
2282
2283                 if (f == NULL)
2284                         abort();
2285
2286                 close(fds[1]);
2287
2288                 if (fgets(str, len, f) == NULL)
2289                         abort();
2290
2291                 if (waitpid(pid, &rc, 0) != pid)
2292                         abort();
2293
2294                 if (!WIFEXITED(rc) || WEXITSTATUS(rc) != 0)
2295                         abort();
2296
2297                 if (strnlen(str, len) == len)
2298                         str[len - 1] = 0;
2299
2300                 if (str[strlen(str) - 1] == '\n')
2301                         str[strlen(str) - 1] = 0;
2302
2303                 fclose(f);
2304         }
2305 }
2306
2307 int
2308 main(int argc, char **argv)
2309 {
2310         char unameinfo[80];
2311         char gccinfo[80];
2312
2313         system_string("uname -a", unameinfo, sizeof(unameinfo));
2314         system_string(CC " -v 2>&1 | tail -1", gccinfo, sizeof(gccinfo));
2315
2316         printf ("void lustre_assert_wire_constants(void)\n"
2317                 "{\n"
2318                 "        /* Wire protocol assertions generated by 'wirecheck'\n"
2319                 "         * (make -C lustre/utils newwiretest)\n"
2320                 "         * running on %s\n"
2321                 "         * with %s */\n"
2322                 "\n", unameinfo, gccinfo);
2323
2324         BLANK_LINE ();
2325
2326         COMMENT("Constants...");
2327         CHECK_VALUE(PTL_RPC_MSG_REQUEST);
2328         CHECK_VALUE(PTL_RPC_MSG_ERR);
2329         CHECK_VALUE(PTL_RPC_MSG_REPLY);
2330
2331         CHECK_DEFINE_64X(MDS_DIR_END_OFF);
2332
2333         CHECK_DEFINE_64X(DEAD_HANDLE_MAGIC);
2334
2335         CHECK_CVALUE(MTI_NAME_MAXLEN);
2336
2337         CHECK_VALUE(OST_REPLY);
2338         CHECK_VALUE(OST_GETATTR);
2339         CHECK_VALUE(OST_SETATTR);
2340         CHECK_VALUE(OST_READ);
2341         CHECK_VALUE(OST_WRITE);
2342         CHECK_VALUE(OST_CREATE);
2343         CHECK_VALUE(OST_DESTROY);
2344         CHECK_VALUE(OST_GET_INFO);
2345         CHECK_VALUE(OST_CONNECT);
2346         CHECK_VALUE(OST_DISCONNECT);
2347         CHECK_VALUE(OST_PUNCH);
2348         CHECK_VALUE(OST_OPEN);
2349         CHECK_VALUE(OST_CLOSE);
2350         CHECK_VALUE(OST_STATFS);
2351         CHECK_VALUE(OST_SYNC);
2352         CHECK_VALUE(OST_SET_INFO);
2353         CHECK_VALUE(OST_QUOTACHECK);
2354         CHECK_VALUE(OST_QUOTACTL);
2355         CHECK_VALUE(OST_QUOTA_ADJUST_QUNIT);
2356         CHECK_VALUE(OST_LAST_OPC);
2357
2358         CHECK_DEFINE_64X(OBD_OBJECT_EOF);
2359
2360         CHECK_VALUE(OST_MIN_PRECREATE);
2361         CHECK_VALUE(OST_MAX_PRECREATE);
2362
2363         CHECK_DEFINE_64X(OST_LVB_ERR_INIT);
2364         CHECK_DEFINE_64X(OST_LVB_ERR_MASK);
2365
2366         CHECK_VALUE(MDS_FIRST_OPC);
2367         CHECK_VALUE(MDS_GETATTR);
2368         CHECK_VALUE(MDS_GETATTR_NAME);
2369         CHECK_VALUE(MDS_CLOSE);
2370         CHECK_VALUE(MDS_REINT);
2371         CHECK_VALUE(MDS_READPAGE);
2372         CHECK_VALUE(MDS_CONNECT);
2373         CHECK_VALUE(MDS_DISCONNECT);
2374         CHECK_VALUE(MDS_GETSTATUS);
2375         CHECK_VALUE(MDS_STATFS);
2376         CHECK_VALUE(MDS_PIN);
2377         CHECK_VALUE(MDS_UNPIN);
2378         CHECK_VALUE(MDS_SYNC);
2379         CHECK_VALUE(MDS_DONE_WRITING);
2380         CHECK_VALUE(MDS_SET_INFO);
2381         CHECK_VALUE(MDS_QUOTACHECK);
2382         CHECK_VALUE(MDS_QUOTACTL);
2383         CHECK_VALUE(MDS_GETXATTR);
2384         CHECK_VALUE(MDS_SETXATTR);
2385         CHECK_VALUE(MDS_WRITEPAGE);
2386         CHECK_VALUE(MDS_IS_SUBDIR);
2387         CHECK_VALUE(MDS_GET_INFO);
2388         CHECK_VALUE(MDS_HSM_STATE_GET);
2389         CHECK_VALUE(MDS_HSM_STATE_SET);
2390         CHECK_VALUE(MDS_HSM_ACTION);
2391         CHECK_VALUE(MDS_HSM_PROGRESS);
2392         CHECK_VALUE(MDS_HSM_REQUEST);
2393         CHECK_VALUE(MDS_HSM_CT_REGISTER);
2394         CHECK_VALUE(MDS_HSM_CT_UNREGISTER);
2395         CHECK_VALUE(MDS_SWAP_LAYOUTS);
2396         CHECK_VALUE(MDS_LAST_OPC);
2397
2398         CHECK_VALUE(REINT_SETATTR);
2399         CHECK_VALUE(REINT_CREATE);
2400         CHECK_VALUE(REINT_LINK);
2401         CHECK_VALUE(REINT_UNLINK);
2402         CHECK_VALUE(REINT_RENAME);
2403         CHECK_VALUE(REINT_OPEN);
2404         CHECK_VALUE(REINT_SETXATTR);
2405         CHECK_VALUE(REINT_RMENTRY);
2406         CHECK_VALUE(REINT_MIGRATE);
2407         CHECK_VALUE(REINT_MAX);
2408
2409         CHECK_VALUE_X(DISP_IT_EXECD);
2410         CHECK_VALUE_X(DISP_LOOKUP_EXECD);
2411         CHECK_VALUE_X(DISP_LOOKUP_NEG);
2412         CHECK_VALUE_X(DISP_LOOKUP_POS);
2413         CHECK_VALUE_X(DISP_OPEN_CREATE);
2414         CHECK_VALUE_X(DISP_OPEN_OPEN);
2415         CHECK_VALUE_X(DISP_ENQ_COMPLETE);
2416         CHECK_VALUE_X(DISP_ENQ_OPEN_REF);
2417         CHECK_VALUE_X(DISP_ENQ_CREATE_REF);
2418         CHECK_VALUE_X(DISP_OPEN_LOCK);
2419
2420         CHECK_VALUE(MDS_STATUS_CONN);
2421         CHECK_VALUE(MDS_STATUS_LOV);
2422
2423         CHECK_VALUE_64X(MDS_ATTR_MODE);
2424         CHECK_VALUE_64X(MDS_ATTR_UID);
2425         CHECK_VALUE_64X(MDS_ATTR_GID);
2426         CHECK_VALUE_64X(MDS_ATTR_SIZE);
2427         CHECK_VALUE_64X(MDS_ATTR_ATIME);
2428         CHECK_VALUE_64X(MDS_ATTR_MTIME);
2429         CHECK_VALUE_64X(MDS_ATTR_CTIME);
2430         CHECK_VALUE_64X(MDS_ATTR_ATIME_SET);
2431         CHECK_VALUE_64X(MDS_ATTR_MTIME_SET);
2432         CHECK_VALUE_64X(MDS_ATTR_FORCE);
2433         CHECK_VALUE_64X(MDS_ATTR_ATTR_FLAG);
2434         CHECK_VALUE_64X(MDS_ATTR_KILL_SUID);
2435         CHECK_VALUE_64X(MDS_ATTR_KILL_SGID);
2436         CHECK_VALUE_64X(MDS_ATTR_CTIME_SET);
2437         CHECK_VALUE_64X(MDS_ATTR_FROM_OPEN);
2438         CHECK_VALUE_64X(MDS_ATTR_BLOCKS);
2439
2440         CHECK_VALUE(FLD_QUERY);
2441         CHECK_VALUE(FLD_READ);
2442         CHECK_VALUE(FLD_FIRST_OPC);
2443         CHECK_VALUE(FLD_LAST_OPC);
2444
2445         CHECK_VALUE(SEQ_QUERY);
2446         CHECK_VALUE(SEQ_FIRST_OPC);
2447         CHECK_VALUE(SEQ_LAST_OPC);
2448
2449         CHECK_VALUE(LFSCK_NOTIFY);
2450         CHECK_VALUE(LFSCK_QUERY);
2451         CHECK_VALUE(LFSCK_FIRST_OPC);
2452         CHECK_VALUE(LFSCK_LAST_OPC);
2453
2454         CHECK_VALUE(SEQ_ALLOC_SUPER);
2455         CHECK_VALUE(SEQ_ALLOC_META);
2456
2457         CHECK_VALUE(LDLM_ENQUEUE);
2458         CHECK_VALUE(LDLM_CONVERT);
2459         CHECK_VALUE(LDLM_CANCEL);
2460         CHECK_VALUE(LDLM_BL_CALLBACK);
2461         CHECK_VALUE(LDLM_CP_CALLBACK);
2462         CHECK_VALUE(LDLM_GL_CALLBACK);
2463         CHECK_VALUE(LDLM_SET_INFO);
2464         CHECK_VALUE(LDLM_LAST_OPC);
2465
2466         CHECK_VALUE(LCK_MINMODE);
2467         CHECK_VALUE(LCK_EX);
2468         CHECK_VALUE(LCK_PW);
2469         CHECK_VALUE(LCK_PR);
2470         CHECK_VALUE(LCK_CW);
2471         CHECK_VALUE(LCK_CR);
2472         CHECK_VALUE(LCK_NL);
2473         CHECK_VALUE(LCK_GROUP);
2474         CHECK_VALUE(LCK_COS);
2475         CHECK_VALUE(LCK_MAXMODE);
2476         CHECK_VALUE(LCK_MODE_NUM);
2477
2478         CHECK_CVALUE(LDLM_PLAIN);
2479         CHECK_CVALUE(LDLM_EXTENT);
2480         CHECK_CVALUE(LDLM_FLOCK);
2481         CHECK_CVALUE(LDLM_IBITS);
2482         CHECK_CVALUE(LDLM_MAX_TYPE);
2483
2484         CHECK_CVALUE(LUSTRE_RES_ID_SEQ_OFF);
2485         CHECK_CVALUE(LUSTRE_RES_ID_VER_OID_OFF);
2486         /* CHECK_CVALUE(LUSTRE_RES_ID_WAS_VER_OFF); packed with OID */
2487
2488         CHECK_VALUE(OUT_UPDATE);
2489         CHECK_VALUE(OUT_UPDATE_LAST_OPC);
2490         CHECK_CVALUE(LUSTRE_RES_ID_QUOTA_SEQ_OFF);
2491         CHECK_CVALUE(LUSTRE_RES_ID_QUOTA_VER_OID_OFF);
2492         CHECK_CVALUE(LUSTRE_RES_ID_HSH_OFF);
2493
2494         CHECK_CVALUE(LQUOTA_TYPE_USR);
2495         CHECK_CVALUE(LQUOTA_TYPE_GRP);
2496
2497         CHECK_CVALUE(LQUOTA_RES_MD);
2498         CHECK_CVALUE(LQUOTA_RES_DT);
2499
2500         CHECK_VALUE(OBD_PING);
2501         CHECK_VALUE(OBD_LOG_CANCEL);
2502         CHECK_VALUE(OBD_QC_CALLBACK);
2503         CHECK_VALUE(OBD_IDX_READ);
2504         CHECK_VALUE(OBD_LAST_OPC);
2505
2506         CHECK_VALUE(QUOTA_DQACQ);
2507         CHECK_VALUE(QUOTA_DQREL);
2508         CHECK_VALUE(QUOTA_LAST_OPC);
2509
2510         CHECK_VALUE(MGS_CONNECT);
2511         CHECK_VALUE(MGS_DISCONNECT);
2512         CHECK_VALUE(MGS_EXCEPTION);
2513         CHECK_VALUE(MGS_TARGET_REG);
2514         CHECK_VALUE(MGS_TARGET_DEL);
2515         CHECK_VALUE(MGS_SET_INFO);
2516         CHECK_VALUE(MGS_LAST_OPC);
2517
2518         CHECK_VALUE(SEC_CTX_INIT);
2519         CHECK_VALUE(SEC_CTX_INIT_CONT);
2520         CHECK_VALUE(SEC_CTX_FINI);
2521         CHECK_VALUE(SEC_LAST_OPC);
2522
2523         COMMENT("Sizes and Offsets");
2524         BLANK_LINE();
2525         CHECK_STRUCT(obd_uuid);
2526         check_lu_seq_range();
2527         check_lustre_mdt_attrs();
2528
2529         CHECK_VALUE(OUT_CREATE);
2530         CHECK_VALUE(OUT_DESTROY);
2531         CHECK_VALUE(OUT_REF_ADD);
2532         CHECK_VALUE(OUT_REF_DEL);
2533         CHECK_VALUE(OUT_ATTR_SET);
2534         CHECK_VALUE(OUT_ATTR_GET);
2535         CHECK_VALUE(OUT_XATTR_SET);
2536         CHECK_VALUE(OUT_XATTR_GET);
2537         CHECK_VALUE(OUT_INDEX_LOOKUP);
2538         CHECK_VALUE(OUT_INDEX_LOOKUP);
2539         CHECK_VALUE(OUT_INDEX_INSERT);
2540         CHECK_VALUE(OUT_INDEX_DELETE);
2541         CHECK_VALUE(OUT_WRITE);
2542         CHECK_VALUE(OUT_XATTR_DEL);
2543         CHECK_VALUE(OUT_PUNCH);
2544         CHECK_VALUE(OUT_READ);
2545
2546         check_hsm_attrs();
2547         check_ost_id();
2548         check_lu_dirent();
2549         check_luda_type();
2550         check_lu_dirpage();
2551         check_lustre_handle();
2552         check_lustre_msg_v2();
2553         check_ptlrpc_body();
2554         check_obd_connect_data();
2555         check_obdo();
2556         check_lov_ost_data_v1();
2557         check_lov_mds_md_v1();
2558         check_lov_mds_md_v3();
2559         check_lmv_mds_md_v1();
2560         check_obd_statfs();
2561         check_obd_ioobj();
2562         check_obd_quotactl();
2563         check_obd_idx_read();
2564         check_niobuf_remote();
2565         check_ost_body();
2566         check_ll_fid();
2567         check_mdt_body();
2568         check_mdt_ioepoch();
2569         check_mdt_remote_perm();
2570         check_mdt_rec_setattr();
2571         check_mdt_rec_create();
2572         check_mdt_rec_link();
2573         check_mdt_rec_unlink();
2574         check_mdt_rec_rename();
2575         check_mdt_rec_setxattr();
2576         check_mdt_rec_reint();
2577         check_lmv_desc();
2578         check_lov_desc();
2579         check_ldlm_res_id();
2580         check_ldlm_extent();
2581         check_ldlm_inodebits();
2582         check_ldlm_flock();
2583         check_ldlm_intent();
2584         check_ldlm_resource_desc();
2585         check_ldlm_lock_desc();
2586         check_ldlm_request();
2587         check_ldlm_reply();
2588         check_ldlm_ost_lvb_v1();
2589         check_ldlm_ost_lvb();
2590         check_ldlm_lquota_lvb();
2591         check_ldlm_gl_lquota_desc();
2592         check_mgs_send_param();
2593         check_cfg_marker();
2594         check_llog_logid();
2595         check_llog_catid();
2596         check_llog_rec_hdr();
2597         check_llog_rec_tail();
2598         check_llog_logid_rec();
2599         check_llog_unlink_rec();
2600         check_llog_unlink64_rec();
2601         check_llog_setattr64_rec();
2602         check_llog_size_change_rec();
2603         check_changelog_rec();
2604         check_changelog_ext_rename();
2605         check_changelog_ext_jobid();
2606         check_changelog_setinfo();
2607         check_llog_changelog_rec();
2608         check_llog_changelog_user_rec();
2609         check_llog_gen();
2610         check_llog_gen_rec();
2611         check_llog_log_hdr();
2612         check_llog_cookie();
2613         check_llogd_body();
2614         check_llogd_conn_body();
2615         check_ll_fiemap_info_key();
2616         check_quota_body();
2617         check_mgs_target_info();
2618         check_lustre_capa();
2619         check_lustre_capa_key();
2620         check_getinfo_fid2path();
2621         check_ll_user_fiemap();
2622         check_ll_fiemap_extent();
2623         check_posix_acl_xattr_entry();
2624         check_posix_acl_xattr_header();
2625         check_link_ea_header();
2626         check_link_ea_entry();
2627         check_layout_intent();
2628         check_hsm_action_item();
2629         check_hsm_action_list();
2630         check_hsm_progress();
2631         check_hsm_copy();
2632         check_hsm_progress_kernel();
2633         check_hsm_user_item();
2634         check_hsm_user_state();
2635         check_hsm_state_set();
2636         check_hsm_current_action();
2637         check_hsm_request();
2638         check_hsm_user_request();
2639         check_hsm_user_import();
2640
2641         check_object_update_param();
2642         check_object_update();
2643         check_object_update_request();
2644         check_object_update_result();
2645         check_object_update_reply();
2646         check_out_update_header();
2647         check_out_update_buffer();
2648
2649         check_lfsck_request();
2650         check_lfsck_reply();
2651
2652         check_update_params();
2653         check_update_op();
2654         check_update_ops();
2655         check_update_records();
2656         check_llog_update_record();
2657
2658         printf("}\n\n");
2659
2660         return 0;
2661 }