1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 #include <linux/lustre_lib.h>
7 #include <linux/lustre_idl.h>
16 printf(" /* "c" */\n"); \
19 #define STRINGIFY(a) #a
21 #define CHECK_DEFINE(a) \
23 printf(" LASSERT("#a" == "STRINGIFY(a)");\n"); \
26 #define CHECK_VALUE(a) \
28 printf(" LASSERT("#a" == %d);\n", a); \
31 #define CHECK_MEMBER_OFFSET(s,m) \
33 CHECK_VALUE(offsetof(struct s, m)); \
36 #define CHECK_MEMBER_SIZEOF(s,m) \
38 CHECK_VALUE((int)sizeof(((struct s *)0)->m)); \
41 #define CHECK_MEMBER(s,m) \
43 CHECK_MEMBER_OFFSET(s, m); \
44 CHECK_MEMBER_SIZEOF(s, m); \
47 #define CHECK_STRUCT(s) \
49 COMMENT("Checks for struct "#s); \
50 CHECK_VALUE((int)sizeof(struct s)); \
64 check_lustre_handle(void)
67 CHECK_STRUCT(lustre_handle);
68 CHECK_MEMBER(lustre_handle, cookie);
72 check_lustre_msg(void)
75 CHECK_STRUCT(lustre_msg);
76 CHECK_MEMBER(lustre_msg, handle);
77 CHECK_MEMBER(lustre_msg, magic);
78 CHECK_MEMBER(lustre_msg, type);
79 CHECK_MEMBER(lustre_msg, version);
80 CHECK_MEMBER(lustre_msg, opc);
81 CHECK_MEMBER(lustre_msg, last_xid);
82 CHECK_MEMBER(lustre_msg, last_committed);
83 CHECK_MEMBER(lustre_msg, transno);
84 CHECK_MEMBER(lustre_msg, status);
85 CHECK_MEMBER(lustre_msg, flags);
86 CHECK_MEMBER(lustre_msg, bufcount);
87 CHECK_MEMBER(lustre_msg, buflens[7]);
95 CHECK_MEMBER(obdo, o_id);
96 CHECK_MEMBER(obdo, o_gr);
97 CHECK_MEMBER(obdo, o_atime);
98 CHECK_MEMBER(obdo, o_mtime);
99 CHECK_MEMBER(obdo, o_ctime);
100 CHECK_MEMBER(obdo, o_size);
101 CHECK_MEMBER(obdo, o_blocks);
102 CHECK_MEMBER(obdo, o_rdev);
103 CHECK_MEMBER(obdo, o_blksize);
104 CHECK_MEMBER(obdo, o_mode);
105 CHECK_MEMBER(obdo, o_uid);
106 CHECK_MEMBER(obdo, o_gid);
107 CHECK_MEMBER(obdo, o_flags);
108 CHECK_MEMBER(obdo, o_nlink);
109 CHECK_MEMBER(obdo, o_generation);
110 CHECK_MEMBER(obdo, o_valid);
111 CHECK_MEMBER(obdo, o_obdflags);
112 CHECK_MEMBER(obdo, o_easize);
113 CHECK_MEMBER(obdo, o_inline);
115 CHECK_VALUE(OBD_MD_FLID);
116 CHECK_VALUE(OBD_MD_FLATIME);
117 CHECK_VALUE(OBD_MD_FLMTIME);
118 CHECK_VALUE(OBD_MD_FLCTIME);
119 CHECK_VALUE(OBD_MD_FLSIZE);
120 CHECK_VALUE(OBD_MD_FLBLOCKS);
121 CHECK_VALUE(OBD_MD_FLBLKSZ);
122 CHECK_VALUE(OBD_MD_FLMODE);
123 CHECK_VALUE(OBD_MD_FLTYPE);
124 CHECK_VALUE(OBD_MD_FLUID);
125 CHECK_VALUE(OBD_MD_FLGID);
126 CHECK_VALUE(OBD_MD_FLFLAGS);
127 CHECK_VALUE(OBD_MD_FLOBDFLG);
128 CHECK_VALUE(OBD_MD_FLNLINK);
129 CHECK_VALUE(OBD_MD_FLGENER);
130 CHECK_VALUE(OBD_MD_FLINLINE);
131 CHECK_VALUE(OBD_MD_FLRDEV);
132 CHECK_VALUE(OBD_MD_FLEASIZE);
133 CHECK_VALUE(OBD_MD_LINKNAME);
134 CHECK_VALUE(OBD_MD_FLHANDLE);
135 CHECK_VALUE(OBD_MD_FLCKSUM);
136 CHECK_VALUE(OBD_MD_FLQOS);
137 CHECK_VALUE(OBD_MD_FLOSCOPQ);
138 CHECK_VALUE(OBD_MD_FLCOOKIE);
139 CHECK_VALUE(OBD_MD_FLGROUP);
141 CHECK_VALUE(OBD_FL_INLINEDATA);
142 CHECK_VALUE(OBD_FL_OBDMDEXISTS);
143 CHECK_VALUE(OBD_FL_DELORPHAN);
144 CHECK_VALUE(OBD_FL_NORPC);
145 CHECK_VALUE(OBD_FL_IDONLY);
149 check_lov_mds_md_v1(void)
152 CHECK_STRUCT(lov_mds_md_v1);
153 CHECK_MEMBER(lov_mds_md_v1, lmm_magic);
154 CHECK_MEMBER(lov_mds_md_v1, lmm_pattern);
155 CHECK_MEMBER(lov_mds_md_v1, lmm_object_id);
156 CHECK_MEMBER(lov_mds_md_v1, lmm_object_gr);
157 CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_size);
158 CHECK_MEMBER(lov_mds_md_v1, lmm_stripe_count);
159 CHECK_MEMBER(lov_mds_md_v1, lmm_objects);
162 CHECK_STRUCT(lov_ost_data_v1);
163 CHECK_MEMBER(lov_ost_data_v1, l_object_id);
164 CHECK_MEMBER(lov_ost_data_v1, l_object_gr);
165 CHECK_MEMBER(lov_ost_data_v1, l_ost_gen);
166 CHECK_MEMBER(lov_ost_data_v1, l_ost_idx);
168 CHECK_VALUE(LOV_MAGIC_V0);
169 CHECK_VALUE(LOV_MAGIC_V1);
171 CHECK_VALUE(LOV_PATTERN_RAID0);
172 CHECK_VALUE(LOV_PATTERN_RAID1);
176 check_obd_statfs(void)
179 CHECK_STRUCT(obd_statfs);
180 CHECK_MEMBER(obd_statfs, os_type);
181 CHECK_MEMBER(obd_statfs, os_blocks);
182 CHECK_MEMBER(obd_statfs, os_bfree);
183 CHECK_MEMBER(obd_statfs, os_bavail);
184 CHECK_MEMBER(obd_statfs, os_ffree);
185 CHECK_MEMBER(obd_statfs, os_fsid);
186 CHECK_MEMBER(obd_statfs, os_bsize);
187 CHECK_MEMBER(obd_statfs, os_namelen);
188 CHECK_MEMBER(obd_statfs, os_spare);
192 check_obd_ioobj(void)
195 CHECK_STRUCT(obd_ioobj);
196 CHECK_MEMBER(obd_ioobj, ioo_id);
197 CHECK_MEMBER(obd_ioobj, ioo_gr);
198 CHECK_MEMBER(obd_ioobj, ioo_type);
199 CHECK_MEMBER(obd_ioobj, ioo_bufcnt);
203 check_niobuf_remote(void)
206 CHECK_STRUCT(niobuf_remote);
207 CHECK_MEMBER(niobuf_remote, offset);
208 CHECK_MEMBER(niobuf_remote, len);
209 CHECK_MEMBER(niobuf_remote, flags);
211 CHECK_VALUE(OBD_BRW_READ);
212 CHECK_VALUE(OBD_BRW_WRITE);
213 CHECK_VALUE(OBD_BRW_CREATE);
214 CHECK_VALUE(OBD_BRW_SYNC);
215 CHECK_VALUE(OBD_BRW_FROM_GRANT);
222 CHECK_STRUCT(ost_body);
223 CHECK_MEMBER(ost_body, oa);
230 CHECK_STRUCT(ll_fid);
231 CHECK_MEMBER(ll_fid, id);
232 CHECK_MEMBER(ll_fid, generation);
233 CHECK_MEMBER(ll_fid, f_type);
237 check_mds_status_req(void)
240 CHECK_STRUCT(mds_status_req);
241 CHECK_MEMBER(mds_status_req, flags);
242 CHECK_MEMBER(mds_status_req, repbuf);
249 CHECK_STRUCT(mds_body);
250 CHECK_MEMBER(mds_body, fid1);
251 CHECK_MEMBER(mds_body, fid2);
252 CHECK_MEMBER(mds_body, handle);
253 CHECK_MEMBER(mds_body, size);
254 CHECK_MEMBER(mds_body, blocks);
255 CHECK_MEMBER(mds_body, io_epoch);
256 CHECK_MEMBER(mds_body, ino);
257 CHECK_MEMBER(mds_body, valid);
258 CHECK_MEMBER(mds_body, fsuid);
259 CHECK_MEMBER(mds_body, fsgid);
260 CHECK_MEMBER(mds_body, capability);
261 CHECK_MEMBER(mds_body, mode);
262 CHECK_MEMBER(mds_body, uid);
263 CHECK_MEMBER(mds_body, gid);
264 CHECK_MEMBER(mds_body, mtime);
265 CHECK_MEMBER(mds_body, ctime);
266 CHECK_MEMBER(mds_body, atime);
267 CHECK_MEMBER(mds_body, flags);
268 CHECK_MEMBER(mds_body, rdev);
269 CHECK_MEMBER(mds_body, nlink);
270 CHECK_MEMBER(mds_body, generation);
271 CHECK_MEMBER(mds_body, suppgid);
272 CHECK_MEMBER(mds_body, eadatasize);
274 CHECK_VALUE(FMODE_READ);
275 CHECK_VALUE(FMODE_WRITE);
276 CHECK_VALUE(FMODE_EXEC);
277 CHECK_VALUE(MDS_OPEN_CREAT);
278 CHECK_VALUE(MDS_OPEN_EXCL);
279 CHECK_VALUE(MDS_OPEN_TRUNC);
280 CHECK_VALUE(MDS_OPEN_APPEND);
281 CHECK_VALUE(MDS_OPEN_SYNC);
282 CHECK_VALUE(MDS_OPEN_DIRECTORY);
283 CHECK_VALUE(MDS_OPEN_DELAY_CREATE);
284 CHECK_VALUE(MDS_OPEN_HAS_EA);
288 check_mds_rec_setattr(void)
291 CHECK_STRUCT(mds_rec_setattr);
292 CHECK_MEMBER(mds_rec_setattr, sa_opcode);
293 CHECK_MEMBER(mds_rec_setattr, sa_fsuid);
294 CHECK_MEMBER(mds_rec_setattr, sa_fsgid);
295 CHECK_MEMBER(mds_rec_setattr, sa_cap);
296 CHECK_MEMBER(mds_rec_setattr, sa_suppgid);
297 CHECK_MEMBER(mds_rec_setattr, sa_valid);
298 CHECK_MEMBER(mds_rec_setattr, sa_fid);
299 CHECK_MEMBER(mds_rec_setattr, sa_mode);
300 CHECK_MEMBER(mds_rec_setattr, sa_uid);
301 CHECK_MEMBER(mds_rec_setattr, sa_gid);
302 CHECK_MEMBER(mds_rec_setattr, sa_attr_flags);
303 CHECK_MEMBER(mds_rec_setattr, sa_size);
304 CHECK_MEMBER(mds_rec_setattr, sa_atime);
305 CHECK_MEMBER(mds_rec_setattr, sa_mtime);
306 CHECK_MEMBER(mds_rec_setattr, sa_ctime);
310 check_mds_rec_create(void)
313 CHECK_STRUCT(mds_rec_create);
314 CHECK_MEMBER(mds_rec_create, cr_opcode);
315 CHECK_MEMBER(mds_rec_create, cr_fsuid);
316 CHECK_MEMBER(mds_rec_create, cr_fsgid);
317 CHECK_MEMBER(mds_rec_create, cr_cap);
318 CHECK_MEMBER(mds_rec_create, cr_flags);
319 CHECK_MEMBER(mds_rec_create, cr_mode);
320 CHECK_MEMBER(mds_rec_create, cr_fid);
321 CHECK_MEMBER(mds_rec_create, cr_replayfid);
322 CHECK_MEMBER(mds_rec_create, cr_time);
323 CHECK_MEMBER(mds_rec_create, cr_rdev);
324 CHECK_MEMBER(mds_rec_create, cr_suppgid);
328 check_mds_rec_link(void)
331 CHECK_STRUCT(mds_rec_link);
332 CHECK_MEMBER(mds_rec_link, lk_opcode);
333 CHECK_MEMBER(mds_rec_link, lk_fsuid);
334 CHECK_MEMBER(mds_rec_link, lk_fsgid);
335 CHECK_MEMBER(mds_rec_link, lk_cap);
336 CHECK_MEMBER(mds_rec_link, lk_suppgid1);
337 CHECK_MEMBER(mds_rec_link, lk_suppgid2);
338 CHECK_MEMBER(mds_rec_link, lk_fid1);
339 CHECK_MEMBER(mds_rec_link, lk_fid2);
340 CHECK_MEMBER(mds_rec_link, lk_time);
344 check_mds_rec_unlink(void)
347 CHECK_STRUCT(mds_rec_unlink);
348 CHECK_MEMBER(mds_rec_unlink, ul_opcode);
349 CHECK_MEMBER(mds_rec_unlink, ul_fsuid);
350 CHECK_MEMBER(mds_rec_unlink, ul_fsgid);
351 CHECK_MEMBER(mds_rec_unlink, ul_cap);
352 CHECK_MEMBER(mds_rec_unlink, ul_suppgid);
353 CHECK_MEMBER(mds_rec_unlink, ul_mode);
354 CHECK_MEMBER(mds_rec_unlink, ul_fid1);
355 CHECK_MEMBER(mds_rec_unlink, ul_fid2);
356 CHECK_MEMBER(mds_rec_unlink, ul_time);
360 check_mds_rec_rename(void)
363 CHECK_STRUCT(mds_rec_rename);
364 CHECK_MEMBER(mds_rec_rename, rn_opcode);
365 CHECK_MEMBER(mds_rec_rename, rn_fsuid);
366 CHECK_MEMBER(mds_rec_rename, rn_fsgid);
367 CHECK_MEMBER(mds_rec_rename, rn_cap);
368 CHECK_MEMBER(mds_rec_rename, rn_suppgid1);
369 CHECK_MEMBER(mds_rec_rename, rn_suppgid2);
370 CHECK_MEMBER(mds_rec_rename, rn_fid1);
371 CHECK_MEMBER(mds_rec_rename, rn_fid2);
372 CHECK_MEMBER(mds_rec_rename, rn_time);
379 CHECK_STRUCT(lov_desc);
380 CHECK_MEMBER(lov_desc, ld_tgt_count);
381 CHECK_MEMBER(lov_desc, ld_active_tgt_count);
382 CHECK_MEMBER(lov_desc, ld_default_stripe_count);
383 CHECK_MEMBER(lov_desc, ld_pattern);
384 CHECK_MEMBER(lov_desc, ld_default_stripe_size);
385 CHECK_MEMBER(lov_desc, ld_default_stripe_offset);
386 CHECK_MEMBER(lov_desc, ld_uuid);
390 check_ldlm_res_id(void)
393 CHECK_STRUCT(ldlm_res_id);
394 CHECK_MEMBER(ldlm_res_id, name[RES_NAME_SIZE]);
398 check_ldlm_extent(void)
401 CHECK_STRUCT(ldlm_extent);
402 CHECK_MEMBER(ldlm_extent, start);
403 CHECK_MEMBER(ldlm_extent, end);
407 check_ldlm_flock(void)
410 CHECK_STRUCT(ldlm_flock);
411 CHECK_MEMBER(ldlm_flock, start);
412 CHECK_MEMBER(ldlm_flock, end);
413 CHECK_MEMBER(ldlm_flock, blocking_export);
414 CHECK_MEMBER(ldlm_flock, blocking_pid);
415 CHECK_MEMBER(ldlm_flock, pid);
419 check_ldlm_intent(void)
422 CHECK_STRUCT(ldlm_intent);
423 CHECK_MEMBER(ldlm_intent, opc);
427 check_ldlm_resource_desc(void)
430 CHECK_STRUCT(ldlm_resource_desc);
431 CHECK_MEMBER(ldlm_resource_desc, lr_type);
432 CHECK_MEMBER(ldlm_resource_desc, lr_name);
433 CHECK_MEMBER(ldlm_resource_desc, lr_version[RES_VERSION_SIZE]);
437 check_ldlm_lock_desc(void)
440 CHECK_STRUCT(ldlm_lock_desc);
441 CHECK_MEMBER(ldlm_lock_desc, l_resource);
442 CHECK_MEMBER(ldlm_lock_desc, l_req_mode);
443 CHECK_MEMBER(ldlm_lock_desc, l_granted_mode);
444 CHECK_MEMBER(ldlm_lock_desc, l_policy_data);
445 CHECK_MEMBER(ldlm_lock_desc, l_version[RES_VERSION_SIZE]);
449 check_ldlm_request(void)
452 CHECK_STRUCT(ldlm_request);
453 CHECK_MEMBER(ldlm_request, lock_flags);
454 CHECK_MEMBER(ldlm_request, lock_desc);
455 CHECK_MEMBER(ldlm_request, lock_handle1);
456 CHECK_MEMBER(ldlm_request, lock_handle2);
460 check_ldlm_reply(void)
463 CHECK_STRUCT(ldlm_reply);
464 CHECK_MEMBER(ldlm_reply, lock_flags);
465 CHECK_MEMBER(ldlm_reply, lock_mode);
466 CHECK_MEMBER(ldlm_reply, lock_resource_name);
467 CHECK_MEMBER(ldlm_reply, lock_handle);
468 CHECK_MEMBER(ldlm_reply, lock_policy_data);
469 CHECK_MEMBER(ldlm_reply, lock_policy_res1);
470 CHECK_MEMBER(ldlm_reply, lock_policy_res2);
477 CHECK_STRUCT(ptlbd_op);
478 CHECK_MEMBER(ptlbd_op, op_cmd);
479 CHECK_MEMBER(ptlbd_op, op_lun);
480 CHECK_MEMBER(ptlbd_op, op_niob_cnt);
481 CHECK_MEMBER(ptlbd_op, op__padding);
482 CHECK_MEMBER(ptlbd_op, op_block_cnt);
486 check_ptlbd_niob(void)
489 CHECK_STRUCT(ptlbd_niob);
490 CHECK_MEMBER(ptlbd_niob, n_xid);
491 CHECK_MEMBER(ptlbd_niob, n_block_nr);
492 CHECK_MEMBER(ptlbd_niob, n_offset);
493 CHECK_MEMBER(ptlbd_niob, n_length);
497 check_ptlbd_rsp(void)
500 CHECK_STRUCT(ptlbd_rsp);
501 CHECK_MEMBER(ptlbd_rsp, r_status);
502 CHECK_MEMBER(ptlbd_rsp, r_error_cnt);
506 check_llog_logid(void)
509 CHECK_STRUCT(llog_logid);
510 CHECK_MEMBER(llog_logid, lgl_oid);
511 CHECK_MEMBER(llog_logid, lgl_ogr);
512 CHECK_MEMBER(llog_logid, lgl_ogen);
514 CHECK_VALUE(OST_SZ_REC);
515 CHECK_VALUE(OST_RAID1_REC);
516 CHECK_VALUE(MDS_UNLINK_REC);
517 CHECK_VALUE(OBD_CFG_REC);
518 CHECK_VALUE(PTL_CFG_REC);
519 CHECK_VALUE(LLOG_GEN_REC);
520 CHECK_VALUE(LLOG_HDR_MAGIC);
521 CHECK_VALUE(LLOG_LOGID_MAGIC);
525 check_llog_rec_hdr(void)
528 CHECK_STRUCT(llog_rec_hdr);
529 CHECK_MEMBER(llog_rec_hdr, lrh_len);
530 CHECK_MEMBER(llog_rec_hdr, lrh_index);
531 CHECK_MEMBER(llog_rec_hdr, lrh_type);
535 check_llog_rec_tail(void)
538 CHECK_STRUCT(llog_rec_tail);
539 CHECK_MEMBER(llog_rec_tail, lrt_len);
540 CHECK_MEMBER(llog_rec_tail, lrt_index);
544 check_llog_logid_rec(void)
547 CHECK_STRUCT(llog_logid_rec);
548 CHECK_MEMBER(llog_logid_rec, lid_hdr);
549 CHECK_MEMBER(llog_logid_rec, lid_id);
550 CHECK_MEMBER(llog_logid_rec, lid_tail);
554 check_llog_create_rec(void)
557 CHECK_STRUCT(llog_create_rec);
558 CHECK_MEMBER(llog_create_rec, lcr_hdr);
559 CHECK_MEMBER(llog_create_rec, lcr_fid);
560 CHECK_MEMBER(llog_create_rec, lcr_oid);
561 CHECK_MEMBER(llog_create_rec, lcr_ogen);
565 check_llog_orphan_rec(void)
568 CHECK_STRUCT(llog_orphan_rec);
569 CHECK_MEMBER(llog_orphan_rec, lor_hdr);
570 CHECK_MEMBER(llog_orphan_rec, lor_oid);
571 CHECK_MEMBER(llog_orphan_rec, lor_ogen);
572 CHECK_MEMBER(llog_orphan_rec, lor_tail);
576 check_llog_unlink_rec(void)
579 CHECK_STRUCT(llog_unlink_rec);
580 CHECK_MEMBER(llog_unlink_rec, lur_hdr);
581 CHECK_MEMBER(llog_unlink_rec, lur_oid);
582 CHECK_MEMBER(llog_unlink_rec, lur_ogen);
583 CHECK_MEMBER(llog_unlink_rec, lur_tail);
587 check_llog_size_change_rec(void)
590 CHECK_STRUCT(llog_size_change_rec);
591 CHECK_MEMBER(llog_size_change_rec, lsc_hdr);
592 CHECK_MEMBER(llog_size_change_rec, lsc_fid);
593 CHECK_MEMBER(llog_size_change_rec, lsc_io_epoch);
594 CHECK_MEMBER(llog_size_change_rec, lsc_tail);
601 CHECK_STRUCT(llog_gen);
602 CHECK_MEMBER(llog_gen, mnt_cnt);
603 CHECK_MEMBER(llog_gen, conn_cnt);
607 check_llog_gen_rec(void)
610 CHECK_STRUCT(llog_gen_rec);
611 CHECK_MEMBER(llog_gen_rec, lgr_hdr);
612 CHECK_MEMBER(llog_gen_rec, lgr_gen);
613 CHECK_MEMBER(llog_gen_rec, lgr_tail);
617 check_llog_log_hdr(void)
620 CHECK_STRUCT(llog_log_hdr);
621 CHECK_MEMBER(llog_log_hdr, llh_hdr);
622 CHECK_MEMBER(llog_log_hdr, llh_timestamp);
623 CHECK_MEMBER(llog_log_hdr, llh_count);
624 CHECK_MEMBER(llog_log_hdr, llh_bitmap_offset);
625 CHECK_MEMBER(llog_log_hdr, llh_size);
626 CHECK_MEMBER(llog_log_hdr, llh_flags);
627 CHECK_MEMBER(llog_log_hdr, llh_cat_idx);
628 CHECK_MEMBER(llog_log_hdr, llh_tgtuuid);
629 CHECK_MEMBER(llog_log_hdr, llh_reserved);
630 CHECK_MEMBER(llog_log_hdr, llh_bitmap);
631 CHECK_MEMBER(llog_log_hdr, llh_tail);
635 check_llog_cookie(void)
638 CHECK_STRUCT(llog_cookie);
639 CHECK_MEMBER(llog_cookie, lgc_lgl);
640 CHECK_MEMBER(llog_cookie, lgc_subsys);
641 CHECK_MEMBER(llog_cookie, lgc_index);
645 check_llogd_body(void)
648 CHECK_STRUCT(llogd_body);
649 CHECK_MEMBER(llogd_body, lgd_logid);
650 CHECK_MEMBER(llogd_body, lgd_ctxt_idx);
651 CHECK_MEMBER(llogd_body, lgd_llh_flags);
652 CHECK_MEMBER(llogd_body, lgd_index);
653 CHECK_MEMBER(llogd_body, lgd_saved_index);
654 CHECK_MEMBER(llogd_body, lgd_len);
655 CHECK_MEMBER(llogd_body, lgd_cur_offset);
657 CHECK_VALUE(LLOG_ORIGIN_HANDLE_CREATE);
658 CHECK_VALUE(LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
659 CHECK_VALUE(LLOG_ORIGIN_HANDLE_READ_HEADER);
660 CHECK_VALUE(LLOG_ORIGIN_HANDLE_WRITE_REC);
661 CHECK_VALUE(LLOG_ORIGIN_HANDLE_CLOSE);
662 CHECK_VALUE(LLOG_ORIGIN_CONNECT);
663 CHECK_VALUE(LLOG_CATINFO);
667 check_llogd_conn_body(void)
670 CHECK_STRUCT(llogd_conn_body);
671 CHECK_MEMBER(llogd_conn_body, lgdc_gen);
672 CHECK_MEMBER(llogd_conn_body, lgdc_logid);
673 CHECK_MEMBER(llogd_conn_body, lgdc_ctxt_idx);
677 main(int argc, char **argv)
679 printf("void lustre_assert_wire_constants(void)\n"
682 COMMENT("Wire protocol assertions generated by 'wirecheck'");
685 COMMENT("Constants...");
686 CHECK_DEFINE(PTLRPC_MSG_MAGIC);
687 CHECK_DEFINE(PTLRPC_MSG_VERSION);
689 CHECK_VALUE(PTL_RPC_MSG_REQUEST);
690 CHECK_VALUE(PTL_RPC_MSG_ERR);
691 CHECK_VALUE(PTL_RPC_MSG_REPLY);
693 CHECK_VALUE(MSG_LAST_REPLAY);
694 CHECK_VALUE(MSG_RESENT);
696 CHECK_VALUE(MSG_CONNECT_RECOVERING);
697 CHECK_VALUE(MSG_CONNECT_RECONNECT);
698 CHECK_VALUE(MSG_CONNECT_REPLAYABLE);
700 CHECK_VALUE(OST_REPLY);
701 CHECK_VALUE(OST_GETATTR);
702 CHECK_VALUE(OST_SETATTR);
703 CHECK_VALUE(OST_READ);
704 CHECK_VALUE(OST_WRITE);
705 CHECK_VALUE(OST_CREATE);
706 CHECK_VALUE(OST_DESTROY);
707 CHECK_VALUE(OST_GET_INFO);
708 CHECK_VALUE(OST_CONNECT);
709 CHECK_VALUE(OST_DISCONNECT);
710 CHECK_VALUE(OST_PUNCH);
711 CHECK_VALUE(OST_OPEN);
712 CHECK_VALUE(OST_CLOSE);
713 CHECK_VALUE(OST_STATFS);
714 CHECK_VALUE(OST_SAN_READ);
715 CHECK_VALUE(OST_SAN_WRITE);
716 CHECK_VALUE(OST_SYNC);
717 CHECK_VALUE(OST_LAST_OPC);
719 CHECK_DEFINE(OBD_OBJECT_EOF);
721 CHECK_VALUE(OST_REQ_HAS_OA1);
723 CHECK_VALUE(MDS_GETATTR);
724 CHECK_VALUE(MDS_GETATTR_NAME);
725 CHECK_VALUE(MDS_CLOSE);
726 CHECK_VALUE(MDS_REINT);
727 CHECK_VALUE(MDS_READPAGE);
728 CHECK_VALUE(MDS_CONNECT);
729 CHECK_VALUE(MDS_DISCONNECT);
730 CHECK_VALUE(MDS_GETSTATUS);
731 CHECK_VALUE(MDS_STATFS);
732 CHECK_VALUE(MDS_PIN);
733 CHECK_VALUE(MDS_UNPIN);
734 CHECK_VALUE(MDS_SYNC);
735 CHECK_VALUE(MDS_DONE_WRITING);
736 CHECK_VALUE(MDS_LAST_OPC);
738 CHECK_VALUE(REINT_SETATTR);
739 CHECK_VALUE(REINT_CREATE);
740 CHECK_VALUE(REINT_LINK);
741 CHECK_VALUE(REINT_UNLINK);
742 CHECK_VALUE(REINT_RENAME);
743 CHECK_VALUE(REINT_OPEN);
744 CHECK_VALUE(REINT_MAX);
746 CHECK_VALUE(DISP_IT_EXECD);
747 CHECK_VALUE(DISP_LOOKUP_EXECD);
748 CHECK_VALUE(DISP_LOOKUP_NEG);
749 CHECK_VALUE(DISP_LOOKUP_POS);
750 CHECK_VALUE(DISP_OPEN_CREATE);
751 CHECK_VALUE(DISP_OPEN_OPEN);
753 CHECK_VALUE(MDS_STATUS_CONN);
754 CHECK_VALUE(MDS_STATUS_LOV);
756 CHECK_VALUE(MDS_OPEN_HAS_EA);
758 CHECK_VALUE(LDLM_ENQUEUE);
759 CHECK_VALUE(LDLM_CONVERT);
760 CHECK_VALUE(LDLM_CANCEL);
761 CHECK_VALUE(LDLM_BL_CALLBACK);
762 CHECK_VALUE(LDLM_CP_CALLBACK);
763 CHECK_VALUE(LDLM_LAST_OPC);
772 CHECK_VALUE(PTLBD_QUERY);
773 CHECK_VALUE(PTLBD_READ);
774 CHECK_VALUE(PTLBD_WRITE);
775 CHECK_VALUE(PTLBD_FLUSH);
776 CHECK_VALUE(PTLBD_CONNECT);
777 CHECK_VALUE(PTLBD_DISCONNECT);
778 CHECK_VALUE(PTLBD_LAST_OPC);
780 CHECK_VALUE(MGMT_CONNECT);
781 CHECK_VALUE(MGMT_DISCONNECT);
782 CHECK_VALUE(MGMT_EXCEPTION);
784 CHECK_VALUE(OBD_PING);
785 CHECK_VALUE(OBD_LOG_CANCEL);
786 CHECK_VALUE(OBD_LAST_OPC);
788 COMMENT("Sizes and Offsets");
790 check_lustre_handle();
793 check_lov_mds_md_v1();
796 check_niobuf_remote();
799 check_mds_status_req();
801 check_mds_rec_setattr();
802 check_mds_rec_create();
803 check_mds_rec_link();
804 check_mds_rec_unlink();
805 check_mds_rec_rename();
811 check_ldlm_resource_desc();
812 check_ldlm_lock_desc();
813 check_ldlm_request();
819 check_llog_rec_hdr();
820 check_llog_rec_tail();
821 check_llog_log_hdr();
824 check_llogd_conn_body();