1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
38 #include <sys/types.h>
40 #include <liblustre.h>
41 #include <lustre_lib.h>
42 #include <lustre/lustre_idl.h>
43 #include <lustre_disk.h>
45 #define BLANK_LINE() \
52 printf(" /* "c" */\n"); \
55 #define STRINGIFY(a) #a
58 #define CHECK_CDEFINE(a) \
59 printf(" CLASSERT("#a" == "STRINGIFY(a) ");\n")
61 #define CHECK_CVALUE(a) \
62 printf(" CLASSERT("#a" == %lld);\n", (long long)a)
64 #define CHECK_DEFINE(a) \
66 printf(" LASSERTF("#a" == "STRINGIFY(a) \
67 ",\" found %%lld\\n\",\n " \
68 "(long long)"#a");\n"); \
71 #define CHECK_VALUE(a) \
73 printf(" LASSERTF("#a \
74 " == %lld, \" found %%lld\\n\",\n "\
75 "(long long)"#a");\n", (long long)a); \
78 #define CHECK_VALUE_64(a) \
80 printf(" LASSERTF("#a \
81 " == %lldULL, \" found %%lld\\n\",\n "\
82 "(long long)"#a");\n", (long long)a); \
85 #define CHECK_MEMBER_OFFSET(s,m) \
87 CHECK_VALUE((int)offsetof(struct s, m)); \
90 #define CHECK_MEMBER_OFFSET_TYPEDEF(s,m) \
92 CHECK_VALUE((int)offsetof(s, m)); \
95 #define CHECK_MEMBER_SIZEOF(s,m) \
97 CHECK_VALUE((int)sizeof(((struct s *)0)->m)); \
100 #define CHECK_MEMBER_SIZEOF_TYPEDEF(s,m) \
102 CHECK_VALUE((int)sizeof(((s *)0)->m)); \
105 #define CHECK_MEMBER(s,m) \
107 CHECK_MEMBER_OFFSET(s, m); \
108 CHECK_MEMBER_SIZEOF(s, m); \
111 #define CHECK_MEMBER_TYPEDEF(s,m) \
113 CHECK_MEMBER_OFFSET_TYPEDEF(s, m); \
114 CHECK_MEMBER_SIZEOF_TYPEDEF(s, m); \
117 #define CHECK_STRUCT(s) \
119 COMMENT("Checks for struct "#s); \
120 CHECK_VALUE((int)sizeof(struct s)); \
123 #define CHECK_STRUCT_TYPEDEF(s) \
125 COMMENT("Checks for type "#s); \
126 CHECK_VALUE((int)sizeof(s)); \
130 check_lustre_handle(void)
133 CHECK_STRUCT(lustre_handle);
134 CHECK_MEMBER(lustre_handle, cookie);
138 check_lustre_msg_v2(void)
141 CHECK_STRUCT(lustre_msg_v2);
142 CHECK_MEMBER(lustre_msg_v2, lm_bufcount);
143 CHECK_MEMBER(lustre_msg_v2, lm_secflvr);
144 CHECK_MEMBER(lustre_msg_v2, lm_magic);
145 CHECK_MEMBER(lustre_msg_v2, lm_repsize);
146 CHECK_MEMBER(lustre_msg_v2, lm_cksum);
147 CHECK_MEMBER(lustre_msg_v2, lm_flags);
148 CHECK_MEMBER(lustre_msg_v2, lm_padding_2);
149 CHECK_MEMBER(lustre_msg_v2, lm_padding_3);
150 CHECK_MEMBER(lustre_msg_v2, lm_buflens[0]);
154 check_ptlrpc_body(void)
157 CHECK_STRUCT(ptlrpc_body);
158 CHECK_MEMBER(ptlrpc_body, pb_handle);
159 CHECK_MEMBER(ptlrpc_body, pb_type);
160 CHECK_MEMBER(ptlrpc_body, pb_version);
161 CHECK_MEMBER(ptlrpc_body, pb_opc);
162 CHECK_MEMBER(ptlrpc_body, pb_status);
163 CHECK_MEMBER(ptlrpc_body, pb_last_xid);
164 CHECK_MEMBER(ptlrpc_body, pb_last_seen);
165 CHECK_MEMBER(ptlrpc_body, pb_last_committed);
166 CHECK_MEMBER(ptlrpc_body, pb_transno);
167 CHECK_MEMBER(ptlrpc_body, pb_flags);
168 CHECK_MEMBER(ptlrpc_body, pb_op_flags);
169 CHECK_MEMBER(ptlrpc_body, pb_conn_cnt);
170 CHECK_MEMBER(ptlrpc_body, pb_timeout);
171 CHECK_MEMBER(ptlrpc_body, pb_service_time);
172 CHECK_MEMBER(ptlrpc_body, pb_slv);
173 CHECK_MEMBER(ptlrpc_body, pb_limit);
174 CHECK_CVALUE(PTLRPC_NUM_VERSIONS);
175 CHECK_MEMBER(ptlrpc_body, pb_pre_versions[PTLRPC_NUM_VERSIONS]);
178 static void check_obd_connect_data(void)
181 CHECK_STRUCT(obd_connect_data);
182 CHECK_MEMBER(obd_connect_data, ocd_connect_flags);
183 CHECK_MEMBER(obd_connect_data, ocd_version);
184 CHECK_MEMBER(obd_connect_data, ocd_grant);
185 CHECK_MEMBER(obd_connect_data, ocd_index);
186 CHECK_MEMBER(obd_connect_data, ocd_brw_size);
187 CHECK_MEMBER(obd_connect_data, ocd_ibits_known);
188 CHECK_MEMBER(obd_connect_data, ocd_nllu);
189 CHECK_MEMBER(obd_connect_data, ocd_nllg);
190 CHECK_MEMBER(obd_connect_data, ocd_transno);
191 CHECK_MEMBER(obd_connect_data, ocd_group);
192 CHECK_MEMBER(obd_connect_data, ocd_cksum_types);
193 CHECK_MEMBER(obd_connect_data, padding1);
194 CHECK_MEMBER(obd_connect_data, padding2);
196 CHECK_CDEFINE(OBD_CONNECT_RDONLY);
197 CHECK_CDEFINE(OBD_CONNECT_INDEX);
198 CHECK_CDEFINE(OBD_CONNECT_GRANT);
199 CHECK_CDEFINE(OBD_CONNECT_SRVLOCK);
200 CHECK_CDEFINE(OBD_CONNECT_VERSION);
201 CHECK_CDEFINE(OBD_CONNECT_REQPORTAL);
202 CHECK_CDEFINE(OBD_CONNECT_ACL);
203 CHECK_CDEFINE(OBD_CONNECT_XATTR);
204 CHECK_CDEFINE(OBD_CONNECT_REAL);
205 CHECK_CDEFINE(OBD_CONNECT_CKSUM);
206 CHECK_CDEFINE(OBD_CONNECT_TRUNCLOCK);
207 CHECK_CDEFINE(OBD_CONNECT_IBITS);
208 CHECK_CDEFINE(OBD_CONNECT_JOIN);
209 CHECK_CDEFINE(OBD_CONNECT_ATTRFID);
210 CHECK_CDEFINE(OBD_CONNECT_NODEVOH);
211 CHECK_CDEFINE(OBD_CONNECT_RMT_CLIENT);
212 CHECK_CDEFINE(OBD_CONNECT_RMT_CLIENT_FORCE);
213 CHECK_CDEFINE(OBD_CONNECT_BRW_SIZE);
214 CHECK_CDEFINE(OBD_CONNECT_QUOTA64);
215 CHECK_CDEFINE(OBD_CONNECT_MDS_CAPA);
216 CHECK_CDEFINE(OBD_CONNECT_OSS_CAPA);
217 CHECK_CDEFINE(OBD_CONNECT_MDS_MDS);
218 CHECK_CDEFINE(OBD_CONNECT_SOM);
219 CHECK_CDEFINE(OBD_CONNECT_AT);
220 CHECK_CDEFINE(OBD_CONNECT_CANCELSET);
221 CHECK_CDEFINE(OBD_CONNECT_LRU_RESIZE);
222 CHECK_CDEFINE(OBD_CONNECT_VBR);
223 CHECK_CDEFINE(OBD_CONNECT_SKIP_ORPHAN);
231 CHECK_MEMBER(obdo, o_valid);
232 CHECK_MEMBER(obdo, o_id);
233 CHECK_MEMBER(obdo, o_gr);
234 CHECK_MEMBER(obdo, o_fid);
235 CHECK_MEMBER(obdo, o_size);
236 CHECK_MEMBER(obdo, o_mtime);
237 CHECK_MEMBER(obdo, o_atime);
238 CHECK_MEMBER(obdo, o_ctime);
239 CHECK_MEMBER(obdo, o_blocks);
240 CHECK_MEMBER(obdo, o_grant);
241 CHECK_MEMBER(obdo, o_blksize);
242 CHECK_MEMBER(obdo, o_mode);
243 CHECK_MEMBER(obdo, o_uid);
244 CHECK_MEMBER(obdo, o_gid);
245 CHECK_MEMBER(obdo, o_flags);
246 CHECK_MEMBER(obdo, o_nlink);
247 CHECK_MEMBER(obdo, o_generation);
248 CHECK_MEMBER(obdo, o_misc);
249 CHECK_MEMBER(obdo, o_easize);
250 CHECK_MEMBER(obdo, o_mds);
251 CHECK_MEMBER(obdo, o_stripe_idx);
252 CHECK_MEMBER(obdo, o_padding_1);
253 CHECK_MEMBER(obdo, o_handle);
254 CHECK_MEMBER(obdo, o_lcookie);
255 CHECK_MEMBER(obdo, o_padding_2);
256 CHECK_MEMBER(obdo, o_padding_3);
257 CHECK_MEMBER(obdo, o_padding_4);
258 CHECK_MEMBER(obdo, o_padding_5);
259 CHECK_MEMBER(obdo, o_padding_6);
261 CHECK_CDEFINE(OBD_MD_FLID);
262 CHECK_CDEFINE(OBD_MD_FLATIME);
263 CHECK_CDEFINE(OBD_MD_FLMTIME);
264 CHECK_CDEFINE(OBD_MD_FLCTIME);
265 CHECK_CDEFINE(OBD_MD_FLSIZE);
266 CHECK_CDEFINE(OBD_MD_FLBLOCKS);
267 CHECK_CDEFINE(OBD_MD_FLBLKSZ);
268 CHECK_CDEFINE(OBD_MD_FLMODE);
269 CHECK_CDEFINE(OBD_MD_FLTYPE);
270 CHECK_CDEFINE(OBD_MD_FLUID);
271 CHECK_CDEFINE(OBD_MD_FLGID);
272 CHECK_CDEFINE(OBD_MD_FLFLAGS);
273 CHECK_CDEFINE(OBD_MD_FLNLINK);
274 CHECK_CDEFINE(OBD_MD_FLGENER);
275 CHECK_CDEFINE(OBD_MD_FLRDEV);
276 CHECK_CDEFINE(OBD_MD_FLEASIZE);
277 CHECK_CDEFINE(OBD_MD_LINKNAME);
278 CHECK_CDEFINE(OBD_MD_FLHANDLE);
279 CHECK_CDEFINE(OBD_MD_FLCKSUM);
280 CHECK_CDEFINE(OBD_MD_FLQOS);
281 CHECK_CDEFINE(OBD_MD_FLCOOKIE);
282 CHECK_CDEFINE(OBD_MD_FLGROUP);
283 CHECK_CDEFINE(OBD_MD_FLFID);
284 CHECK_CDEFINE(OBD_MD_FLEPOCH);
285 CHECK_CDEFINE(OBD_MD_FLGRANT);
286 CHECK_CDEFINE(OBD_MD_FLDIREA);
287 CHECK_CDEFINE(OBD_MD_FLUSRQUOTA);
288 CHECK_CDEFINE(OBD_MD_FLGRPQUOTA);
289 CHECK_CDEFINE(OBD_MD_FLMODEASIZE);
290 CHECK_CDEFINE(OBD_MD_MDS);
291 CHECK_CDEFINE(OBD_MD_REINT);
292 CHECK_CDEFINE(OBD_MD_FLXATTR);
293 CHECK_CDEFINE(OBD_MD_FLXATTRLS);
294 CHECK_CDEFINE(OBD_MD_FLXATTRRM);
295 CHECK_CDEFINE(OBD_MD_FLACL);
297 CHECK_CDEFINE(OBD_FL_INLINEDATA);
298 CHECK_CDEFINE(OBD_FL_OBDMDEXISTS);
299 CHECK_CDEFINE(OBD_FL_DELORPHAN);
300 CHECK_CDEFINE(OBD_FL_NORPC);
301 CHECK_CDEFINE(OBD_FL_IDONLY);
302 CHECK_CDEFINE(OBD_FL_RECREATE_OBJS);
303 CHECK_CDEFINE(OBD_FL_DEBUG_CHECK);
304 CHECK_CDEFINE(OBD_FL_NO_USRQUOTA);
305 CHECK_CDEFINE(OBD_FL_NO_GRPQUOTA);
306 CHECK_CDEFINE(OBD_FL_TRUNCLOCK);
307 CHECK_CDEFINE(OBD_FL_CKSUM_CRC32);
308 CHECK_CDEFINE(OBD_FL_CKSUM_ADLER);
309 CHECK_CDEFINE(OBD_FL_SHRINK_GRANT);
310 CHECK_CVALUE(OBD_CKSUM_CRC32);
311 CHECK_CVALUE(OBD_CKSUM_ADLER);
315 check_lov_mds_md_v1(void)
318 CHECK_STRUCT(lov_mds_md_v1);
319 CHECK_MEMBER(lov_mds_md_v1, lmm_magic);
320 CHECK_MEMBER(lov_mds_md_v1, lmm_pattern);
321 CHECK_MEMBER(lov_mds_md_v1, lmm_object_id);
322 CHECK_MEMBER(lov_mds_md_v1, lmm_object_gr);
323 CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_size);
324 CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_count);
325 CHECK_MEMBER(lov_mds_md_v1, lmm_objects);
328 CHECK_STRUCT(lov_ost_data_v1);
329 CHECK_MEMBER(lov_ost_data_v1, l_object_id);
330 CHECK_MEMBER(lov_ost_data_v1, l_object_gr);
331 CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
332 CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
334 CHECK_CDEFINE(LOV_MAGIC_V1);
335 CHECK_CDEFINE(LOV_MAGIC_JOIN);
337 CHECK_VALUE(LOV_PATTERN_RAID0);
338 CHECK_VALUE(LOV_PATTERN_RAID1);
342 check_lov_mds_md_join(void)
345 CHECK_STRUCT(lov_mds_md_join);
346 CHECK_MEMBER(lov_mds_md_join, lmmj_md);
347 CHECK_MEMBER(lov_mds_md_join, lmmj_array_id);
348 CHECK_MEMBER(lov_mds_md_join, lmmj_extent_count);
352 check_lov_mds_md_v3(void)
355 CHECK_STRUCT(lov_mds_md_v3);
356 CHECK_MEMBER(lov_mds_md_v3, lmm_magic);
357 CHECK_MEMBER(lov_mds_md_v3, lmm_pattern);
358 CHECK_MEMBER(lov_mds_md_v3, lmm_object_id);
359 CHECK_MEMBER(lov_mds_md_v3, lmm_object_gr);
360 CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_size);
361 CHECK_MEMBER(lov_mds_md_v3, lmm_stripe_count);
362 CHECK_MEMBER(lov_mds_md_v3, lmm_pool_name);
363 CHECK_MEMBER(lov_mds_md_v3, lmm_objects);
366 CHECK_STRUCT(lov_ost_data_v1);
367 CHECK_MEMBER(lov_ost_data_v1, l_object_id);
368 CHECK_MEMBER(lov_ost_data_v1, l_object_gr);
369 CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
370 CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
372 CHECK_CDEFINE(LOV_MAGIC_V3);
374 CHECK_VALUE(LOV_PATTERN_RAID0);
375 CHECK_VALUE(LOV_PATTERN_RAID1);
379 check_obd_statfs(void)
382 CHECK_STRUCT(obd_statfs);
383 CHECK_MEMBER(obd_statfs, os_type);
384 CHECK_MEMBER(obd_statfs, os_blocks);
385 CHECK_MEMBER(obd_statfs, os_bfree);
386 CHECK_MEMBER(obd_statfs, os_bavail);
387 CHECK_MEMBER(obd_statfs, os_ffree);
388 CHECK_MEMBER(obd_statfs, os_fsid);
389 CHECK_MEMBER(obd_statfs, os_bsize);
390 CHECK_MEMBER(obd_statfs, os_namelen);
391 CHECK_MEMBER(obd_statfs, os_state);
392 CHECK_MEMBER(obd_statfs, os_spare1);
393 CHECK_MEMBER(obd_statfs, os_spare2);
394 CHECK_MEMBER(obd_statfs, os_spare3);
395 CHECK_MEMBER(obd_statfs, os_spare4);
396 CHECK_MEMBER(obd_statfs, os_spare5);
397 CHECK_MEMBER(obd_statfs, os_spare6);
398 CHECK_MEMBER(obd_statfs, os_spare7);
399 CHECK_MEMBER(obd_statfs, os_spare8);
400 CHECK_MEMBER(obd_statfs, os_spare9);
404 check_obd_ioobj(void)
407 CHECK_STRUCT(obd_ioobj);
408 CHECK_MEMBER(obd_ioobj, ioo_id);
409 CHECK_MEMBER(obd_ioobj, ioo_gr);
410 CHECK_MEMBER(obd_ioobj, ioo_type);
411 CHECK_MEMBER(obd_ioobj, ioo_bufcnt);
415 check_obd_quotactl(void)
418 CHECK_STRUCT(obd_quotactl);
419 CHECK_MEMBER(obd_quotactl, qc_cmd);
420 CHECK_MEMBER(obd_quotactl, qc_type);
421 CHECK_MEMBER(obd_quotactl, qc_id);
422 CHECK_MEMBER(obd_quotactl, qc_stat);
423 CHECK_MEMBER(obd_quotactl, qc_dqinfo);
424 CHECK_MEMBER(obd_quotactl, qc_dqblk);
427 CHECK_STRUCT(obd_dqinfo);
428 CHECK_MEMBER(obd_dqinfo, dqi_bgrace);
429 CHECK_MEMBER(obd_dqinfo, dqi_igrace);
430 CHECK_MEMBER(obd_dqinfo, dqi_flags);
431 CHECK_MEMBER(obd_dqinfo, dqi_valid);
434 CHECK_STRUCT(obd_dqblk);
435 CHECK_MEMBER(obd_dqblk, dqb_bhardlimit);
436 CHECK_MEMBER(obd_dqblk, dqb_bsoftlimit);
437 CHECK_MEMBER(obd_dqblk, dqb_curspace);
438 CHECK_MEMBER(obd_dqblk, dqb_ihardlimit);
439 CHECK_MEMBER(obd_dqblk, dqb_isoftlimit);
440 CHECK_MEMBER(obd_dqblk, dqb_curinodes);
441 CHECK_MEMBER(obd_dqblk, dqb_btime);
442 CHECK_MEMBER(obd_dqblk, dqb_itime);
443 CHECK_MEMBER(obd_dqblk, dqb_valid);
444 CHECK_MEMBER(obd_dqblk, padding);
446 CHECK_DEFINE(Q_QUOTACHECK);
447 CHECK_DEFINE(Q_INITQUOTA);
448 CHECK_DEFINE(Q_GETOINFO);
449 CHECK_DEFINE(Q_GETOQUOTA);
453 check_niobuf_remote(void)
456 CHECK_STRUCT(niobuf_remote);
457 CHECK_MEMBER(niobuf_remote, offset);
458 CHECK_MEMBER(niobuf_remote, len);
459 CHECK_MEMBER(niobuf_remote, flags);
461 CHECK_VALUE(OBD_BRW_READ);
462 CHECK_VALUE(OBD_BRW_WRITE);
463 CHECK_VALUE(OBD_BRW_SYNC);
464 CHECK_VALUE(OBD_BRW_FROM_GRANT);
465 CHECK_VALUE(OBD_BRW_NOQUOTA);
472 CHECK_STRUCT(ost_body);
473 CHECK_MEMBER(ost_body, oa);
480 CHECK_STRUCT(ll_fid);
481 CHECK_MEMBER(ll_fid, id);
482 CHECK_MEMBER(ll_fid, generation);
483 CHECK_MEMBER(ll_fid, f_type);
487 check_lu_fid_pack(void)
490 CHECK_STRUCT(lu_fid_pack);
491 CHECK_MEMBER(lu_fid_pack, fp_len);
492 CHECK_MEMBER(lu_fid_pack, fp_area);
496 check_mds_status_req(void)
499 CHECK_STRUCT(mds_status_req);
500 CHECK_MEMBER(mds_status_req, flags);
501 CHECK_MEMBER(mds_status_req, repbuf);
508 CHECK_STRUCT(mds_body);
509 CHECK_MEMBER(mds_body, fid1);
510 CHECK_MEMBER(mds_body, fid2);
511 CHECK_MEMBER(mds_body, handle);
512 CHECK_MEMBER(mds_body, size);
513 CHECK_MEMBER(mds_body, blocks);
514 CHECK_MEMBER(mds_body, io_epoch);
515 CHECK_MEMBER(mds_body, ino);
516 CHECK_MEMBER(mds_body, valid);
517 CHECK_MEMBER(mds_body, fsuid);
518 CHECK_MEMBER(mds_body, fsgid);
519 CHECK_MEMBER(mds_body, capability);
520 CHECK_MEMBER(mds_body, mode);
521 CHECK_MEMBER(mds_body, uid);
522 CHECK_MEMBER(mds_body, gid);
523 CHECK_MEMBER(mds_body, mtime);
524 CHECK_MEMBER(mds_body, ctime);
525 CHECK_MEMBER(mds_body, atime);
526 CHECK_MEMBER(mds_body, flags);
527 CHECK_MEMBER(mds_body, rdev);
528 CHECK_MEMBER(mds_body, nlink);
529 CHECK_MEMBER(mds_body, generation);
530 CHECK_MEMBER(mds_body, suppgid);
531 CHECK_MEMBER(mds_body, eadatasize);
532 CHECK_MEMBER(mds_body, aclsize);
533 CHECK_MEMBER(mds_body, max_mdsize);
534 CHECK_MEMBER(mds_body, max_cookiesize);
535 CHECK_MEMBER(mds_body, padding_4);
537 CHECK_VALUE(FMODE_READ);
538 CHECK_VALUE(FMODE_WRITE);
539 CHECK_VALUE(MDS_FMODE_EXEC);
541 CHECK_CDEFINE(MDS_OPEN_CREAT);
542 CHECK_CDEFINE(MDS_OPEN_EXCL);
543 CHECK_CDEFINE(MDS_OPEN_TRUNC);
544 CHECK_CDEFINE(MDS_OPEN_APPEND);
545 CHECK_CDEFINE(MDS_OPEN_SYNC);
546 CHECK_CDEFINE(MDS_OPEN_DIRECTORY);
547 CHECK_CDEFINE(MDS_OPEN_DELAY_CREATE);
548 CHECK_CDEFINE(MDS_OPEN_OWNEROVERRIDE);
549 CHECK_CDEFINE(MDS_OPEN_JOIN_FILE);
550 CHECK_CDEFINE(MDS_OPEN_HAS_EA);
551 CHECK_CDEFINE(MDS_OPEN_HAS_OBJS);
553 /* these should be identical to their EXT3_*_FL counterparts, and
554 * are redefined only to avoid dragging in ext3_fs.h */
555 CHECK_CDEFINE(MDS_SYNC_FL);
556 CHECK_CDEFINE(MDS_IMMUTABLE_FL);
557 CHECK_CDEFINE(MDS_APPEND_FL);
558 CHECK_CDEFINE(MDS_NOATIME_FL);
559 CHECK_CDEFINE(MDS_DIRSYNC_FL);
560 CHECK_CDEFINE(MDS_BFLAG_EXT_FLAGS);
562 CHECK_CDEFINE(MDS_INODELOCK_LOOKUP);
563 CHECK_CDEFINE(MDS_INODELOCK_UPDATE);
564 CHECK_CDEFINE(MDS_INODELOCK_OPEN);
568 check_mds_rec_setattr(void)
571 CHECK_STRUCT(mds_rec_setattr);
572 CHECK_MEMBER(mds_rec_setattr, sa_opcode);
573 CHECK_MEMBER(mds_rec_setattr, sa_fsuid);
574 CHECK_MEMBER(mds_rec_setattr, sa_fsgid);
575 CHECK_MEMBER(mds_rec_setattr, sa_cap);
576 CHECK_MEMBER(mds_rec_setattr, sa_suppgid);
577 CHECK_MEMBER(mds_rec_setattr, sa_mode);
578 CHECK_MEMBER(mds_rec_setattr, sa_fid);
579 CHECK_MEMBER(mds_rec_setattr, sa_valid);
580 CHECK_MEMBER(mds_rec_setattr, sa_size);
581 CHECK_MEMBER(mds_rec_setattr, sa_mtime);
582 CHECK_MEMBER(mds_rec_setattr, sa_atime);
583 CHECK_MEMBER(mds_rec_setattr, sa_ctime);
584 CHECK_MEMBER(mds_rec_setattr, sa_uid);
585 CHECK_MEMBER(mds_rec_setattr, sa_gid);
586 CHECK_MEMBER(mds_rec_setattr, sa_attr_flags);
587 CHECK_CDEFINE(MDS_ATTR_MODE);
588 CHECK_CDEFINE(MDS_ATTR_UID);
589 CHECK_CDEFINE(MDS_ATTR_GID);
590 CHECK_CDEFINE(MDS_ATTR_SIZE);
591 CHECK_CDEFINE(MDS_ATTR_ATIME);
592 CHECK_CDEFINE(MDS_ATTR_MTIME);
593 CHECK_CDEFINE(MDS_ATTR_CTIME);
594 CHECK_CDEFINE(MDS_ATTR_ATIME_SET);
595 CHECK_CDEFINE(MDS_ATTR_MTIME_SET);
596 CHECK_CDEFINE(MDS_ATTR_FORCE);
597 CHECK_CDEFINE(MDS_ATTR_ATTR_FLAG);
598 CHECK_CDEFINE(MDS_ATTR_KILL_SUID);
599 CHECK_CDEFINE(MDS_ATTR_KILL_SGID);
600 CHECK_CDEFINE(MDS_ATTR_CTIME_SET);
601 CHECK_CDEFINE(MDS_ATTR_FROM_OPEN);
602 CHECK_CDEFINE(MDS_ATTR_BLOCKS);
606 check_mds_rec_create(void)
609 CHECK_STRUCT(mds_rec_create);
610 CHECK_MEMBER(mds_rec_create, cr_opcode);
611 CHECK_MEMBER(mds_rec_create, cr_fsuid);
612 CHECK_MEMBER(mds_rec_create, cr_fsgid);
613 CHECK_MEMBER(mds_rec_create, cr_cap);
614 CHECK_MEMBER(mds_rec_create, cr_flags);
615 CHECK_MEMBER(mds_rec_create, cr_mode);
616 CHECK_MEMBER(mds_rec_create, cr_fid);
617 CHECK_MEMBER(mds_rec_create, cr_replayfid);
618 CHECK_MEMBER(mds_rec_create, cr_time);
619 CHECK_MEMBER(mds_rec_create, cr_rdev);
620 CHECK_MEMBER(mds_rec_create, cr_suppgid);
624 check_mds_rec_link(void)
627 CHECK_STRUCT(mds_rec_link);
628 CHECK_MEMBER(mds_rec_link, lk_opcode);
629 CHECK_MEMBER(mds_rec_link, lk_fsuid);
630 CHECK_MEMBER(mds_rec_link, lk_fsgid);
631 CHECK_MEMBER(mds_rec_link, lk_cap);
632 CHECK_MEMBER(mds_rec_link, lk_suppgid1);
633 CHECK_MEMBER(mds_rec_link, lk_suppgid2);
634 CHECK_MEMBER(mds_rec_link, lk_fid1);
635 CHECK_MEMBER(mds_rec_link, lk_fid2);
636 CHECK_MEMBER(mds_rec_link, lk_time);
640 check_mds_rec_unlink(void)
643 CHECK_STRUCT(mds_rec_unlink);
644 CHECK_MEMBER(mds_rec_unlink, ul_opcode);
645 CHECK_MEMBER(mds_rec_unlink, ul_fsuid);
646 CHECK_MEMBER(mds_rec_unlink, ul_fsgid);
647 CHECK_MEMBER(mds_rec_unlink, ul_cap);
648 CHECK_MEMBER(mds_rec_unlink, ul_suppgid);
649 CHECK_MEMBER(mds_rec_unlink, ul_mode);
650 CHECK_MEMBER(mds_rec_unlink, ul_fid1);
651 CHECK_MEMBER(mds_rec_unlink, ul_fid2);
652 CHECK_MEMBER(mds_rec_unlink, ul_time);
656 check_mds_rec_rename(void)
659 CHECK_STRUCT(mds_rec_rename);
660 CHECK_MEMBER(mds_rec_rename, rn_opcode);
661 CHECK_MEMBER(mds_rec_rename, rn_fsuid);
662 CHECK_MEMBER(mds_rec_rename, rn_fsgid);
663 CHECK_MEMBER(mds_rec_rename, rn_cap);
664 CHECK_MEMBER(mds_rec_rename, rn_suppgid1);
665 CHECK_MEMBER(mds_rec_rename, rn_suppgid2);
666 CHECK_MEMBER(mds_rec_rename, rn_fid1);
667 CHECK_MEMBER(mds_rec_rename, rn_fid2);
668 CHECK_MEMBER(mds_rec_rename, rn_time);
672 check_mds_rec_join(void)
675 CHECK_STRUCT(mds_rec_join);
676 CHECK_MEMBER(mds_rec_join, jr_fid);
677 CHECK_MEMBER(mds_rec_join, jr_headsize);
684 CHECK_STRUCT(lov_desc);
685 CHECK_MEMBER(lov_desc, ld_tgt_count);
686 CHECK_MEMBER(lov_desc, ld_active_tgt_count);
687 CHECK_MEMBER(lov_desc, ld_default_stripe_count);
688 CHECK_MEMBER(lov_desc, ld_pattern);
689 CHECK_MEMBER(lov_desc, ld_default_stripe_size);
690 CHECK_MEMBER(lov_desc, ld_default_stripe_offset);
691 CHECK_MEMBER(lov_desc, ld_qos_maxage);
692 CHECK_MEMBER(lov_desc, ld_padding_1);
693 CHECK_MEMBER(lov_desc, ld_padding_2);
694 CHECK_MEMBER(lov_desc, ld_uuid);
698 check_ldlm_res_id(void)
701 CHECK_STRUCT(ldlm_res_id);
702 CHECK_MEMBER(ldlm_res_id, name[RES_NAME_SIZE]);
706 check_ldlm_extent(void)
709 CHECK_STRUCT(ldlm_extent);
710 CHECK_MEMBER(ldlm_extent, start);
711 CHECK_MEMBER(ldlm_extent, end);
712 CHECK_MEMBER(ldlm_extent, gid);
716 check_ldlm_inodebits(void)
719 CHECK_STRUCT(ldlm_inodebits);
720 CHECK_MEMBER(ldlm_inodebits, bits);
724 check_ldlm_flock(void)
727 CHECK_STRUCT(ldlm_flock);
728 CHECK_MEMBER(ldlm_flock, start);
729 CHECK_MEMBER(ldlm_flock, end);
730 CHECK_MEMBER(ldlm_flock, blocking_pid);
731 CHECK_MEMBER(ldlm_flock, pid);
735 check_ldlm_intent(void)
738 CHECK_STRUCT(ldlm_intent);
739 CHECK_MEMBER(ldlm_intent, opc);
743 check_ldlm_resource_desc(void)
746 CHECK_STRUCT(ldlm_resource_desc);
747 CHECK_MEMBER(ldlm_resource_desc, lr_type);
748 CHECK_MEMBER(ldlm_resource_desc, lr_padding);
749 CHECK_MEMBER(ldlm_resource_desc, lr_name);
753 check_ldlm_lock_desc(void)
756 CHECK_STRUCT(ldlm_lock_desc);
757 CHECK_MEMBER(ldlm_lock_desc, l_resource);
758 CHECK_MEMBER(ldlm_lock_desc, l_req_mode);
759 CHECK_MEMBER(ldlm_lock_desc, l_granted_mode);
760 CHECK_MEMBER(ldlm_lock_desc, l_policy_data);
764 check_ldlm_request(void)
767 CHECK_STRUCT(ldlm_request);
768 CHECK_MEMBER(ldlm_request, lock_flags);
769 CHECK_MEMBER(ldlm_request, lock_count);
770 CHECK_MEMBER(ldlm_request, lock_desc);
771 CHECK_MEMBER(ldlm_request, lock_handle);
775 check_ldlm_reply(void)
778 CHECK_STRUCT(ldlm_reply);
779 CHECK_MEMBER(ldlm_reply, lock_flags);
780 CHECK_MEMBER(ldlm_reply, lock_padding);
781 CHECK_MEMBER(ldlm_reply, lock_desc);
782 CHECK_MEMBER(ldlm_reply, lock_handle);
783 CHECK_MEMBER(ldlm_reply, lock_policy_res1);
784 CHECK_MEMBER(ldlm_reply, lock_policy_res2);
791 CHECK_STRUCT(ost_lvb);
792 CHECK_MEMBER(ost_lvb, lvb_size);
793 CHECK_MEMBER(ost_lvb, lvb_mtime);
794 CHECK_MEMBER(ost_lvb, lvb_atime);
795 CHECK_MEMBER(ost_lvb, lvb_ctime);
796 CHECK_MEMBER(ost_lvb, lvb_blocks);
800 check_cfg_marker(void)
803 CHECK_STRUCT(cfg_marker);
804 CHECK_MEMBER(cfg_marker, cm_step);
805 CHECK_MEMBER(cfg_marker, cm_flags);
806 CHECK_MEMBER(cfg_marker, cm_vers);
807 CHECK_MEMBER(cfg_marker, cm_createtime);
808 CHECK_MEMBER(cfg_marker, cm_canceltime);
809 CHECK_MEMBER(cfg_marker, cm_tgtname);
810 CHECK_MEMBER(cfg_marker, cm_comment);
814 check_llog_logid(void)
817 CHECK_STRUCT(llog_logid);
818 CHECK_MEMBER(llog_logid, lgl_oid);
819 CHECK_MEMBER(llog_logid, lgl_ogr);
820 CHECK_MEMBER(llog_logid, lgl_ogen);
822 CHECK_CVALUE(OST_SZ_REC);
823 CHECK_CVALUE(OST_RAID1_REC);
824 CHECK_CVALUE(MDS_UNLINK_REC);
825 CHECK_CVALUE(MDS_SETATTR_REC);
826 CHECK_CVALUE(OBD_CFG_REC);
827 CHECK_CVALUE(PTL_CFG_REC);
828 CHECK_CVALUE(LLOG_GEN_REC);
829 CHECK_CVALUE(LLOG_JOIN_REC);
830 CHECK_CVALUE(LLOG_HDR_MAGIC);
831 CHECK_CVALUE(LLOG_LOGID_MAGIC);
835 check_llog_catid(void)
838 CHECK_STRUCT(llog_catid);
839 CHECK_MEMBER(llog_catid, lci_logid);
840 CHECK_MEMBER(llog_catid, lci_padding1);
841 CHECK_MEMBER(llog_catid, lci_padding2);
842 CHECK_MEMBER(llog_catid, lci_padding3);
846 check_llog_rec_hdr(void)
849 CHECK_STRUCT(llog_rec_hdr);
850 CHECK_MEMBER(llog_rec_hdr, lrh_len);
851 CHECK_MEMBER(llog_rec_hdr, lrh_index);
852 CHECK_MEMBER(llog_rec_hdr, lrh_type);
853 CHECK_MEMBER(llog_rec_hdr, padding);
857 check_llog_rec_tail(void)
860 CHECK_STRUCT(llog_rec_tail);
861 CHECK_MEMBER(llog_rec_tail, lrt_len);
862 CHECK_MEMBER(llog_rec_tail, lrt_index);
866 check_llog_logid_rec(void)
869 CHECK_STRUCT(llog_logid_rec);
870 CHECK_MEMBER(llog_logid_rec, lid_hdr);
871 CHECK_MEMBER(llog_logid_rec, lid_id);
872 CHECK_MEMBER(llog_logid_rec, padding1);
873 CHECK_MEMBER(llog_logid_rec, padding2);
874 CHECK_MEMBER(llog_logid_rec, padding3);
875 CHECK_MEMBER(llog_logid_rec, padding4);
876 CHECK_MEMBER(llog_logid_rec, padding5);
877 CHECK_MEMBER(llog_logid_rec, lid_tail);
881 check_llog_create_rec(void)
884 CHECK_STRUCT(llog_create_rec);
885 CHECK_MEMBER(llog_create_rec, lcr_hdr);
886 CHECK_MEMBER(llog_create_rec, lcr_fid);
887 CHECK_MEMBER(llog_create_rec, lcr_oid);
888 CHECK_MEMBER(llog_create_rec, lcr_ogen);
889 CHECK_MEMBER(llog_create_rec, padding);
893 check_llog_orphan_rec(void)
896 CHECK_STRUCT(llog_orphan_rec);
897 CHECK_MEMBER(llog_orphan_rec, lor_hdr);
898 CHECK_MEMBER(llog_orphan_rec, lor_oid);
899 CHECK_MEMBER(llog_orphan_rec, lor_ogen);
900 CHECK_MEMBER(llog_orphan_rec, padding);
901 CHECK_MEMBER(llog_orphan_rec, lor_tail);
905 check_llog_unlink_rec(void)
908 CHECK_STRUCT(llog_unlink_rec);
909 CHECK_MEMBER(llog_unlink_rec, lur_hdr);
910 CHECK_MEMBER(llog_unlink_rec, lur_oid);
911 CHECK_MEMBER(llog_unlink_rec, lur_ogen);
912 CHECK_MEMBER(llog_unlink_rec, padding);
913 CHECK_MEMBER(llog_unlink_rec, lur_tail);
917 check_llog_setattr_rec(void)
920 CHECK_STRUCT(llog_setattr_rec);
921 CHECK_MEMBER(llog_setattr_rec, lsr_hdr);
922 CHECK_MEMBER(llog_setattr_rec, lsr_oid);
923 CHECK_MEMBER(llog_setattr_rec, lsr_ogen);
924 CHECK_MEMBER(llog_setattr_rec, lsr_uid);
925 CHECK_MEMBER(llog_setattr_rec, lsr_gid);
926 CHECK_MEMBER(llog_setattr_rec, padding);
927 CHECK_MEMBER(llog_setattr_rec, lsr_tail);
931 check_llog_setattr64_rec(void)
934 CHECK_STRUCT(llog_setattr64_rec);
935 CHECK_MEMBER(llog_setattr64_rec, lsr_hdr);
936 CHECK_MEMBER(llog_setattr64_rec, lsr_oid);
937 CHECK_MEMBER(llog_setattr64_rec, lsr_ogen);
938 CHECK_MEMBER(llog_setattr64_rec, padding);
939 CHECK_MEMBER(llog_setattr64_rec, lsr_uid);
940 CHECK_MEMBER(llog_setattr64_rec, lsr_uid_h);
941 CHECK_MEMBER(llog_setattr64_rec, lsr_gid);
942 CHECK_MEMBER(llog_setattr64_rec, lsr_gid_h);
943 CHECK_MEMBER(llog_setattr64_rec, lsr_tail);
947 check_llog_size_change_rec(void)
950 CHECK_STRUCT(llog_size_change_rec);
951 CHECK_MEMBER(llog_size_change_rec, lsc_hdr);
952 CHECK_MEMBER(llog_size_change_rec, lsc_fid);
953 CHECK_MEMBER(llog_size_change_rec, lsc_ioepoch);
954 CHECK_MEMBER(llog_size_change_rec, padding);
955 CHECK_MEMBER(llog_size_change_rec, lsc_tail);
959 check_llog_changelog_rec(void)
962 CHECK_STRUCT(llog_changelog_rec);
963 CHECK_MEMBER(llog_changelog_rec, cr_hdr);
964 CHECK_MEMBER(llog_changelog_rec, cr_flags);
965 CHECK_MEMBER(llog_changelog_rec, cr_namelen);
966 CHECK_MEMBER(llog_changelog_rec, cr_type);
967 CHECK_MEMBER(llog_changelog_rec, cr_index);
968 CHECK_MEMBER(llog_changelog_rec, cr_prev);
969 CHECK_MEMBER(llog_changelog_rec, cr_time);
970 CHECK_MEMBER(llog_changelog_rec, cr_tfid);
971 CHECK_MEMBER(llog_changelog_rec, cr_pfid);
972 CHECK_MEMBER(llog_changelog_rec, cr_tail);
979 CHECK_STRUCT(llog_gen);
980 CHECK_MEMBER(llog_gen, mnt_cnt);
981 CHECK_MEMBER(llog_gen, conn_cnt);
985 check_llog_gen_rec(void)
988 CHECK_STRUCT(llog_gen_rec);
989 CHECK_MEMBER(llog_gen_rec, lgr_hdr);
990 CHECK_MEMBER(llog_gen_rec, lgr_gen);
991 CHECK_MEMBER(llog_gen_rec, lgr_tail);
995 check_llog_log_hdr(void)
998 CHECK_STRUCT(llog_log_hdr);
999 CHECK_MEMBER(llog_log_hdr, llh_hdr);
1000 CHECK_MEMBER(llog_log_hdr, llh_timestamp);
1001 CHECK_MEMBER(llog_log_hdr, llh_count);
1002 CHECK_MEMBER(llog_log_hdr, llh_bitmap_offset);
1003 CHECK_MEMBER(llog_log_hdr, llh_size);
1004 CHECK_MEMBER(llog_log_hdr, llh_flags);
1005 CHECK_MEMBER(llog_log_hdr, llh_cat_idx);
1006 CHECK_MEMBER(llog_log_hdr, llh_tgtuuid);
1007 CHECK_MEMBER(llog_log_hdr, llh_reserved);
1008 CHECK_MEMBER(llog_log_hdr, llh_bitmap);
1009 CHECK_MEMBER(llog_log_hdr, llh_tail);
1013 check_llog_cookie(void)
1016 CHECK_STRUCT(llog_cookie);
1017 CHECK_MEMBER(llog_cookie, lgc_lgl);
1018 CHECK_MEMBER(llog_cookie, lgc_subsys);
1019 CHECK_MEMBER(llog_cookie, lgc_index);
1020 CHECK_MEMBER(llog_cookie, lgc_padding);
1024 check_llogd_body(void)
1027 CHECK_STRUCT(llogd_body);
1028 CHECK_MEMBER(llogd_body, lgd_logid);
1029 CHECK_MEMBER(llogd_body, lgd_ctxt_idx);
1030 CHECK_MEMBER(llogd_body, lgd_llh_flags);
1031 CHECK_MEMBER(llogd_body, lgd_index);
1032 CHECK_MEMBER(llogd_body, lgd_saved_index);
1033 CHECK_MEMBER(llogd_body, lgd_len);
1034 CHECK_MEMBER(llogd_body, lgd_cur_offset);
1036 CHECK_CVALUE(LLOG_ORIGIN_HANDLE_CREATE);
1037 CHECK_CVALUE(LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
1038 CHECK_CVALUE(LLOG_ORIGIN_HANDLE_READ_HEADER);
1039 CHECK_CVALUE(LLOG_ORIGIN_HANDLE_WRITE_REC);
1040 CHECK_CVALUE(LLOG_ORIGIN_HANDLE_CLOSE);
1041 CHECK_CVALUE(LLOG_ORIGIN_CONNECT);
1042 CHECK_CVALUE(LLOG_CATINFO);
1043 CHECK_CVALUE(LLOG_ORIGIN_HANDLE_PREV_BLOCK);
1044 CHECK_CVALUE(LLOG_ORIGIN_HANDLE_DESTROY);
1048 check_llogd_conn_body(void)
1051 CHECK_STRUCT(llogd_conn_body);
1052 CHECK_MEMBER(llogd_conn_body, lgdc_gen);
1053 CHECK_MEMBER(llogd_conn_body, lgdc_logid);
1054 CHECK_MEMBER(llogd_conn_body, lgdc_ctxt_idx);
1058 check_mds_extent_desc(void)
1061 CHECK_STRUCT(mds_extent_desc);
1062 CHECK_MEMBER(mds_extent_desc, med_start);
1063 CHECK_MEMBER(mds_extent_desc, med_len);
1064 CHECK_MEMBER(mds_extent_desc, med_lmm);
1068 check_llog_array_rec(void)
1071 CHECK_STRUCT(llog_array_rec);
1072 CHECK_MEMBER(llog_array_rec, lmr_hdr);
1073 CHECK_MEMBER(llog_array_rec, lmr_med);
1074 CHECK_MEMBER(llog_array_rec, lmr_tail);
1078 check_qunit_data(void)
1081 CHECK_STRUCT(qunit_data);
1082 CHECK_MEMBER(qunit_data, qd_id);
1083 CHECK_MEMBER(qunit_data, qd_flags);
1084 CHECK_MEMBER(qunit_data, qd_count);
1085 CHECK_MEMBER(qunit_data, qd_qunit);
1086 CHECK_MEMBER(qunit_data, padding);
1090 check_mgs_target_info(void)
1093 CHECK_STRUCT(mgs_target_info);
1094 CHECK_MEMBER(mgs_target_info, mti_lustre_ver);
1095 CHECK_MEMBER(mgs_target_info, mti_stripe_index);
1096 CHECK_MEMBER(mgs_target_info, mti_config_ver);
1097 CHECK_MEMBER(mgs_target_info, mti_flags);
1098 CHECK_MEMBER(mgs_target_info, mti_nid_count);
1099 CHECK_MEMBER(mgs_target_info, mti_fsname);
1100 CHECK_MEMBER(mgs_target_info, mti_svname);
1101 CHECK_MEMBER(mgs_target_info, mti_uuid);
1102 CHECK_MEMBER(mgs_target_info, mti_nids);
1103 CHECK_MEMBER(mgs_target_info, mti_params);
1107 check_lustre_disk_data(void)
1110 CHECK_STRUCT(lustre_disk_data);
1111 CHECK_MEMBER(lustre_disk_data, ldd_magic);
1112 CHECK_MEMBER(lustre_disk_data, ldd_feature_compat);
1113 CHECK_MEMBER(lustre_disk_data, ldd_feature_rocompat);
1114 CHECK_MEMBER(lustre_disk_data, ldd_feature_incompat);
1115 CHECK_MEMBER(lustre_disk_data, ldd_config_ver);
1116 CHECK_MEMBER(lustre_disk_data, ldd_flags);
1117 CHECK_MEMBER(lustre_disk_data, ldd_svindex);
1118 CHECK_MEMBER(lustre_disk_data, ldd_mount_type);
1119 CHECK_MEMBER(lustre_disk_data, ldd_fsname);
1120 CHECK_MEMBER(lustre_disk_data, ldd_svname);
1121 CHECK_MEMBER(lustre_disk_data, ldd_uuid);
1122 CHECK_MEMBER(lustre_disk_data, ldd_userdata);
1123 CHECK_MEMBER(lustre_disk_data, ldd_mount_opts);
1124 CHECK_MEMBER(lustre_disk_data, ldd_params);
1128 check_posix_acl_xattr_entry(void)
1131 CHECK_STRUCT_TYPEDEF(posix_acl_xattr_entry);
1132 CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_tag);
1133 CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_perm);
1134 CHECK_MEMBER_TYPEDEF(posix_acl_xattr_entry, e_id);
1138 check_posix_acl_xattr_header(void)
1141 CHECK_STRUCT_TYPEDEF(posix_acl_xattr_header);
1142 CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_version);
1143 CHECK_MEMBER_TYPEDEF(posix_acl_xattr_header, a_entries);
1147 check_quota_adjust_qunit(void)
1150 CHECK_STRUCT(quota_adjust_qunit);
1151 CHECK_MEMBER(quota_adjust_qunit, qaq_flags);
1152 CHECK_MEMBER(quota_adjust_qunit, qaq_id);
1153 CHECK_MEMBER(quota_adjust_qunit, qaq_bunit_sz);
1154 CHECK_MEMBER(quota_adjust_qunit, qaq_iunit_sz);
1155 CHECK_MEMBER(quota_adjust_qunit, padding1);
1159 check_ll_user_fiemap(void)
1162 CHECK_STRUCT(ll_user_fiemap);
1163 CHECK_MEMBER(ll_user_fiemap, fm_start);
1164 CHECK_MEMBER(ll_user_fiemap, fm_length);
1165 CHECK_MEMBER(ll_user_fiemap, fm_flags);
1166 CHECK_MEMBER(ll_user_fiemap, fm_mapped_extents);
1167 CHECK_MEMBER(ll_user_fiemap, fm_extent_count);
1168 CHECK_MEMBER(ll_user_fiemap, fm_reserved);
1169 CHECK_MEMBER(ll_user_fiemap, fm_extents);
1171 CHECK_CDEFINE(FIEMAP_FLAG_SYNC);
1172 CHECK_CDEFINE(FIEMAP_FLAG_XATTR);
1173 CHECK_CDEFINE(FIEMAP_FLAG_DEVICE_ORDER);
1177 check_ll_fiemap_extent(void)
1180 CHECK_STRUCT(ll_fiemap_extent);
1181 CHECK_MEMBER(ll_fiemap_extent, fe_logical);
1182 CHECK_MEMBER(ll_fiemap_extent, fe_physical);
1183 CHECK_MEMBER(ll_fiemap_extent, fe_length);
1184 CHECK_MEMBER(ll_fiemap_extent, fe_flags);
1185 CHECK_MEMBER(ll_fiemap_extent, fe_device);
1187 CHECK_CDEFINE(FIEMAP_EXTENT_LAST);
1188 CHECK_CDEFINE(FIEMAP_EXTENT_UNKNOWN);
1189 CHECK_CDEFINE(FIEMAP_EXTENT_DELALLOC);
1190 CHECK_CDEFINE(FIEMAP_EXTENT_ENCODED);
1191 CHECK_CDEFINE(FIEMAP_EXTENT_DATA_ENCRYPTED);
1192 CHECK_CDEFINE(FIEMAP_EXTENT_NOT_ALIGNED);
1193 CHECK_CDEFINE(FIEMAP_EXTENT_DATA_INLINE);
1194 CHECK_CDEFINE(FIEMAP_EXTENT_DATA_TAIL);
1195 CHECK_CDEFINE(FIEMAP_EXTENT_UNWRITTEN);
1196 CHECK_CDEFINE(FIEMAP_EXTENT_MERGED);
1197 CHECK_CDEFINE(FIEMAP_EXTENT_NO_DIRECT);
1198 CHECK_CDEFINE(FIEMAP_EXTENT_NET);
1202 check_link_ea_header(void)
1205 CHECK_STRUCT(link_ea_header);
1206 CHECK_MEMBER(link_ea_header, leh_magic);
1207 CHECK_MEMBER(link_ea_header, leh_reccount);
1208 CHECK_MEMBER(link_ea_header, leh_len);
1209 CHECK_MEMBER(link_ea_header, padding1);
1210 CHECK_MEMBER(link_ea_header, padding2);
1214 check_link_ea_entry(void)
1217 CHECK_STRUCT(link_ea_entry);
1218 CHECK_MEMBER(link_ea_entry, lee_reclen);
1219 CHECK_MEMBER(link_ea_entry, lee_parent_fid);
1220 CHECK_MEMBER(link_ea_entry, lee_name);
1225 system_string (char *cmdline, char *str, int len)
1238 int fd = fileno(stdout);
1240 rc = dup2(fds[1], fd);
1244 exit(system(cmdline));
1246 } else if ((int)pid < 0) {
1249 FILE *f = fdopen(fds[0], "r");
1256 if (fgets(str, len, f) == NULL)
1259 if (waitpid(pid, &rc, 0) != pid)
1262 if (!WIFEXITED(rc) || WEXITSTATUS(rc) != 0)
1265 if (strnlen(str, len) == len)
1268 if (str[strlen(str) - 1] == '\n')
1269 str[strlen(str) - 1] = 0;
1276 main(int argc, char **argv)
1281 system_string("uname -a", unameinfo, sizeof(unameinfo));
1282 system_string(CC " -v 2>&1 | tail -1", gccinfo, sizeof(gccinfo));
1284 printf ("void lustre_assert_wire_constants(void)\n"
1286 " /* Wire protocol assertions generated by 'wirecheck'\n"
1287 " * (make -C lustre/utils newwiretest)\n"
1288 " * running on %s\n"
1290 "\n", unameinfo, gccinfo);
1294 COMMENT("Constants...");
1295 CHECK_DEFINE(LUSTRE_MSG_MAGIC_V2);
1296 CHECK_DEFINE(PTLRPC_MSG_VERSION);
1297 CHECK_VALUE(MSGHDR_AT_SUPPORT);
1299 CHECK_VALUE(PTL_RPC_MSG_REQUEST);
1300 CHECK_VALUE(PTL_RPC_MSG_ERR);
1301 CHECK_VALUE(PTL_RPC_MSG_REPLY);
1303 CHECK_VALUE(MSG_LAST_REPLAY);
1304 CHECK_VALUE(MSG_RESENT);
1305 CHECK_VALUE(MSG_REPLAY);
1307 CHECK_VALUE(MSG_CONNECT_RECOVERING);
1308 CHECK_VALUE(MSG_CONNECT_RECONNECT);
1309 CHECK_VALUE(MSG_CONNECT_REPLAYABLE);
1311 CHECK_VALUE(OST_REPLY);
1312 CHECK_VALUE(OST_GETATTR);
1313 CHECK_VALUE(OST_SETATTR);
1314 CHECK_VALUE(OST_READ);
1315 CHECK_VALUE(OST_WRITE);
1316 CHECK_VALUE(OST_CREATE);
1317 CHECK_VALUE(OST_DESTROY);
1318 CHECK_VALUE(OST_GET_INFO);
1319 CHECK_VALUE(OST_CONNECT);
1320 CHECK_VALUE(OST_DISCONNECT);
1321 CHECK_VALUE(OST_PUNCH);
1322 CHECK_VALUE(OST_OPEN);
1323 CHECK_VALUE(OST_CLOSE);
1324 CHECK_VALUE(OST_STATFS);
1325 CHECK_VALUE(OST_SYNC);
1326 CHECK_VALUE(OST_QUOTACHECK);
1327 CHECK_VALUE(OST_QUOTACTL);
1328 CHECK_VALUE(OST_QUOTA_ADJUST_QUNIT);
1329 CHECK_VALUE(OST_LAST_OPC);
1331 CHECK_DEFINE(OBD_OBJECT_EOF);
1333 CHECK_VALUE(MDS_GETATTR);
1334 CHECK_VALUE(MDS_GETATTR_NAME);
1335 CHECK_VALUE(MDS_CLOSE);
1336 CHECK_VALUE(MDS_REINT);
1337 CHECK_VALUE(MDS_READPAGE);
1338 CHECK_VALUE(MDS_CONNECT);
1339 CHECK_VALUE(MDS_DISCONNECT);
1340 CHECK_VALUE(MDS_GETSTATUS);
1341 CHECK_VALUE(MDS_STATFS);
1342 CHECK_VALUE(MDS_PIN);
1343 CHECK_VALUE(MDS_UNPIN);
1344 CHECK_VALUE(MDS_SYNC);
1345 CHECK_VALUE(MDS_DONE_WRITING);
1346 CHECK_VALUE(MDS_SET_INFO);
1347 CHECK_VALUE(MDS_QUOTACHECK);
1348 CHECK_VALUE(MDS_QUOTACTL);
1349 CHECK_VALUE(MDS_GETXATTR);
1350 CHECK_VALUE(MDS_SETXATTR);
1351 CHECK_VALUE(MDS_WRITEPAGE);
1352 CHECK_VALUE(MDS_IS_SUBDIR);
1353 CHECK_VALUE(MDS_GET_INFO);
1354 CHECK_VALUE(MDS_LAST_OPC);
1356 CHECK_VALUE(REINT_SETATTR);
1357 CHECK_VALUE(REINT_CREATE);
1358 CHECK_VALUE(REINT_LINK);
1359 CHECK_VALUE(REINT_UNLINK);
1360 CHECK_VALUE(REINT_RENAME);
1361 CHECK_VALUE(REINT_OPEN);
1362 CHECK_VALUE(REINT_MAX);
1364 CHECK_VALUE(MGS_CONNECT);
1365 CHECK_VALUE(MGS_DISCONNECT);
1366 CHECK_VALUE(MGS_EXCEPTION);
1367 CHECK_VALUE(MGS_TARGET_REG);
1368 CHECK_VALUE(MGS_TARGET_DEL);
1369 CHECK_VALUE(MGS_SET_INFO);
1371 CHECK_VALUE(DISP_IT_EXECD);
1372 CHECK_VALUE(DISP_LOOKUP_EXECD);
1373 CHECK_VALUE(DISP_LOOKUP_NEG);
1374 CHECK_VALUE(DISP_LOOKUP_POS);
1375 CHECK_VALUE(DISP_OPEN_CREATE);
1376 CHECK_VALUE(DISP_OPEN_OPEN);
1378 CHECK_VALUE(MDS_STATUS_CONN);
1379 CHECK_VALUE(MDS_STATUS_LOV);
1381 CHECK_VALUE(LDLM_ENQUEUE);
1382 CHECK_VALUE(LDLM_CONVERT);
1383 CHECK_VALUE(LDLM_CANCEL);
1384 CHECK_VALUE(LDLM_BL_CALLBACK);
1385 CHECK_VALUE(LDLM_CP_CALLBACK);
1386 CHECK_VALUE(LDLM_GL_CALLBACK);
1387 CHECK_VALUE(LDLM_LAST_OPC);
1389 CHECK_VALUE(LCK_EX);
1390 CHECK_VALUE(LCK_PW);
1391 CHECK_VALUE(LCK_PR);
1392 CHECK_VALUE(LCK_CW);
1393 CHECK_VALUE(LCK_CR);
1394 CHECK_VALUE(LCK_NL);
1395 CHECK_VALUE(LCK_GROUP);
1396 CHECK_VALUE(LCK_MAXMODE);
1397 CHECK_VALUE(LCK_MODE_NUM);
1399 CHECK_CVALUE(LDLM_PLAIN);
1400 CHECK_CVALUE(LDLM_EXTENT);
1401 CHECK_CVALUE(LDLM_FLOCK);
1402 CHECK_CVALUE(LDLM_IBITS);
1404 CHECK_VALUE(OBD_PING);
1405 CHECK_VALUE(OBD_LOG_CANCEL);
1406 CHECK_VALUE(OBD_QC_CALLBACK);
1407 CHECK_VALUE(OBD_LAST_OPC);
1409 CHECK_VALUE(QUOTA_DQACQ);
1410 CHECK_VALUE(QUOTA_DQREL);
1412 CHECK_VALUE(MGS_CONNECT);
1413 CHECK_VALUE(MGS_DISCONNECT);
1414 CHECK_VALUE(MGS_EXCEPTION);
1415 CHECK_VALUE(MGS_TARGET_REG);
1416 CHECK_VALUE(MGS_TARGET_DEL);
1417 CHECK_VALUE(MGS_SET_INFO);
1419 COMMENT("Sizes and Offsets");
1421 CHECK_STRUCT(obd_uuid);
1422 check_lustre_handle();
1423 check_lustre_msg_v2();
1424 check_ptlrpc_body();
1425 check_obd_connect_data();
1427 check_lov_mds_md_v1();
1428 check_lov_mds_md_v3();
1429 check_lov_mds_md_join();
1432 check_obd_quotactl();
1433 check_niobuf_remote();
1436 check_lu_fid_pack();
1437 check_mds_status_req();
1439 check_mds_rec_setattr();
1440 check_mds_rec_create();
1441 check_mds_rec_link();
1442 check_mds_rec_unlink();
1443 check_mds_rec_rename();
1444 check_mds_rec_join();
1446 check_ldlm_res_id();
1447 check_ldlm_extent();
1449 check_ldlm_inodebits();
1450 check_ldlm_intent();
1451 check_ldlm_resource_desc();
1452 check_ldlm_lock_desc();
1453 check_ldlm_request();
1459 check_llog_rec_hdr();
1460 check_llog_rec_tail();
1461 check_llog_logid_rec();
1462 check_llog_create_rec();
1463 check_llog_orphan_rec();
1464 check_llog_unlink_rec();
1465 check_llog_setattr_rec();
1466 check_llog_setattr64_rec();
1467 check_llog_size_change_rec();
1468 check_llog_changelog_rec();
1470 check_llog_gen_rec();
1471 check_llog_log_hdr();
1472 check_llog_cookie();
1474 check_llogd_conn_body();
1475 check_llog_array_rec();
1476 check_mds_extent_desc();
1478 check_quota_adjust_qunit();
1479 check_mgs_target_info();
1480 check_lustre_disk_data();
1481 check_ll_user_fiemap();
1482 check_ll_fiemap_extent();
1483 printf("#ifdef LIBLUSTRE_POSIX_ACL\n");
1484 #ifndef LIBLUSTRE_POSIX_ACL
1485 #error build generator without LIBLUSTRE_POSIX_ACL defined - produce wrong check code.
1487 check_posix_acl_xattr_entry();
1488 check_posix_acl_xattr_header();
1490 check_link_ea_header();
1491 check_link_ea_entry();