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