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