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