1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2001-2003 Cluster File Systems, Inc.
5 * Author: Peter J. Braam <braam@clusterfs.com>
6 * Author: Phil Schwan <phil@clusterfs.com>
7 * Author: Eric Barton <eeb@clusterfs.com>
9 * This file is part of Lustre, http://www.lustre.org.
11 * Lustre is free software; you can redistribute it and/or
12 * modify it under the terms of version 2 of the GNU General Public
13 * License as published by the Free Software Foundation.
15 * Lustre is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Lustre; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 * (Un)packing of OST requests
28 #define DEBUG_SUBSYSTEM S_RPC
30 #include <liblustre.h>
33 #include <linux/obd_support.h>
34 #include <linux/obd_class.h>
35 #include <linux/lustre_net.h>
38 #define HDR_SIZE(count) \
39 size_round(offsetof (struct lustre_msg, buflens[(count)]))
41 int lustre_msg_swabbed(struct lustre_msg *msg)
43 return (msg->magic == __swab32(PTLRPC_MSG_MAGIC));
47 lustre_init_msg (struct lustre_msg *msg, int count, int *lens, char **bufs)
52 msg->magic = PTLRPC_MSG_MAGIC;
53 msg->version = PTLRPC_MSG_VERSION;
54 msg->bufcount = count;
55 for (i = 0; i < count; i++)
56 msg->buflens[i] = lens[i];
61 ptr = (char *)msg + HDR_SIZE(count);
62 for (i = 0; i < count; i++) {
64 LOGL(tmp, lens[i], ptr);
68 int lustre_pack_request (struct ptlrpc_request *req,
69 int count, int *lens, char **bufs)
73 req->rq_reqlen = lustre_msg_size (count, lens);
74 OBD_ALLOC(req->rq_reqmsg, req->rq_reqlen);
75 if (req->rq_reqmsg == NULL)
78 lustre_init_msg (req->rq_reqmsg, count, lens, bufs);
83 LIST_HEAD(ptlrpc_rs_debug_lru);
84 spinlock_t ptlrpc_rs_debug_lock = SPIN_LOCK_UNLOCKED;
86 #define PTLRPC_RS_DEBUG_LRU_ADD(rs) \
88 unsigned long __flags; \
90 spin_lock_irqsave(&ptlrpc_rs_debug_lock, __flags); \
91 list_add_tail(&(rs)->rs_debug_list, &ptlrpc_rs_debug_lru); \
92 spin_unlock_irqrestore(&ptlrpc_rs_debug_lock, __flags); \
95 #define PTLRPC_RS_DEBUG_LRU_DEL(rs) \
97 unsigned long __flags; \
99 spin_lock_irqsave(&ptlrpc_rs_debug_lock, __flags); \
100 list_del(&(rs)->rs_debug_list); \
101 spin_unlock_irqrestore(&ptlrpc_rs_debug_lock, __flags); \
104 # define PTLRPC_RS_DEBUG_LRU_ADD(rs) do {} while(0)
105 # define PTLRPC_RS_DEBUG_LRU_DEL(rs) do {} while(0)
108 int lustre_pack_reply (struct ptlrpc_request *req,
109 int count, int *lens, char **bufs)
111 struct ptlrpc_reply_state *rs;
116 LASSERT (req->rq_reply_state == NULL);
118 msg_len = lustre_msg_size (count, lens);
119 size = offsetof (struct ptlrpc_reply_state, rs_msg) + msg_len;
120 OBD_ALLOC (rs, size);
124 rs->rs_cb_id.cbid_fn = reply_out_callback;
125 rs->rs_cb_id.cbid_arg = rs;
126 rs->rs_srv_ni = req->rq_rqbd->rqbd_srv_ni;
128 INIT_LIST_HEAD(&rs->rs_exp_list);
129 INIT_LIST_HEAD(&rs->rs_obd_list);
131 req->rq_replen = msg_len;
132 req->rq_reply_state = rs;
133 req->rq_repmsg = &rs->rs_msg;
134 lustre_init_msg (&rs->rs_msg, count, lens, bufs);
136 PTLRPC_RS_DEBUG_LRU_ADD(rs);
141 void lustre_free_reply_state (struct ptlrpc_reply_state *rs)
143 PTLRPC_RS_DEBUG_LRU_DEL(rs);
145 LASSERT (!rs->rs_difficult || rs->rs_handled);
146 LASSERT (!rs->rs_on_net);
147 LASSERT (!rs->rs_scheduled);
148 LASSERT (rs->rs_export == NULL);
149 LASSERT (rs->rs_nlocks == 0);
150 LASSERT (list_empty(&rs->rs_exp_list));
151 LASSERT (list_empty(&rs->rs_obd_list));
153 OBD_FREE (rs, rs->rs_size);
156 /* This returns the size of the buffer that is required to hold a lustre_msg
157 * with the given sub-buffer lengths. */
158 int lustre_msg_size(int count, int *lengths)
163 size = HDR_SIZE (count);
164 for (i = 0; i < count; i++)
165 size += size_round(lengths[i]);
170 int lustre_unpack_msg(struct lustre_msg *m, int len)
177 /* We can provide a slightly better error log, if we check the
178 * message magic and version first. In the future, struct
179 * lustre_msg may grow, and we'd like to log a version mismatch,
180 * rather than a short message.
183 required_len = MAX (offsetof (struct lustre_msg, version) +
185 offsetof (struct lustre_msg, magic) +
187 if (len < required_len) {
188 /* can't even look inside the message */
189 CERROR ("message length %d too small for magic/version check\n",
194 flipped = lustre_msg_swabbed(m);
196 __swab32s (&m->version);
197 else if (m->magic != PTLRPC_MSG_MAGIC) {
198 CERROR("wrong lustre_msg magic %#08x\n", m->magic);
202 if (m->version != PTLRPC_MSG_VERSION) {
203 CERROR("wrong lustre_msg version %#08x\n", m->version);
207 /* Now we know the sender speaks my language (but possibly flipped)...*/
208 required_len = HDR_SIZE(0);
209 if (len < required_len) {
210 /* can't even look inside the message */
211 CERROR ("message length %d too small for lustre_msg\n", len);
216 __swab32s (&m->type);
218 __swab64s (&m->last_xid);
219 __swab64s (&m->last_committed);
220 __swab64s (&m->transno);
221 __swab32s (&m->status);
222 __swab32s (&m->bufcount);
223 __swab32s (&m->flags);
226 required_len = HDR_SIZE(m->bufcount);
228 if (len < required_len) {
229 /* didn't receive all the buffer lengths */
230 CERROR ("message length %d too small for %d buflens\n",
235 for (i = 0; i < m->bufcount; i++) {
237 __swab32s (&m->buflens[i]);
238 required_len += size_round(m->buflens[i]);
241 if (len < required_len) {
242 CERROR("len: %d, required_len %d\n", len, required_len);
243 CERROR("bufcount: %d\n", m->bufcount);
244 for (i = 0; i < m->bufcount; i++)
245 CERROR("buffer %d length %d\n", i, m->buflens[i]);
252 void *lustre_msg_buf(struct lustre_msg *m, int n, int min_size)
262 bufcount = m->bufcount;
264 CDEBUG(D_INFO, "msg %p buffer[%d] not present (count %d)\n",
269 buflen = m->buflens[n];
270 if (buflen < min_size) {
271 CERROR("msg %p buffer[%d] size %d too small (required %d)\n",
272 m, n, buflen, min_size);
276 offset = HDR_SIZE(bufcount);
277 for (i = 0; i < n; i++)
278 offset += size_round(m->buflens[i]);
280 return (char *)m + offset;
283 char *lustre_msg_string (struct lustre_msg *m, int index, int max_len)
285 /* max_len == 0 means the string should fill the buffer */
286 char *str = lustre_msg_buf (m, index, 0);
291 CERROR ("can't unpack string in msg %p buffer[%d]\n", m, index);
295 blen = m->buflens[index];
296 slen = strnlen (str, blen);
298 if (slen == blen) { /* not NULL terminated */
299 CERROR ("can't unpack non-NULL terminated string in "
300 "msg %p buffer[%d] len %d\n", m, index, blen);
305 if (slen != blen - 1) {
306 CERROR ("can't unpack short string in msg %p "
307 "buffer[%d] len %d: strlen %d\n",
308 m, index, blen, slen);
311 } else if (slen > max_len) {
312 CERROR ("can't unpack oversized string in msg %p "
313 "buffer[%d] len %d strlen %d: max %d expected\n",
314 m, index, blen, slen, max_len);
321 /* Wrap up the normal fixed length case */
322 void *lustre_swab_reqbuf (struct ptlrpc_request *req, int index, int min_size,
327 LASSERT_REQSWAB(req, index);
329 ptr = lustre_msg_buf(req->rq_reqmsg, index, min_size);
333 if (swabber != NULL && lustre_msg_swabbed(req->rq_reqmsg))
334 ((void (*)(void *))swabber)(ptr);
339 /* Wrap up the normal fixed length case */
340 void *lustre_swab_repbuf (struct ptlrpc_request *req, int index, int min_size,
345 LASSERT_REPSWAB(req, index);
347 ptr = lustre_msg_buf(req->rq_repmsg, index, min_size);
351 if (swabber != NULL && lustre_msg_swabbed(req->rq_repmsg))
352 ((void (*)(void *))swabber)(ptr);
357 /* byte flipping routines for all wire types declared in
358 * lustre_idl.h implemented here.
361 void lustre_swab_obdo (struct obdo *o)
363 __swab64s (&o->o_id);
364 __swab64s (&o->o_gr);
365 __swab64s (&o->o_atime);
366 __swab64s (&o->o_mtime);
367 __swab64s (&o->o_ctime);
368 __swab64s (&o->o_size);
369 __swab64s (&o->o_blocks);
370 __swab64s (&o->o_grant);
371 __swab32s (&o->o_blksize);
372 __swab32s (&o->o_mode);
373 __swab32s (&o->o_uid);
374 __swab32s (&o->o_gid);
375 __swab32s (&o->o_flags);
376 __swab32s (&o->o_nlink);
377 __swab32s (&o->o_generation);
378 __swab32s (&o->o_valid);
379 __swab32s (&o->o_misc);
380 __swab32s (&o->o_easize);
381 /* o_inline is opaque */
384 void lustre_swab_obd_statfs (struct obd_statfs *os)
386 __swab64s (&os->os_type);
387 __swab64s (&os->os_blocks);
388 __swab64s (&os->os_bfree);
389 __swab64s (&os->os_bavail);
390 __swab64s (&os->os_ffree);
391 /* no need to swap os_fsid */
392 __swab32s (&os->os_bsize);
393 __swab32s (&os->os_namelen);
394 /* no need to swap os_spare */
397 void lustre_swab_obd_ioobj (struct obd_ioobj *ioo)
399 __swab64s (&ioo->ioo_id);
400 __swab64s (&ioo->ioo_gr);
401 __swab32s (&ioo->ioo_type);
402 __swab32s (&ioo->ioo_bufcnt);
405 void lustre_swab_niobuf_remote (struct niobuf_remote *nbr)
407 __swab64s (&nbr->offset);
408 __swab32s (&nbr->len);
409 __swab32s (&nbr->flags);
412 void lustre_swab_ost_body (struct ost_body *b)
414 lustre_swab_obdo (&b->oa);
417 void lustre_swab_ost_last_id(obd_id *id)
422 void lustre_swab_ll_fid (struct ll_fid *fid)
424 __swab64s (&fid->id);
425 __swab32s (&fid->generation);
426 __swab32s (&fid->f_type);
429 void lustre_swab_mds_status_req (struct mds_status_req *r)
431 __swab32s (&r->flags);
432 __swab32s (&r->repbuf);
435 void lustre_swab_mds_body (struct mds_body *b)
437 lustre_swab_ll_fid (&b->fid1);
438 lustre_swab_ll_fid (&b->fid2);
439 /* handle is opaque */
440 __swab64s (&b->size);
441 __swab64s (&b->blocks);
443 __swab32s (&b->valid);
444 __swab32s (&b->fsuid);
445 __swab32s (&b->fsgid);
446 __swab32s (&b->capability);
447 __swab32s (&b->mode);
450 __swab32s (&b->mtime);
451 __swab32s (&b->ctime);
452 __swab32s (&b->atime);
453 __swab32s (&b->flags);
454 __swab32s (&b->rdev);
455 __swab32s (&b->nlink);
456 __swab32s (&b->generation);
457 __swab32s (&b->suppgid);
458 __swab32s (&b->eadatasize);
461 void lustre_swab_mds_rec_setattr (struct mds_rec_setattr *sa)
463 __swab32s (&sa->sa_opcode);
464 __swab32s (&sa->sa_fsuid);
465 __swab32s (&sa->sa_fsgid);
466 __swab32s (&sa->sa_cap);
467 __swab32s (&sa->sa_suppgid);
468 __swab32s (&sa->sa_valid);
469 lustre_swab_ll_fid (&sa->sa_fid);
470 __swab32s (&sa->sa_mode);
471 __swab32s (&sa->sa_uid);
472 __swab32s (&sa->sa_gid);
473 __swab32s (&sa->sa_attr_flags);
474 __swab64s (&sa->sa_size);
475 __swab64s (&sa->sa_atime);
476 __swab64s (&sa->sa_mtime);
477 __swab64s (&sa->sa_ctime);
480 void lustre_swab_mds_rec_create (struct mds_rec_create *cr)
482 __swab32s (&cr->cr_opcode);
483 __swab32s (&cr->cr_fsuid);
484 __swab32s (&cr->cr_fsgid);
485 __swab32s (&cr->cr_cap);
486 __swab32s (&cr->cr_flags); /* for use with open */
487 __swab32s (&cr->cr_mode);
488 lustre_swab_ll_fid (&cr->cr_fid);
489 lustre_swab_ll_fid (&cr->cr_replayfid);
490 __swab64s (&cr->cr_time);
491 __swab64s (&cr->cr_rdev);
492 __swab32s (&cr->cr_suppgid);
495 void lustre_swab_mds_rec_link (struct mds_rec_link *lk)
497 __swab32s (&lk->lk_opcode);
498 __swab32s (&lk->lk_fsuid);
499 __swab32s (&lk->lk_fsgid);
500 __swab32s (&lk->lk_cap);
501 __swab32s (&lk->lk_suppgid1);
502 __swab32s (&lk->lk_suppgid2);
503 lustre_swab_ll_fid (&lk->lk_fid1);
504 lustre_swab_ll_fid (&lk->lk_fid2);
507 void lustre_swab_mds_rec_unlink (struct mds_rec_unlink *ul)
509 __swab32s (&ul->ul_opcode);
510 __swab32s (&ul->ul_fsuid);
511 __swab32s (&ul->ul_fsgid);
512 __swab32s (&ul->ul_cap);
513 __swab32s (&ul->ul_suppgid);
514 __swab32s (&ul->ul_mode);
515 lustre_swab_ll_fid (&ul->ul_fid1);
516 lustre_swab_ll_fid (&ul->ul_fid2);
519 void lustre_swab_mds_rec_rename (struct mds_rec_rename *rn)
521 __swab32s (&rn->rn_opcode);
522 __swab32s (&rn->rn_fsuid);
523 __swab32s (&rn->rn_fsgid);
524 __swab32s (&rn->rn_cap);
525 __swab32s (&rn->rn_suppgid1);
526 __swab32s (&rn->rn_suppgid2);
527 lustre_swab_ll_fid (&rn->rn_fid1);
528 lustre_swab_ll_fid (&rn->rn_fid2);
531 void lustre_swab_lov_desc (struct lov_desc *ld)
533 __swab32s (&ld->ld_tgt_count);
534 __swab32s (&ld->ld_active_tgt_count);
535 __swab32s (&ld->ld_default_stripe_count);
536 __swab64s (&ld->ld_default_stripe_size);
537 __swab64s (&ld->ld_default_stripe_offset);
538 __swab32s (&ld->ld_pattern);
539 /* uuid endian insensitive */
542 void lustre_swab_ldlm_res_id (struct ldlm_res_id *id)
546 for (i = 0; i < RES_NAME_SIZE; i++)
547 __swab64s (&id->name[i]);
550 void lustre_swab_ldlm_policy_data (ldlm_policy_data_t *d)
552 /* the lock data is a union and the first two fields are always an
553 * extent so it's ok to process an LDLM_EXTENT and LDLM_FLOCK lock
554 * data the same way. */
555 __swab64s (&d->l_flock.start);
556 __swab64s (&d->l_flock.end);
557 __swab32s (&d->l_flock.pid);
560 void lustre_swab_ldlm_intent (struct ldlm_intent *i)
565 void lustre_swab_ldlm_resource_desc (struct ldlm_resource_desc *r)
569 __swab32s (&r->lr_type);
570 lustre_swab_ldlm_res_id (&r->lr_name);
571 for (i = 0; i < RES_VERSION_SIZE; i++)
572 __swab32s (&r->lr_version[i]);
575 void lustre_swab_ldlm_lock_desc (struct ldlm_lock_desc *l)
579 lustre_swab_ldlm_resource_desc (&l->l_resource);
580 __swab32s (&l->l_req_mode);
581 __swab32s (&l->l_granted_mode);
582 lustre_swab_ldlm_policy_data (&l->l_policy_data);
583 for (i = 0; i < RES_VERSION_SIZE; i++)
584 __swab32s (&l->l_version[i]);
587 void lustre_swab_ldlm_request (struct ldlm_request *rq)
589 __swab32s (&rq->lock_flags);
590 lustre_swab_ldlm_lock_desc (&rq->lock_desc);
591 /* lock_handle1 opaque */
592 /* lock_handle2 opaque */
595 void lustre_swab_ldlm_reply (struct ldlm_reply *r)
597 __swab32s (&r->lock_flags);
598 __swab32s (&r->lock_mode);
599 lustre_swab_ldlm_res_id (&r->lock_resource_name);
600 /* lock_handle opaque */
601 lustre_swab_ldlm_policy_data (&r->lock_policy_data);
602 __swab64s (&r->lock_policy_res1);
603 __swab64s (&r->lock_policy_res2);
606 void lustre_swab_ptlbd_op (struct ptlbd_op *op)
608 __swab16s (&op->op_cmd);
609 __swab16s (&op->op_lun);
610 __swab16s (&op->op_niob_cnt);
611 /* ignore op__padding */
612 __swab32s (&op->op_block_cnt);
615 void lustre_swab_ptlbd_niob (struct ptlbd_niob *n)
617 __swab64s (&n->n_xid);
618 __swab64s (&n->n_block_nr);
619 __swab32s (&n->n_offset);
620 __swab32s (&n->n_length);
623 void lustre_swab_ptlbd_rsp (struct ptlbd_rsp *r)
625 __swab16s (&r->r_status);
626 __swab16s (&r->r_error_cnt);
629 /* no one calls this */
630 int llog_log_swabbed(struct llog_log_hdr *hdr)
632 if (hdr->llh_hdr.lrh_type == __swab32(LLOG_HDR_MAGIC))
634 if (hdr->llh_hdr.lrh_type == LLOG_HDR_MAGIC)
639 void lustre_swab_llogd_body (struct llogd_body *d)
641 __swab64s (&d->lgd_logid.lgl_oid);
642 __swab64s (&d->lgd_logid.lgl_ogr);
643 __swab32s (&d->lgd_logid.lgl_ogen);
644 __swab32s (&d->lgd_ctxt_idx);
645 __swab32s (&d->lgd_llh_flags);
646 __swab32s (&d->lgd_index);
647 __swab32s (&d->lgd_saved_index);
648 __swab32s (&d->lgd_len);
649 __swab64s (&d->lgd_cur_offset);
652 void lustre_swab_llog_hdr (struct llog_log_hdr *h)
654 __swab32s (&h->llh_hdr.lrh_index);
655 __swab32s (&h->llh_hdr.lrh_len);
656 __swab32s (&h->llh_hdr.lrh_type);
657 __swab64s (&h->llh_timestamp);
658 __swab32s (&h->llh_count);
659 __swab32s (&h->llh_bitmap_offset);
660 __swab32s (&h->llh_flags);
661 __swab32s (&h->llh_tail.lrt_index);
662 __swab32s (&h->llh_tail.lrt_len);
665 void lustre_swab_llogd_conn_body (struct llogd_conn_body *d)
667 __swab64s (&d->lgdc_gen.mnt_cnt);
668 __swab64s (&d->lgdc_gen.conn_cnt);
669 __swab64s (&d->lgdc_logid.lgl_oid);
670 __swab64s (&d->lgdc_logid.lgl_ogr);
671 __swab32s (&d->lgdc_logid.lgl_ogen);
672 __swab32s (&d->lgdc_ctxt_idx);
676 void lustre_assert_wire_constants(void)
678 /* Wire protocol assertions generated by 'wirecheck'
679 * running on Linux schnapps.adilger.int 2.4.22-l32 #4 Thu Jan 8 14:32:57 MST 2004 i686 i686
680 * with gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5) */
684 LASSERT(PTLRPC_MSG_MAGIC == 0x0BD00BD0);
685 LASSERT(PTLRPC_MSG_VERSION == 0x00000003);
686 LASSERT(PTL_RPC_MSG_REQUEST == 4711);
687 LASSERT(PTL_RPC_MSG_ERR == 4712);
688 LASSERT(PTL_RPC_MSG_REPLY == 4713);
689 LASSERT(MSG_LAST_REPLAY == 1);
690 LASSERT(MSG_RESENT == 2);
691 LASSERT(MSG_CONNECT_RECOVERING == 1);
692 LASSERT(MSG_CONNECT_RECONNECT == 2);
693 LASSERT(MSG_CONNECT_REPLAYABLE == 4);
694 LASSERT(OST_REPLY == 0);
695 LASSERT(OST_GETATTR == 1);
696 LASSERT(OST_SETATTR == 2);
697 LASSERT(OST_READ == 3);
698 LASSERT(OST_WRITE == 4);
699 LASSERT(OST_CREATE == 5);
700 LASSERT(OST_DESTROY == 6);
701 LASSERT(OST_GET_INFO == 7);
702 LASSERT(OST_CONNECT == 8);
703 LASSERT(OST_DISCONNECT == 9);
704 LASSERT(OST_PUNCH == 10);
705 LASSERT(OST_OPEN == 11);
706 LASSERT(OST_CLOSE == 12);
707 LASSERT(OST_STATFS == 13);
708 LASSERT(OST_SAN_READ == 14);
709 LASSERT(OST_SAN_WRITE == 15);
710 LASSERT(OST_SYNC == 16);
711 LASSERT(OST_LAST_OPC == 18);
712 LASSERT(OBD_OBJECT_EOF == 0xffffffffffffffffULL);
713 LASSERT(OST_REQ_HAS_OA1 == 1);
714 LASSERT(MDS_GETATTR == 33);
715 LASSERT(MDS_GETATTR_NAME == 34);
716 LASSERT(MDS_CLOSE == 35);
717 LASSERT(MDS_REINT == 36);
718 LASSERT(MDS_READPAGE == 37);
719 LASSERT(MDS_CONNECT == 38);
720 LASSERT(MDS_DISCONNECT == 39);
721 LASSERT(MDS_GETSTATUS == 40);
722 LASSERT(MDS_STATFS == 41);
723 LASSERT(MDS_PIN == 42);
724 LASSERT(MDS_UNPIN == 43);
725 LASSERT(MDS_SYNC == 44);
726 LASSERT(MDS_DONE_WRITING == 45);
727 LASSERT(MDS_LAST_OPC == 46);
728 LASSERT(REINT_SETATTR == 1);
729 LASSERT(REINT_CREATE == 2);
730 LASSERT(REINT_LINK == 3);
731 LASSERT(REINT_UNLINK == 4);
732 LASSERT(REINT_RENAME == 5);
733 LASSERT(REINT_OPEN == 6);
734 LASSERT(REINT_MAX == 6);
735 LASSERT(DISP_IT_EXECD == 1);
736 LASSERT(DISP_LOOKUP_EXECD == 2);
737 LASSERT(DISP_LOOKUP_NEG == 4);
738 LASSERT(DISP_LOOKUP_POS == 8);
739 LASSERT(DISP_OPEN_CREATE == 16);
740 LASSERT(DISP_OPEN_OPEN == 32);
741 LASSERT(MDS_STATUS_CONN == 1);
742 LASSERT(MDS_STATUS_LOV == 2);
743 LASSERT(MDS_OPEN_HAS_EA == 1073741824);
744 LASSERT(LDLM_ENQUEUE == 101);
745 LASSERT(LDLM_CONVERT == 102);
746 LASSERT(LDLM_CANCEL == 103);
747 LASSERT(LDLM_BL_CALLBACK == 104);
748 LASSERT(LDLM_CP_CALLBACK == 105);
749 LASSERT(LDLM_LAST_OPC == 106);
750 LASSERT(LCK_EX == 1);
751 LASSERT(LCK_PW == 2);
752 LASSERT(LCK_PR == 3);
753 LASSERT(LCK_CW == 4);
754 LASSERT(LCK_CR == 5);
755 LASSERT(LCK_NL == 6);
756 LASSERT(PTLBD_QUERY == 200);
757 LASSERT(PTLBD_READ == 201);
758 LASSERT(PTLBD_WRITE == 202);
759 LASSERT(PTLBD_FLUSH == 203);
760 LASSERT(PTLBD_CONNECT == 204);
761 LASSERT(PTLBD_DISCONNECT == 205);
762 LASSERT(PTLBD_LAST_OPC == 206);
763 LASSERT(MGMT_CONNECT == 250);
764 LASSERT(MGMT_DISCONNECT == 251);
765 LASSERT(MGMT_EXCEPTION == 252);
766 LASSERT(OBD_PING == 400);
767 LASSERT(OBD_LOG_CANCEL == 401);
768 LASSERT(OBD_LAST_OPC == 402);
769 /* Sizes and Offsets */
772 /* Checks for struct lustre_handle */
773 LASSERT((int)sizeof(struct lustre_handle) == 8);
774 LASSERT(offsetof(struct lustre_handle, cookie) == 0);
775 LASSERT((int)sizeof(((struct lustre_handle *)0)->cookie) == 8);
777 /* Checks for struct lustre_msg */
778 LASSERT((int)sizeof(struct lustre_msg) == 64);
779 LASSERT(offsetof(struct lustre_msg, handle) == 0);
780 LASSERT((int)sizeof(((struct lustre_msg *)0)->handle) == 8);
781 LASSERT(offsetof(struct lustre_msg, magic) == 8);
782 LASSERT((int)sizeof(((struct lustre_msg *)0)->magic) == 4);
783 LASSERT(offsetof(struct lustre_msg, type) == 12);
784 LASSERT((int)sizeof(((struct lustre_msg *)0)->type) == 4);
785 LASSERT(offsetof(struct lustre_msg, version) == 16);
786 LASSERT((int)sizeof(((struct lustre_msg *)0)->version) == 4);
787 LASSERT(offsetof(struct lustre_msg, opc) == 20);
788 LASSERT((int)sizeof(((struct lustre_msg *)0)->opc) == 4);
789 LASSERT(offsetof(struct lustre_msg, last_xid) == 24);
790 LASSERT((int)sizeof(((struct lustre_msg *)0)->last_xid) == 8);
791 LASSERT(offsetof(struct lustre_msg, last_committed) == 32);
792 LASSERT((int)sizeof(((struct lustre_msg *)0)->last_committed) == 8);
793 LASSERT(offsetof(struct lustre_msg, transno) == 40);
794 LASSERT((int)sizeof(((struct lustre_msg *)0)->transno) == 8);
795 LASSERT(offsetof(struct lustre_msg, status) == 48);
796 LASSERT((int)sizeof(((struct lustre_msg *)0)->status) == 4);
797 LASSERT(offsetof(struct lustre_msg, flags) == 52);
798 LASSERT((int)sizeof(((struct lustre_msg *)0)->flags) == 4);
799 LASSERT(offsetof(struct lustre_msg, bufcount) == 60);
800 LASSERT((int)sizeof(((struct lustre_msg *)0)->bufcount) == 4);
801 LASSERT(offsetof(struct lustre_msg, buflens[7]) == 92);
802 LASSERT((int)sizeof(((struct lustre_msg *)0)->buflens[7]) == 4);
804 /* Checks for struct obdo */
805 LASSERT((int)sizeof(struct obdo) == 168);
806 LASSERT(offsetof(struct obdo, o_id) == 0);
807 LASSERT((int)sizeof(((struct obdo *)0)->o_id) == 8);
808 LASSERT(offsetof(struct obdo, o_gr) == 8);
809 LASSERT((int)sizeof(((struct obdo *)0)->o_gr) == 8);
810 LASSERT(offsetof(struct obdo, o_atime) == 16);
811 LASSERT((int)sizeof(((struct obdo *)0)->o_atime) == 8);
812 LASSERT(offsetof(struct obdo, o_mtime) == 24);
813 LASSERT((int)sizeof(((struct obdo *)0)->o_mtime) == 8);
814 LASSERT(offsetof(struct obdo, o_ctime) == 32);
815 LASSERT((int)sizeof(((struct obdo *)0)->o_ctime) == 8);
816 LASSERT(offsetof(struct obdo, o_size) == 40);
817 LASSERT((int)sizeof(((struct obdo *)0)->o_size) == 8);
818 LASSERT(offsetof(struct obdo, o_blocks) == 48);
819 LASSERT((int)sizeof(((struct obdo *)0)->o_blocks) == 8);
820 LASSERT(offsetof(struct obdo, o_grant) == 56);
821 LASSERT((int)sizeof(((struct obdo *)0)->o_grant) == 8);
822 LASSERT(offsetof(struct obdo, o_blksize) == 64);
823 LASSERT((int)sizeof(((struct obdo *)0)->o_blksize) == 4);
824 LASSERT(offsetof(struct obdo, o_mode) == 68);
825 LASSERT((int)sizeof(((struct obdo *)0)->o_mode) == 4);
826 LASSERT(offsetof(struct obdo, o_uid) == 72);
827 LASSERT((int)sizeof(((struct obdo *)0)->o_uid) == 4);
828 LASSERT(offsetof(struct obdo, o_gid) == 76);
829 LASSERT((int)sizeof(((struct obdo *)0)->o_gid) == 4);
830 LASSERT(offsetof(struct obdo, o_flags) == 80);
831 LASSERT((int)sizeof(((struct obdo *)0)->o_flags) == 4);
832 LASSERT(offsetof(struct obdo, o_nlink) == 84);
833 LASSERT((int)sizeof(((struct obdo *)0)->o_nlink) == 4);
834 LASSERT(offsetof(struct obdo, o_generation) == 88);
835 LASSERT((int)sizeof(((struct obdo *)0)->o_generation) == 4);
836 LASSERT(offsetof(struct obdo, o_valid) == 92);
837 LASSERT((int)sizeof(((struct obdo *)0)->o_valid) == 4);
838 LASSERT(offsetof(struct obdo, o_misc) == 96);
839 LASSERT((int)sizeof(((struct obdo *)0)->o_misc) == 4);
840 LASSERT(offsetof(struct obdo, o_easize) == 100);
841 LASSERT((int)sizeof(((struct obdo *)0)->o_easize) == 4);
842 LASSERT(offsetof(struct obdo, o_inline) == 104);
843 LASSERT((int)sizeof(((struct obdo *)0)->o_inline) == 64);
844 LASSERT(OBD_MD_FLID == 1);
845 LASSERT(OBD_MD_FLATIME == 2);
846 LASSERT(OBD_MD_FLMTIME == 4);
847 LASSERT(OBD_MD_FLCTIME == 8);
848 LASSERT(OBD_MD_FLSIZE == 16);
849 LASSERT(OBD_MD_FLBLOCKS == 32);
850 LASSERT(OBD_MD_FLBLKSZ == 64);
851 LASSERT(OBD_MD_FLMODE == 128);
852 LASSERT(OBD_MD_FLTYPE == 256);
853 LASSERT(OBD_MD_FLUID == 512);
854 LASSERT(OBD_MD_FLGID == 1024);
855 LASSERT(OBD_MD_FLFLAGS == 2048);
856 LASSERT(OBD_MD_FLNLINK == 8192);
857 LASSERT(OBD_MD_FLGENER == 16384);
858 LASSERT(OBD_MD_FLINLINE == 32768);
859 LASSERT(OBD_MD_FLRDEV == 65536);
860 LASSERT(OBD_MD_FLEASIZE == 131072);
861 LASSERT(OBD_MD_LINKNAME == 262144);
862 LASSERT(OBD_MD_FLHANDLE == 524288);
863 LASSERT(OBD_MD_FLCKSUM == 1048576);
864 LASSERT(OBD_MD_FLQOS == 2097152);
865 LASSERT(OBD_MD_FLOSCOPQ == 4194304);
866 LASSERT(OBD_MD_FLCOOKIE == 8388608);
867 LASSERT(OBD_MD_FLGROUP == 16777216);
868 LASSERT(OBD_FL_INLINEDATA == 1);
869 LASSERT(OBD_FL_OBDMDEXISTS == 2);
870 LASSERT(OBD_FL_DELORPHAN == 4);
871 LASSERT(OBD_FL_NORPC == 8);
872 LASSERT(OBD_FL_IDONLY == 16);
873 LASSERT(OBD_FL_RECREATE_OBJS == 32);
875 /* Checks for struct lov_mds_md_v1 */
876 LASSERT((int)sizeof(struct lov_mds_md_v1) == 32);
877 LASSERT(offsetof(struct lov_mds_md_v1, lmm_magic) == 0);
878 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_magic) == 4);
879 LASSERT(offsetof(struct lov_mds_md_v1, lmm_pattern) == 4);
880 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_pattern) == 4);
881 LASSERT(offsetof(struct lov_mds_md_v1, lmm_object_id) == 8);
882 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id) == 8);
883 LASSERT(offsetof(struct lov_mds_md_v1, lmm_object_gr) == 16);
884 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr) == 8);
885 LASSERT(offsetof(struct lov_mds_md_v1, lmm_stripe_size) == 24);
886 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size) == 4);
887 LASSERT(offsetof(struct lov_mds_md_v1, lmm_stripe_count) == 28);
888 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count) == 4);
889 LASSERT(offsetof(struct lov_mds_md_v1, lmm_objects) == 32);
890 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_objects) == 0);
892 /* Checks for struct lov_ost_data_v1 */
893 LASSERT((int)sizeof(struct lov_ost_data_v1) == 24);
894 LASSERT(offsetof(struct lov_ost_data_v1, l_object_id) == 0);
895 LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id) == 8);
896 LASSERT(offsetof(struct lov_ost_data_v1, l_object_gr) == 8);
897 LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr) == 8);
898 LASSERT(offsetof(struct lov_ost_data_v1, l_ost_gen) == 16);
899 LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4);
900 LASSERT(offsetof(struct lov_ost_data_v1, l_ost_idx) == 20);
901 LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_idx) == 4);
902 LASSERT(LOV_MAGIC_V0 == 198183888);
903 LASSERT(LOV_MAGIC_V1 == 198249424);
904 LASSERT(LOV_PATTERN_RAID0 == 1);
905 LASSERT(LOV_PATTERN_RAID1 == 2);
907 /* Checks for struct obd_statfs */
908 LASSERT((int)sizeof(struct obd_statfs) == 144);
909 LASSERT(offsetof(struct obd_statfs, os_type) == 0);
910 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_type) == 8);
911 LASSERT(offsetof(struct obd_statfs, os_blocks) == 8);
912 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_blocks) == 8);
913 LASSERT(offsetof(struct obd_statfs, os_bfree) == 16);
914 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_bfree) == 8);
915 LASSERT(offsetof(struct obd_statfs, os_bavail) == 24);
916 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_bavail) == 8);
917 LASSERT(offsetof(struct obd_statfs, os_ffree) == 40);
918 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_ffree) == 8);
919 LASSERT(offsetof(struct obd_statfs, os_fsid) == 48);
920 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_fsid) == 40);
921 LASSERT(offsetof(struct obd_statfs, os_bsize) == 88);
922 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_bsize) == 4);
923 LASSERT(offsetof(struct obd_statfs, os_namelen) == 92);
924 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_namelen) == 4);
925 LASSERT(offsetof(struct obd_statfs, os_spare) == 104);
926 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_spare) == 40);
928 /* Checks for struct obd_ioobj */
929 LASSERT((int)sizeof(struct obd_ioobj) == 24);
930 LASSERT(offsetof(struct obd_ioobj, ioo_id) == 0);
931 LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_id) == 8);
932 LASSERT(offsetof(struct obd_ioobj, ioo_gr) == 8);
933 LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_gr) == 8);
934 LASSERT(offsetof(struct obd_ioobj, ioo_type) == 16);
935 LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_type) == 4);
936 LASSERT(offsetof(struct obd_ioobj, ioo_bufcnt) == 20);
937 LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt) == 4);
939 /* Checks for struct niobuf_remote */
940 LASSERT((int)sizeof(struct niobuf_remote) == 16);
941 LASSERT(offsetof(struct niobuf_remote, offset) == 0);
942 LASSERT((int)sizeof(((struct niobuf_remote *)0)->offset) == 8);
943 LASSERT(offsetof(struct niobuf_remote, len) == 8);
944 LASSERT((int)sizeof(((struct niobuf_remote *)0)->len) == 4);
945 LASSERT(offsetof(struct niobuf_remote, flags) == 12);
946 LASSERT((int)sizeof(((struct niobuf_remote *)0)->flags) == 4);
947 LASSERT(OBD_BRW_READ == 1);
948 LASSERT(OBD_BRW_WRITE == 2);
949 LASSERT(OBD_BRW_SYNC == 8);
950 LASSERT(OBD_BRW_FROM_GRANT == 32);
952 /* Checks for struct ost_body */
953 LASSERT((int)sizeof(struct ost_body) == 168);
954 LASSERT(offsetof(struct ost_body, oa) == 0);
955 LASSERT((int)sizeof(((struct ost_body *)0)->oa) == 168);
957 /* Checks for struct ll_fid */
958 LASSERT((int)sizeof(struct ll_fid) == 16);
959 LASSERT(offsetof(struct ll_fid, id) == 0);
960 LASSERT((int)sizeof(((struct ll_fid *)0)->id) == 8);
961 LASSERT(offsetof(struct ll_fid, generation) == 8);
962 LASSERT((int)sizeof(((struct ll_fid *)0)->generation) == 4);
963 LASSERT(offsetof(struct ll_fid, f_type) == 12);
964 LASSERT((int)sizeof(((struct ll_fid *)0)->f_type) == 4);
966 /* Checks for struct mds_status_req */
967 LASSERT((int)sizeof(struct mds_status_req) == 8);
968 LASSERT(offsetof(struct mds_status_req, flags) == 0);
969 LASSERT((int)sizeof(((struct mds_status_req *)0)->flags) == 4);
970 LASSERT(offsetof(struct mds_status_req, repbuf) == 4);
971 LASSERT((int)sizeof(((struct mds_status_req *)0)->repbuf) == 4);
973 /* Checks for struct mds_body */
974 LASSERT((int)sizeof(struct mds_body) == 136);
975 LASSERT(offsetof(struct mds_body, fid1) == 0);
976 LASSERT((int)sizeof(((struct mds_body *)0)->fid1) == 16);
977 LASSERT(offsetof(struct mds_body, fid2) == 16);
978 LASSERT((int)sizeof(((struct mds_body *)0)->fid2) == 16);
979 LASSERT(offsetof(struct mds_body, handle) == 32);
980 LASSERT((int)sizeof(((struct mds_body *)0)->handle) == 8);
981 LASSERT(offsetof(struct mds_body, size) == 40);
982 LASSERT((int)sizeof(((struct mds_body *)0)->size) == 8);
983 LASSERT(offsetof(struct mds_body, blocks) == 48);
984 LASSERT((int)sizeof(((struct mds_body *)0)->blocks) == 8);
985 LASSERT(offsetof(struct mds_body, io_epoch) == 56);
986 LASSERT((int)sizeof(((struct mds_body *)0)->io_epoch) == 8);
987 LASSERT(offsetof(struct mds_body, ino) == 64);
988 LASSERT((int)sizeof(((struct mds_body *)0)->ino) == 4);
989 LASSERT(offsetof(struct mds_body, valid) == 68);
990 LASSERT((int)sizeof(((struct mds_body *)0)->valid) == 4);
991 LASSERT(offsetof(struct mds_body, fsuid) == 72);
992 LASSERT((int)sizeof(((struct mds_body *)0)->fsuid) == 4);
993 LASSERT(offsetof(struct mds_body, fsgid) == 76);
994 LASSERT((int)sizeof(((struct mds_body *)0)->fsgid) == 4);
995 LASSERT(offsetof(struct mds_body, capability) == 80);
996 LASSERT((int)sizeof(((struct mds_body *)0)->capability) == 4);
997 LASSERT(offsetof(struct mds_body, mode) == 84);
998 LASSERT((int)sizeof(((struct mds_body *)0)->mode) == 4);
999 LASSERT(offsetof(struct mds_body, uid) == 88);
1000 LASSERT((int)sizeof(((struct mds_body *)0)->uid) == 4);
1001 LASSERT(offsetof(struct mds_body, gid) == 92);
1002 LASSERT((int)sizeof(((struct mds_body *)0)->gid) == 4);
1003 LASSERT(offsetof(struct mds_body, mtime) == 96);
1004 LASSERT((int)sizeof(((struct mds_body *)0)->mtime) == 4);
1005 LASSERT(offsetof(struct mds_body, ctime) == 100);
1006 LASSERT((int)sizeof(((struct mds_body *)0)->ctime) == 4);
1007 LASSERT(offsetof(struct mds_body, atime) == 104);
1008 LASSERT((int)sizeof(((struct mds_body *)0)->atime) == 4);
1009 LASSERT(offsetof(struct mds_body, flags) == 108);
1010 LASSERT((int)sizeof(((struct mds_body *)0)->flags) == 4);
1011 LASSERT(offsetof(struct mds_body, rdev) == 112);
1012 LASSERT((int)sizeof(((struct mds_body *)0)->rdev) == 4);
1013 LASSERT(offsetof(struct mds_body, nlink) == 116);
1014 LASSERT((int)sizeof(((struct mds_body *)0)->nlink) == 4);
1015 LASSERT(offsetof(struct mds_body, generation) == 120);
1016 LASSERT((int)sizeof(((struct mds_body *)0)->generation) == 4);
1017 LASSERT(offsetof(struct mds_body, suppgid) == 124);
1018 LASSERT((int)sizeof(((struct mds_body *)0)->suppgid) == 4);
1019 LASSERT(offsetof(struct mds_body, eadatasize) == 128);
1020 LASSERT((int)sizeof(((struct mds_body *)0)->eadatasize) == 4);
1021 LASSERT(FMODE_READ == 1);
1022 LASSERT(FMODE_WRITE == 2);
1023 LASSERT(FMODE_EXEC == 4);
1024 LASSERT(MDS_OPEN_CREAT == 64);
1025 LASSERT(MDS_OPEN_EXCL == 128);
1026 LASSERT(MDS_OPEN_TRUNC == 512);
1027 LASSERT(MDS_OPEN_APPEND == 1024);
1028 LASSERT(MDS_OPEN_SYNC == 4096);
1029 LASSERT(MDS_OPEN_DIRECTORY == 65536);
1030 LASSERT(MDS_OPEN_DELAY_CREATE == 16777216);
1031 LASSERT(MDS_OPEN_HAS_EA == 1073741824);
1033 /* Checks for struct mds_rec_setattr */
1034 LASSERT((int)sizeof(struct mds_rec_setattr) == 88);
1035 LASSERT(offsetof(struct mds_rec_setattr, sa_opcode) == 0);
1036 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_opcode) == 4);
1037 LASSERT(offsetof(struct mds_rec_setattr, sa_fsuid) == 4);
1038 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_fsuid) == 4);
1039 LASSERT(offsetof(struct mds_rec_setattr, sa_fsgid) == 8);
1040 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_fsgid) == 4);
1041 LASSERT(offsetof(struct mds_rec_setattr, sa_cap) == 12);
1042 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_cap) == 4);
1043 LASSERT(offsetof(struct mds_rec_setattr, sa_suppgid) == 16);
1044 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_suppgid) == 4);
1045 LASSERT(offsetof(struct mds_rec_setattr, sa_valid) == 20);
1046 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_valid) == 4);
1047 LASSERT(offsetof(struct mds_rec_setattr, sa_fid) == 24);
1048 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_fid) == 16);
1049 LASSERT(offsetof(struct mds_rec_setattr, sa_mode) == 40);
1050 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_mode) == 4);
1051 LASSERT(offsetof(struct mds_rec_setattr, sa_uid) == 44);
1052 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_uid) == 4);
1053 LASSERT(offsetof(struct mds_rec_setattr, sa_gid) == 48);
1054 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_gid) == 4);
1055 LASSERT(offsetof(struct mds_rec_setattr, sa_attr_flags) == 52);
1056 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags) == 4);
1057 LASSERT(offsetof(struct mds_rec_setattr, sa_size) == 56);
1058 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_size) == 8);
1059 LASSERT(offsetof(struct mds_rec_setattr, sa_atime) == 64);
1060 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_atime) == 8);
1061 LASSERT(offsetof(struct mds_rec_setattr, sa_mtime) == 72);
1062 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_mtime) == 8);
1063 LASSERT(offsetof(struct mds_rec_setattr, sa_ctime) == 80);
1064 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_ctime) == 8);
1066 /* Checks for struct mds_rec_create */
1067 LASSERT((int)sizeof(struct mds_rec_create) == 80);
1068 LASSERT(offsetof(struct mds_rec_create, cr_opcode) == 0);
1069 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_opcode) == 4);
1070 LASSERT(offsetof(struct mds_rec_create, cr_fsuid) == 4);
1071 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_fsuid) == 4);
1072 LASSERT(offsetof(struct mds_rec_create, cr_fsgid) == 8);
1073 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_fsgid) == 4);
1074 LASSERT(offsetof(struct mds_rec_create, cr_cap) == 12);
1075 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_cap) == 4);
1076 LASSERT(offsetof(struct mds_rec_create, cr_flags) == 16);
1077 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_flags) == 4);
1078 LASSERT(offsetof(struct mds_rec_create, cr_mode) == 20);
1079 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_mode) == 4);
1080 LASSERT(offsetof(struct mds_rec_create, cr_fid) == 24);
1081 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_fid) == 16);
1082 LASSERT(offsetof(struct mds_rec_create, cr_replayfid) == 40);
1083 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_replayfid) == 16);
1084 LASSERT(offsetof(struct mds_rec_create, cr_time) == 56);
1085 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_time) == 8);
1086 LASSERT(offsetof(struct mds_rec_create, cr_rdev) == 64);
1087 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_rdev) == 8);
1088 LASSERT(offsetof(struct mds_rec_create, cr_suppgid) == 72);
1089 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_suppgid) == 4);
1091 /* Checks for struct mds_rec_link */
1092 LASSERT((int)sizeof(struct mds_rec_link) == 64);
1093 LASSERT(offsetof(struct mds_rec_link, lk_opcode) == 0);
1094 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_opcode) == 4);
1095 LASSERT(offsetof(struct mds_rec_link, lk_fsuid) == 4);
1096 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fsuid) == 4);
1097 LASSERT(offsetof(struct mds_rec_link, lk_fsgid) == 8);
1098 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fsgid) == 4);
1099 LASSERT(offsetof(struct mds_rec_link, lk_cap) == 12);
1100 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_cap) == 4);
1101 LASSERT(offsetof(struct mds_rec_link, lk_suppgid1) == 16);
1102 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_suppgid1) == 4);
1103 LASSERT(offsetof(struct mds_rec_link, lk_suppgid2) == 20);
1104 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_suppgid2) == 4);
1105 LASSERT(offsetof(struct mds_rec_link, lk_fid1) == 24);
1106 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fid1) == 16);
1107 LASSERT(offsetof(struct mds_rec_link, lk_fid2) == 40);
1108 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fid2) == 16);
1109 LASSERT(offsetof(struct mds_rec_link, lk_time) == 56);
1110 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_time) == 8);
1112 /* Checks for struct mds_rec_unlink */
1113 LASSERT((int)sizeof(struct mds_rec_unlink) == 64);
1114 LASSERT(offsetof(struct mds_rec_unlink, ul_opcode) == 0);
1115 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_opcode) == 4);
1116 LASSERT(offsetof(struct mds_rec_unlink, ul_fsuid) == 4);
1117 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fsuid) == 4);
1118 LASSERT(offsetof(struct mds_rec_unlink, ul_fsgid) == 8);
1119 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fsgid) == 4);
1120 LASSERT(offsetof(struct mds_rec_unlink, ul_cap) == 12);
1121 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_cap) == 4);
1122 LASSERT(offsetof(struct mds_rec_unlink, ul_suppgid) == 16);
1123 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_suppgid) == 4);
1124 LASSERT(offsetof(struct mds_rec_unlink, ul_mode) == 20);
1125 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_mode) == 4);
1126 LASSERT(offsetof(struct mds_rec_unlink, ul_fid1) == 24);
1127 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fid1) == 16);
1128 LASSERT(offsetof(struct mds_rec_unlink, ul_fid2) == 40);
1129 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fid2) == 16);
1130 LASSERT(offsetof(struct mds_rec_unlink, ul_time) == 56);
1131 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_time) == 8);
1133 /* Checks for struct mds_rec_rename */
1134 LASSERT((int)sizeof(struct mds_rec_rename) == 64);
1135 LASSERT(offsetof(struct mds_rec_rename, rn_opcode) == 0);
1136 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_opcode) == 4);
1137 LASSERT(offsetof(struct mds_rec_rename, rn_fsuid) == 4);
1138 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fsuid) == 4);
1139 LASSERT(offsetof(struct mds_rec_rename, rn_fsgid) == 8);
1140 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fsgid) == 4);
1141 LASSERT(offsetof(struct mds_rec_rename, rn_cap) == 12);
1142 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_cap) == 4);
1143 LASSERT(offsetof(struct mds_rec_rename, rn_suppgid1) == 16);
1144 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_suppgid1) == 4);
1145 LASSERT(offsetof(struct mds_rec_rename, rn_suppgid2) == 20);
1146 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_suppgid2) == 4);
1147 LASSERT(offsetof(struct mds_rec_rename, rn_fid1) == 24);
1148 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fid1) == 16);
1149 LASSERT(offsetof(struct mds_rec_rename, rn_fid2) == 40);
1150 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fid2) == 16);
1151 LASSERT(offsetof(struct mds_rec_rename, rn_time) == 56);
1152 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_time) == 8);
1154 /* Checks for struct lov_desc */
1155 LASSERT((int)sizeof(struct lov_desc) == 72);
1156 LASSERT(offsetof(struct lov_desc, ld_tgt_count) == 0);
1157 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_tgt_count) == 4);
1158 LASSERT(offsetof(struct lov_desc, ld_active_tgt_count) == 4);
1159 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_active_tgt_count) == 4);
1160 LASSERT(offsetof(struct lov_desc, ld_default_stripe_count) == 8);
1161 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_count) == 4);
1162 LASSERT(offsetof(struct lov_desc, ld_pattern) == 12);
1163 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_pattern) == 4);
1164 LASSERT(offsetof(struct lov_desc, ld_default_stripe_size) == 16);
1165 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_size) == 8);
1166 LASSERT(offsetof(struct lov_desc, ld_default_stripe_offset) == 24);
1167 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_offset) == 8);
1168 LASSERT(offsetof(struct lov_desc, ld_uuid) == 32);
1169 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_uuid) == 40);
1171 /* Checks for struct ldlm_res_id */
1172 LASSERT((int)sizeof(struct ldlm_res_id) == 32);
1173 LASSERT(offsetof(struct ldlm_res_id, name[4]) == 32);
1174 LASSERT((int)sizeof(((struct ldlm_res_id *)0)->name[4]) == 8);
1176 /* Checks for struct ldlm_extent */
1177 LASSERT((int)sizeof(struct ldlm_extent) == 16);
1178 LASSERT(offsetof(struct ldlm_extent, start) == 0);
1179 LASSERT((int)sizeof(((struct ldlm_extent *)0)->start) == 8);
1180 LASSERT(offsetof(struct ldlm_extent, end) == 8);
1181 LASSERT((int)sizeof(((struct ldlm_extent *)0)->end) == 8);
1183 /* Checks for struct ldlm_flock */
1184 LASSERT((int)sizeof(struct ldlm_flock) == 32);
1185 LASSERT(offsetof(struct ldlm_flock, start) == 0);
1186 LASSERT((int)sizeof(((struct ldlm_flock *)0)->start) == 8);
1187 LASSERT(offsetof(struct ldlm_flock, end) == 8);
1188 LASSERT((int)sizeof(((struct ldlm_flock *)0)->end) == 8);
1189 LASSERT(offsetof(struct ldlm_flock, blocking_export) == 16);
1190 LASSERT((int)sizeof(((struct ldlm_flock *)0)->blocking_export) == 8);
1191 LASSERT(offsetof(struct ldlm_flock, blocking_pid) == 24);
1192 LASSERT((int)sizeof(((struct ldlm_flock *)0)->blocking_pid) == 4);
1193 LASSERT(offsetof(struct ldlm_flock, pid) == 28);
1194 LASSERT((int)sizeof(((struct ldlm_flock *)0)->pid) == 4);
1196 /* Checks for struct ldlm_intent */
1197 LASSERT((int)sizeof(struct ldlm_intent) == 8);
1198 LASSERT(offsetof(struct ldlm_intent, opc) == 0);
1199 LASSERT((int)sizeof(((struct ldlm_intent *)0)->opc) == 8);
1201 /* Checks for struct ldlm_resource_desc */
1202 LASSERT((int)sizeof(struct ldlm_resource_desc) == 52);
1203 LASSERT(offsetof(struct ldlm_resource_desc, lr_type) == 0);
1204 LASSERT((int)sizeof(((struct ldlm_resource_desc *)0)->lr_type) == 4);
1205 LASSERT(offsetof(struct ldlm_resource_desc, lr_name) == 4);
1206 LASSERT((int)sizeof(((struct ldlm_resource_desc *)0)->lr_name) == 32);
1207 LASSERT(offsetof(struct ldlm_resource_desc, lr_version[4]) == 52);
1208 LASSERT((int)sizeof(((struct ldlm_resource_desc *)0)->lr_version[4]) == 4);
1210 /* Checks for struct ldlm_lock_desc */
1211 LASSERT((int)sizeof(struct ldlm_lock_desc) == 108);
1212 LASSERT(offsetof(struct ldlm_lock_desc, l_resource) == 0);
1213 LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_resource) == 52);
1214 LASSERT(offsetof(struct ldlm_lock_desc, l_req_mode) == 52);
1215 LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_req_mode) == 4);
1216 LASSERT(offsetof(struct ldlm_lock_desc, l_granted_mode) == 56);
1217 LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_granted_mode) == 4);
1218 LASSERT(offsetof(struct ldlm_lock_desc, l_policy_data) == 60);
1219 LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_policy_data) == 32);
1220 LASSERT(offsetof(struct ldlm_lock_desc, l_version[4]) == 108);
1221 LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_version[4]) == 4);
1223 /* Checks for struct ldlm_request */
1224 LASSERT((int)sizeof(struct ldlm_request) == 128);
1225 LASSERT(offsetof(struct ldlm_request, lock_flags) == 0);
1226 LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_flags) == 4);
1227 LASSERT(offsetof(struct ldlm_request, lock_desc) == 4);
1228 LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_desc) == 108);
1229 LASSERT(offsetof(struct ldlm_request, lock_handle1) == 112);
1230 LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_handle1) == 8);
1231 LASSERT(offsetof(struct ldlm_request, lock_handle2) == 120);
1232 LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_handle2) == 8);
1234 /* Checks for struct ldlm_reply */
1235 LASSERT((int)sizeof(struct ldlm_reply) == 96);
1236 LASSERT(offsetof(struct ldlm_reply, lock_flags) == 0);
1237 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_flags) == 4);
1238 LASSERT(offsetof(struct ldlm_reply, lock_mode) == 4);
1239 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_mode) == 4);
1240 LASSERT(offsetof(struct ldlm_reply, lock_resource_name) == 8);
1241 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_resource_name) == 32);
1242 LASSERT(offsetof(struct ldlm_reply, lock_handle) == 40);
1243 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_handle) == 8);
1244 LASSERT(offsetof(struct ldlm_reply, lock_policy_data) == 48);
1245 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_policy_data) == 32);
1246 LASSERT(offsetof(struct ldlm_reply, lock_policy_res1) == 80);
1247 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res1) == 8);
1248 LASSERT(offsetof(struct ldlm_reply, lock_policy_res2) == 88);
1249 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res2) == 8);
1251 /* Checks for struct ptlbd_op */
1252 LASSERT((int)sizeof(struct ptlbd_op) == 12);
1253 LASSERT(offsetof(struct ptlbd_op, op_cmd) == 0);
1254 LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_cmd) == 2);
1255 LASSERT(offsetof(struct ptlbd_op, op_lun) == 2);
1256 LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_lun) == 2);
1257 LASSERT(offsetof(struct ptlbd_op, op_niob_cnt) == 4);
1258 LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_niob_cnt) == 2);
1259 LASSERT(offsetof(struct ptlbd_op, op__padding) == 6);
1260 LASSERT((int)sizeof(((struct ptlbd_op *)0)->op__padding) == 2);
1261 LASSERT(offsetof(struct ptlbd_op, op_block_cnt) == 8);
1262 LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_block_cnt) == 4);
1264 /* Checks for struct ptlbd_niob */
1265 LASSERT((int)sizeof(struct ptlbd_niob) == 24);
1266 LASSERT(offsetof(struct ptlbd_niob, n_xid) == 0);
1267 LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_xid) == 8);
1268 LASSERT(offsetof(struct ptlbd_niob, n_block_nr) == 8);
1269 LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_block_nr) == 8);
1270 LASSERT(offsetof(struct ptlbd_niob, n_offset) == 16);
1271 LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_offset) == 4);
1272 LASSERT(offsetof(struct ptlbd_niob, n_length) == 20);
1273 LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_length) == 4);
1275 /* Checks for struct ptlbd_rsp */
1276 LASSERT((int)sizeof(struct ptlbd_rsp) == 4);
1277 LASSERT(offsetof(struct ptlbd_rsp, r_status) == 0);
1278 LASSERT((int)sizeof(((struct ptlbd_rsp *)0)->r_status) == 2);
1279 LASSERT(offsetof(struct ptlbd_rsp, r_error_cnt) == 2);
1280 LASSERT((int)sizeof(((struct ptlbd_rsp *)0)->r_error_cnt) == 2);
1282 /* Checks for struct llog_logid */
1283 LASSERT((int)sizeof(struct llog_logid) == 20);
1284 LASSERT(offsetof(struct llog_logid, lgl_oid) == 0);
1285 LASSERT((int)sizeof(((struct llog_logid *)0)->lgl_oid) == 8);
1286 LASSERT(offsetof(struct llog_logid, lgl_ogr) == 8);
1287 LASSERT((int)sizeof(((struct llog_logid *)0)->lgl_ogr) == 8);
1288 LASSERT(offsetof(struct llog_logid, lgl_ogen) == 16);
1289 LASSERT((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4);
1290 LASSERT(OST_SZ_REC == 274730752);
1291 LASSERT(OST_RAID1_REC == 274731008);
1292 LASSERT(MDS_UNLINK_REC == 274801668);
1293 LASSERT(OBD_CFG_REC == 274857984);
1294 LASSERT(PTL_CFG_REC == 274923520);
1295 LASSERT(LLOG_GEN_REC == 274989056);
1296 LASSERT(LLOG_HDR_MAGIC == 275010873);
1297 LASSERT(LLOG_LOGID_MAGIC == 275010874);
1299 /* Checks for struct llog_rec_hdr */
1300 LASSERT((int)sizeof(struct llog_rec_hdr) == 16);
1301 LASSERT(offsetof(struct llog_rec_hdr, lrh_len) == 0);
1302 LASSERT((int)sizeof(((struct llog_rec_hdr *)0)->lrh_len) == 4);
1303 LASSERT(offsetof(struct llog_rec_hdr, lrh_index) == 4);
1304 LASSERT((int)sizeof(((struct llog_rec_hdr *)0)->lrh_index) == 4);
1305 LASSERT(offsetof(struct llog_rec_hdr, lrh_type) == 8);
1306 LASSERT((int)sizeof(((struct llog_rec_hdr *)0)->lrh_type) == 4);
1308 /* Checks for struct llog_rec_tail */
1309 LASSERT((int)sizeof(struct llog_rec_tail) == 8);
1310 LASSERT(offsetof(struct llog_rec_tail, lrt_len) == 0);
1311 LASSERT((int)sizeof(((struct llog_rec_tail *)0)->lrt_len) == 4);
1312 LASSERT(offsetof(struct llog_rec_tail, lrt_index) == 4);
1313 LASSERT((int)sizeof(((struct llog_rec_tail *)0)->lrt_index) == 4);
1315 /* Checks for struct llog_logid_rec */
1316 LASSERT((int)sizeof(struct llog_logid_rec) == 48);
1317 LASSERT(offsetof(struct llog_logid_rec, lid_hdr) == 0);
1318 LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_hdr) == 16);
1319 LASSERT(offsetof(struct llog_logid_rec, lid_id) == 16);
1320 LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_id) == 20);
1321 LASSERT(offsetof(struct llog_logid_rec, lid_tail) == 40);
1322 LASSERT((int)sizeof(((struct llog_logid_rec *)0)->lid_tail) == 8);
1324 /* Checks for struct llog_create_rec */
1325 LASSERT((int)sizeof(struct llog_create_rec) == 56);
1326 LASSERT(offsetof(struct llog_create_rec, lcr_hdr) == 0);
1327 LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_hdr) == 16);
1328 LASSERT(offsetof(struct llog_create_rec, lcr_fid) == 16);
1329 LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_fid) == 16);
1330 LASSERT(offsetof(struct llog_create_rec, lcr_oid) == 32);
1331 LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_oid) == 8);
1332 LASSERT(offsetof(struct llog_create_rec, lcr_ogen) == 40);
1333 LASSERT((int)sizeof(((struct llog_create_rec *)0)->lcr_ogen) == 4);
1335 /* Checks for struct llog_orphan_rec */
1336 LASSERT((int)sizeof(struct llog_orphan_rec) == 40);
1337 LASSERT(offsetof(struct llog_orphan_rec, lor_hdr) == 0);
1338 LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_hdr) == 16);
1339 LASSERT(offsetof(struct llog_orphan_rec, lor_oid) == 16);
1340 LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_oid) == 8);
1341 LASSERT(offsetof(struct llog_orphan_rec, lor_ogen) == 24);
1342 LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_ogen) == 4);
1343 LASSERT(offsetof(struct llog_orphan_rec, lor_tail) == 32);
1344 LASSERT((int)sizeof(((struct llog_orphan_rec *)0)->lor_tail) == 8);
1346 /* Checks for struct llog_unlink_rec */
1347 LASSERT((int)sizeof(struct llog_unlink_rec) == 40);
1348 LASSERT(offsetof(struct llog_unlink_rec, lur_hdr) == 0);
1349 LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_hdr) == 16);
1350 LASSERT(offsetof(struct llog_unlink_rec, lur_oid) == 16);
1351 LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_oid) == 8);
1352 LASSERT(offsetof(struct llog_unlink_rec, lur_ogen) == 24);
1353 LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_ogen) == 4);
1354 LASSERT(offsetof(struct llog_unlink_rec, lur_tail) == 32);
1355 LASSERT((int)sizeof(((struct llog_unlink_rec *)0)->lur_tail) == 8);
1357 /* Checks for struct llog_size_change_rec */
1358 LASSERT((int)sizeof(struct llog_size_change_rec) == 48);
1359 LASSERT(offsetof(struct llog_size_change_rec, lsc_hdr) == 0);
1360 LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_hdr) == 16);
1361 LASSERT(offsetof(struct llog_size_change_rec, lsc_fid) == 16);
1362 LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_fid) == 16);
1363 LASSERT(offsetof(struct llog_size_change_rec, lsc_io_epoch) == 32);
1364 LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_io_epoch) == 4);
1365 LASSERT(offsetof(struct llog_size_change_rec, lsc_tail) == 40);
1366 LASSERT((int)sizeof(((struct llog_size_change_rec *)0)->lsc_tail) == 8);
1368 /* Checks for struct llog_gen */
1369 LASSERT((int)sizeof(struct llog_gen) == 16);
1370 LASSERT(offsetof(struct llog_gen, mnt_cnt) == 0);
1371 LASSERT((int)sizeof(((struct llog_gen *)0)->mnt_cnt) == 8);
1372 LASSERT(offsetof(struct llog_gen, conn_cnt) == 8);
1373 LASSERT((int)sizeof(((struct llog_gen *)0)->conn_cnt) == 8);
1375 /* Checks for struct llog_gen_rec */
1376 LASSERT((int)sizeof(struct llog_gen_rec) == 40);
1377 LASSERT(offsetof(struct llog_gen_rec, lgr_hdr) == 0);
1378 LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_hdr) == 16);
1379 LASSERT(offsetof(struct llog_gen_rec, lgr_gen) == 16);
1380 LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_gen) == 16);
1381 LASSERT(offsetof(struct llog_gen_rec, lgr_tail) == 32);
1382 LASSERT((int)sizeof(((struct llog_gen_rec *)0)->lgr_tail) == 8);
1384 /* Checks for struct llog_log_hdr */
1385 LASSERT((int)sizeof(struct llog_log_hdr) == 4096);
1386 LASSERT(offsetof(struct llog_log_hdr, llh_hdr) == 0);
1387 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_hdr) == 16);
1388 LASSERT(offsetof(struct llog_log_hdr, llh_timestamp) == 16);
1389 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_timestamp) == 8);
1390 LASSERT(offsetof(struct llog_log_hdr, llh_count) == 24);
1391 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_count) == 4);
1392 LASSERT(offsetof(struct llog_log_hdr, llh_bitmap_offset) == 28);
1393 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap_offset) == 4);
1394 LASSERT(offsetof(struct llog_log_hdr, llh_size) == 32);
1395 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_size) == 4);
1396 LASSERT(offsetof(struct llog_log_hdr, llh_flags) == 36);
1397 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_flags) == 4);
1398 LASSERT(offsetof(struct llog_log_hdr, llh_cat_idx) == 40);
1399 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_cat_idx) == 4);
1400 LASSERT(offsetof(struct llog_log_hdr, llh_tgtuuid) == 44);
1401 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid) == 40);
1402 LASSERT(offsetof(struct llog_log_hdr, llh_reserved) == 84);
1403 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_reserved) == 4);
1404 LASSERT(offsetof(struct llog_log_hdr, llh_bitmap) == 88);
1405 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 4000);
1406 LASSERT(offsetof(struct llog_log_hdr, llh_tail) == 4088);
1407 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_tail) == 8);
1409 /* Checks for struct llog_cookie */
1410 LASSERT((int)sizeof(struct llog_cookie) == 32);
1411 LASSERT(offsetof(struct llog_cookie, lgc_lgl) == 0);
1412 LASSERT((int)sizeof(((struct llog_cookie *)0)->lgc_lgl) == 20);
1413 LASSERT(offsetof(struct llog_cookie, lgc_subsys) == 20);
1414 LASSERT((int)sizeof(((struct llog_cookie *)0)->lgc_subsys) == 4);
1415 LASSERT(offsetof(struct llog_cookie, lgc_index) == 24);
1416 LASSERT((int)sizeof(((struct llog_cookie *)0)->lgc_index) == 4);
1418 /* Checks for struct llogd_body */
1419 LASSERT((int)sizeof(struct llogd_body) == 48);
1420 LASSERT(offsetof(struct llogd_body, lgd_logid) == 0);
1421 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_logid) == 20);
1422 LASSERT(offsetof(struct llogd_body, lgd_ctxt_idx) == 20);
1423 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_ctxt_idx) == 4);
1424 LASSERT(offsetof(struct llogd_body, lgd_llh_flags) == 24);
1425 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_llh_flags) == 4);
1426 LASSERT(offsetof(struct llogd_body, lgd_index) == 28);
1427 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_index) == 4);
1428 LASSERT(offsetof(struct llogd_body, lgd_saved_index) == 32);
1429 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_saved_index) == 4);
1430 LASSERT(offsetof(struct llogd_body, lgd_len) == 36);
1431 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_len) == 4);
1432 LASSERT(offsetof(struct llogd_body, lgd_cur_offset) == 40);
1433 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_cur_offset) == 8);
1434 LASSERT(LLOG_ORIGIN_HANDLE_CREATE == 501);
1435 LASSERT(LLOG_ORIGIN_HANDLE_NEXT_BLOCK == 502);
1436 LASSERT(LLOG_ORIGIN_HANDLE_READ_HEADER == 503);
1437 LASSERT(LLOG_ORIGIN_HANDLE_WRITE_REC == 504);
1438 LASSERT(LLOG_ORIGIN_HANDLE_CLOSE == 505);
1439 LASSERT(LLOG_ORIGIN_CONNECT == 506);
1440 LASSERT(LLOG_CATINFO == 507);
1442 /* Checks for struct llogd_conn_body */
1443 LASSERT((int)sizeof(struct llogd_conn_body) == 40);
1444 LASSERT(offsetof(struct llogd_conn_body, lgdc_gen) == 0);
1445 LASSERT((int)sizeof(((struct llogd_conn_body *)0)->lgdc_gen) == 16);
1446 LASSERT(offsetof(struct llogd_conn_body, lgdc_logid) == 16);
1447 LASSERT((int)sizeof(((struct llogd_conn_body *)0)->lgdc_logid) == 20);
1448 LASSERT(offsetof(struct llogd_conn_body, lgdc_ctxt_idx) == 36);
1449 LASSERT((int)sizeof(((struct llogd_conn_body *)0)->lgdc_ctxt_idx) == 4);
1452 void lustre_assert_wire_constants(void)