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>
36 #include <linux/fcntl.h>
39 #define HDR_SIZE(count) \
40 size_round(offsetof (struct lustre_msg, buflens[(count)]))
42 int lustre_msg_swabbed(struct lustre_msg *msg)
44 return (msg->magic == __swab32(PTLRPC_MSG_MAGIC));
47 int lustre_msg_check_version(struct lustre_msg *msg, __u32 version)
49 if (!lustre_msg_swabbed(msg))
50 return (msg->version & LUSTRE_VERSION_MASK) != version;
52 return (__swab32(msg->version) & LUSTRE_VERSION_MASK) != version;
55 void lustre_init_msg (struct lustre_msg *msg, int count, int *lens, char **bufs)
60 msg->magic = PTLRPC_MSG_MAGIC;
61 msg->version = PTLRPC_MSG_VERSION;
62 msg->bufcount = count;
63 for (i = 0; i < count; i++)
64 msg->buflens[i] = lens[i];
69 ptr = (char *)msg + HDR_SIZE(count);
70 for (i = 0; i < count; i++) {
72 LOGL(tmp, lens[i], ptr);
76 int lustre_pack_request (struct ptlrpc_request *req,
77 int count, int *lens, char **bufs)
81 req->rq_reqlen = lustre_msg_size (count, lens);
82 OBD_ALLOC(req->rq_reqmsg, req->rq_reqlen);
83 if (req->rq_reqmsg == NULL)
86 lustre_init_msg (req->rq_reqmsg, count, lens, bufs);
91 LIST_HEAD(ptlrpc_rs_debug_lru);
92 spinlock_t ptlrpc_rs_debug_lock = SPIN_LOCK_UNLOCKED;
94 #define PTLRPC_RS_DEBUG_LRU_ADD(rs) \
96 unsigned long __flags; \
98 spin_lock_irqsave(&ptlrpc_rs_debug_lock, __flags); \
99 list_add_tail(&(rs)->rs_debug_list, &ptlrpc_rs_debug_lru); \
100 spin_unlock_irqrestore(&ptlrpc_rs_debug_lock, __flags); \
103 #define PTLRPC_RS_DEBUG_LRU_DEL(rs) \
105 unsigned long __flags; \
107 spin_lock_irqsave(&ptlrpc_rs_debug_lock, __flags); \
108 list_del(&(rs)->rs_debug_list); \
109 spin_unlock_irqrestore(&ptlrpc_rs_debug_lock, __flags); \
112 # define PTLRPC_RS_DEBUG_LRU_ADD(rs) do {} while(0)
113 # define PTLRPC_RS_DEBUG_LRU_DEL(rs) do {} while(0)
116 int lustre_pack_reply (struct ptlrpc_request *req,
117 int count, int *lens, char **bufs)
119 struct ptlrpc_reply_state *rs;
124 LASSERT (req->rq_reply_state == NULL);
126 msg_len = lustre_msg_size (count, lens);
127 size = offsetof (struct ptlrpc_reply_state, rs_msg) + msg_len;
128 OBD_ALLOC (rs, size);
132 rs->rs_cb_id.cbid_fn = reply_out_callback;
133 rs->rs_cb_id.cbid_arg = rs;
134 rs->rs_srv_ni = req->rq_rqbd->rqbd_srv_ni;
136 INIT_LIST_HEAD(&rs->rs_exp_list);
137 INIT_LIST_HEAD(&rs->rs_obd_list);
139 req->rq_replen = msg_len;
140 req->rq_reply_state = rs;
141 req->rq_repmsg = &rs->rs_msg;
142 lustre_init_msg (&rs->rs_msg, count, lens, bufs);
144 PTLRPC_RS_DEBUG_LRU_ADD(rs);
149 void lustre_free_reply_state (struct ptlrpc_reply_state *rs)
151 PTLRPC_RS_DEBUG_LRU_DEL(rs);
153 LASSERT (!rs->rs_difficult || rs->rs_handled);
154 LASSERT (!rs->rs_on_net);
155 LASSERT (!rs->rs_scheduled);
156 LASSERT (rs->rs_export == NULL);
157 LASSERT (rs->rs_nlocks == 0);
158 LASSERT (list_empty(&rs->rs_exp_list));
159 LASSERT (list_empty(&rs->rs_obd_list));
161 OBD_FREE (rs, rs->rs_size);
164 /* This returns the size of the buffer that is required to hold a lustre_msg
165 * with the given sub-buffer lengths. */
166 int lustre_msg_size(int count, int *lengths)
171 size = HDR_SIZE (count);
172 for (i = 0; i < count; i++)
173 size += size_round(lengths[i]);
178 int lustre_unpack_msg(struct lustre_msg *m, int len)
185 /* We can provide a slightly better error log, if we check the
186 * message magic and version first. In the future, struct
187 * lustre_msg may grow, and we'd like to log a version mismatch,
188 * rather than a short message.
191 required_len = MAX (offsetof (struct lustre_msg, version) +
193 offsetof (struct lustre_msg, magic) +
195 if (len < required_len) {
196 /* can't even look inside the message */
197 CERROR ("message length %d too small for magic/version check\n",
202 flipped = lustre_msg_swabbed(m);
204 __swab32s (&m->version);
205 else if (m->magic != PTLRPC_MSG_MAGIC) {
206 CERROR("wrong lustre_msg magic %#08x\n", m->magic);
210 if ((m->version & ~LUSTRE_VERSION_MASK) != PTLRPC_MSG_VERSION) {
211 CERROR("wrong lustre_msg version %#08x\n", m->version);
215 /* Now we know the sender speaks my language (but possibly flipped)...*/
216 required_len = HDR_SIZE(0);
217 if (len < required_len) {
218 /* can't even look inside the message */
219 CERROR ("message length %d too small for lustre_msg\n", len);
224 __swab32s (&m->type);
226 __swab64s (&m->last_xid);
227 __swab64s (&m->last_committed);
228 __swab64s (&m->transno);
229 __swab32s (&m->status);
230 __swab32s (&m->bufcount);
231 __swab32s (&m->flags);
234 required_len = HDR_SIZE(m->bufcount);
236 if (len < required_len) {
237 /* didn't receive all the buffer lengths */
238 CERROR ("message length %d too small for %d buflens\n",
243 for (i = 0; i < m->bufcount; i++) {
245 __swab32s (&m->buflens[i]);
246 required_len += size_round(m->buflens[i]);
249 if (len < required_len) {
250 CERROR("len: %d, required_len %d\n", len, required_len);
251 CERROR("bufcount: %d\n", m->bufcount);
252 for (i = 0; i < m->bufcount; i++)
253 CERROR("buffer %d length %d\n", i, m->buflens[i]);
260 void *lustre_msg_buf(struct lustre_msg *m, int n, int min_size)
270 bufcount = m->bufcount;
272 CDEBUG(D_INFO, "msg %p buffer[%d] not present (count %d)\n",
277 buflen = m->buflens[n];
278 if (buflen < min_size) {
279 CERROR("msg %p buffer[%d] size %d too small (required %d)\n",
280 m, n, buflen, min_size);
284 offset = HDR_SIZE(bufcount);
285 for (i = 0; i < n; i++)
286 offset += size_round(m->buflens[i]);
288 return (char *)m + offset;
291 char *lustre_msg_string (struct lustre_msg *m, int index, int max_len)
293 /* max_len == 0 means the string should fill the buffer */
294 char *str = lustre_msg_buf (m, index, 0);
299 CERROR ("can't unpack string in msg %p buffer[%d]\n", m, index);
303 blen = m->buflens[index];
304 slen = strnlen (str, blen);
306 if (slen == blen) { /* not NULL terminated */
307 CERROR ("can't unpack non-NULL terminated string in "
308 "msg %p buffer[%d] len %d\n", m, index, blen);
313 if (slen != blen - 1) {
314 CERROR ("can't unpack short string in msg %p "
315 "buffer[%d] len %d: strlen %d\n",
316 m, index, blen, slen);
319 } else if (slen > max_len) {
320 CERROR ("can't unpack oversized string in msg %p "
321 "buffer[%d] len %d strlen %d: max %d expected\n",
322 m, index, blen, slen, max_len);
329 /* Wrap up the normal fixed length cases */
330 void *lustre_swab_buf(struct lustre_msg *msg, int index, int min_size,
335 ptr = lustre_msg_buf(msg, index, min_size);
339 if (swabber != NULL && lustre_msg_swabbed(msg))
340 ((void (*)(void *))swabber)(ptr);
345 void *lustre_swab_reqbuf(struct ptlrpc_request *req, int index, int min_size,
348 LASSERT_REQSWAB(req, index);
349 return lustre_swab_buf(req->rq_reqmsg, index, min_size, swabber);
352 void *lustre_swab_repbuf(struct ptlrpc_request *req, int index, int min_size,
355 LASSERT_REPSWAB(req, index);
356 return lustre_swab_buf(req->rq_repmsg, index, min_size, swabber);
359 /* byte flipping routines for all wire types declared in
360 * lustre_idl.h implemented here.
363 void lustre_swab_obdo (struct obdo *o)
365 __swab64s (&o->o_id);
366 __swab64s (&o->o_gr);
367 __swab64s (&o->o_atime);
368 __swab64s (&o->o_mtime);
369 __swab64s (&o->o_ctime);
370 __swab64s (&o->o_size);
371 __swab64s (&o->o_blocks);
372 __swab64s (&o->o_grant);
373 __swab32s (&o->o_blksize);
374 __swab32s (&o->o_mode);
375 __swab32s (&o->o_uid);
376 __swab32s (&o->o_gid);
377 __swab32s (&o->o_flags);
378 __swab32s (&o->o_nlink);
379 __swab32s (&o->o_generation);
380 __swab32s (&o->o_valid);
381 __swab32s (&o->o_misc);
382 __swab32s (&o->o_easize);
383 /* o_inline is opaque */
386 /* mdc pack methods used by mdc and smfs*/
387 void *mdc_create_pack(struct lustre_msg *msg, int offset,
388 struct mdc_op_data *op_data, __u32 mode, __u64 rdev,
389 const void *data, int datalen)
391 struct mds_rec_create *rec;
393 rec = lustre_msg_buf(msg, offset, sizeof (*rec));
395 rec->cr_opcode = REINT_CREATE;
396 rec->cr_fid = op_data->fid1;
397 memset(&rec->cr_replayfid, 0, sizeof(rec->cr_replayfid));
400 rec->cr_time = op_data->mod_time;
402 tmp = lustre_msg_buf(msg, offset + 1, op_data->namelen + 1);
403 LOGL0(op_data->name, op_data->namelen, tmp);
406 tmp = lustre_msg_buf(msg, offset + 2, datalen);
407 memcpy (tmp, data, datalen);
409 return ((void*)tmp + size_round(datalen));
412 void *mdc_setattr_pack(struct lustre_msg *msg, int offset,
413 struct mdc_op_data *data, struct iattr *iattr,
414 void *ea, int ealen, void *ea2, int ea2len)
416 struct mds_rec_setattr *rec = lustre_msg_buf(msg, offset, sizeof(*rec));
419 rec->sa_opcode = REINT_SETATTR;
420 rec->sa_fid = data->fid1;
423 rec->sa_valid = iattr->ia_valid;
424 rec->sa_mode = iattr->ia_mode;
425 rec->sa_uid = iattr->ia_uid;
426 rec->sa_gid = iattr->ia_gid;
427 rec->sa_size = iattr->ia_size;
428 rec->sa_atime = LTIME_S(iattr->ia_atime);
429 rec->sa_mtime = LTIME_S(iattr->ia_mtime);
430 rec->sa_ctime = LTIME_S(iattr->ia_ctime);
431 rec->sa_attr_flags = iattr->ia_attr_flags;
433 tmp = (char*)rec + size_round(sizeof(*rec));
438 memcpy(lustre_msg_buf(msg, offset + 1, ealen), ea, ealen);
440 tmp += size_round(ealen);
445 tmp += size_round(ea2len);
446 memcpy(lustre_msg_buf(msg, offset + 2, ea2len), ea2, ea2len);
451 void *mdc_unlink_pack(struct lustre_msg *msg, int offset,
452 struct mdc_op_data *data)
454 struct mds_rec_unlink *rec;
457 rec = lustre_msg_buf(msg, offset, sizeof (*rec));
458 LASSERT (rec != NULL);
460 rec->ul_opcode = REINT_UNLINK;
461 rec->ul_mode = data->create_mode;
462 rec->ul_fid1 = data->fid1;
463 rec->ul_fid2 = data->fid2;
464 rec->ul_time = data->mod_time;
466 tmp = lustre_msg_buf(msg, offset + 1, data->namelen + 1);
467 LASSERT (tmp != NULL);
468 LOGL0(data->name, data->namelen, tmp);
472 void *mdc_link_pack(struct lustre_msg *msg, int offset,
473 struct mdc_op_data *data)
475 struct mds_rec_link *rec;
478 rec = lustre_msg_buf(msg, offset, sizeof (*rec));
480 rec->lk_opcode = REINT_LINK;
481 rec->lk_fid1 = data->fid1;
482 rec->lk_fid2 = data->fid2;
483 rec->lk_time = data->mod_time;
485 tmp = lustre_msg_buf(msg, offset + 1, data->namelen + 1);
486 LOGL0(data->name, data->namelen, tmp);
491 void *mdc_rename_pack(struct lustre_msg *msg, int offset,
492 struct mdc_op_data *data,
493 const char *old, int oldlen, const char *new, int newlen)
495 struct mds_rec_rename *rec;
498 rec = lustre_msg_buf(msg, offset, sizeof (*rec));
500 /* XXX do something about time, uid, gid */
501 rec->rn_opcode = REINT_RENAME;
502 rec->rn_fid1 = data->fid1;
503 rec->rn_fid2 = data->fid2;
504 rec->rn_time = data->mod_time;
506 tmp = lustre_msg_buf(msg, offset + 1, oldlen + 1);
507 LOGL0(old, oldlen, tmp);
510 tmp = lustre_msg_buf(msg, offset + 2, newlen + 1);
511 LOGL0(new, newlen, tmp);
516 void lustre_swab_obd_statfs (struct obd_statfs *os)
518 __swab64s (&os->os_type);
519 __swab64s (&os->os_blocks);
520 __swab64s (&os->os_bfree);
521 __swab64s (&os->os_bavail);
522 __swab64s (&os->os_ffree);
523 /* no need to swap os_fsid */
524 __swab32s (&os->os_bsize);
525 __swab32s (&os->os_namelen);
526 /* no need to swap os_spare */
529 void lustre_swab_obd_ioobj (struct obd_ioobj *ioo)
531 __swab64s (&ioo->ioo_id);
532 __swab64s (&ioo->ioo_gr);
533 __swab32s (&ioo->ioo_type);
534 __swab32s (&ioo->ioo_bufcnt);
537 void lustre_swab_niobuf_remote (struct niobuf_remote *nbr)
539 __swab64s (&nbr->offset);
540 __swab32s (&nbr->len);
541 __swab32s (&nbr->flags);
544 void lustre_swab_ost_body (struct ost_body *b)
546 lustre_swab_obdo (&b->oa);
549 void lustre_swab_ost_last_id(obd_id *id)
554 void lustre_swab_ost_lvb(struct ost_lvb *lvb)
556 __swab64s(&lvb->lvb_size);
557 __swab64s(&lvb->lvb_mtime);
558 __swab64s(&lvb->lvb_atime);
559 __swab64s(&lvb->lvb_ctime);
560 __swab64s(&lvb->lvb_blocks);
563 void lustre_swab_ll_fid (struct ll_fid *fid)
565 __swab64s (&fid->id);
566 __swab32s (&fid->generation);
567 __swab32s (&fid->f_type);
570 void lustre_swab_mds_status_req (struct mds_status_req *r)
572 __swab32s (&r->flags);
573 __swab32s (&r->repbuf);
577 * because sec_desc is variable buffer, we must check it by hand
579 struct mds_req_sec_desc *lustre_swab_mds_secdesc(struct ptlrpc_request *req,
582 struct mds_req_sec_desc *rsd;
583 struct lustre_msg *m;
586 LASSERT_REQSWAB(req, offset);
589 rsd = lustre_msg_buf(m, offset, sizeof(*rsd));
593 if (lustre_msg_swabbed(m)) {
594 __swab32s(&rsd->rsd_uid);
595 __swab32s(&rsd->rsd_gid);
596 __swab32s(&rsd->rsd_fsuid);
597 __swab32s(&rsd->rsd_fsgid);
598 __swab32s(&rsd->rsd_cap);
599 __swab32s(&rsd->rsd_ngroups);
602 if (m->buflens[offset] !=
603 sizeof(*rsd) + rsd->rsd_ngroups * sizeof(__u32)) {
604 CERROR("bufflen %u while contains %u groups\n",
605 m->buflens[offset], rsd->rsd_ngroups);
609 if (lustre_msg_swabbed(m)) {
610 for (i = 0; i < rsd->rsd_ngroups; i++)
611 __swab32s(&rsd->rsd_groups[i]);
617 void lustre_swab_mds_body (struct mds_body *b)
619 lustre_swab_ll_fid (&b->fid1);
620 lustre_swab_ll_fid (&b->fid2);
621 /* handle is opaque */
622 __swab64s (&b->size);
623 __swab64s (&b->blocks);
625 __swab32s (&b->valid);
626 __swab32s (&b->mode);
629 __swab32s (&b->mtime);
630 __swab32s (&b->ctime);
631 __swab32s (&b->atime);
632 __swab32s (&b->flags);
633 __swab32s (&b->rdev);
634 __swab32s (&b->nlink);
635 __swab32s (&b->generation);
636 __swab32s (&b->eadatasize);
639 void lustre_swab_clonefs_info (struct clonefs_info *clone)
641 __swab32s(&clone->clone_index);
642 __swab32s(&clone->clone_flags);
644 void lustre_swab_mds_rec_setattr (struct mds_rec_setattr *sa)
646 __swab32s (&sa->sa_opcode);
647 __swab32s (&sa->sa_valid);
648 lustre_swab_ll_fid (&sa->sa_fid);
649 __swab32s (&sa->sa_mode);
650 __swab32s (&sa->sa_uid);
651 __swab32s (&sa->sa_gid);
652 __swab32s (&sa->sa_attr_flags);
653 __swab64s (&sa->sa_size);
654 __swab64s (&sa->sa_atime);
655 __swab64s (&sa->sa_mtime);
656 __swab64s (&sa->sa_ctime);
659 void lustre_swab_mds_rec_create (struct mds_rec_create *cr)
661 __swab32s (&cr->cr_opcode);
662 __swab32s (&cr->cr_flags); /* for use with open */
663 __swab32s (&cr->cr_mode);
664 lustre_swab_ll_fid (&cr->cr_fid);
665 lustre_swab_ll_fid (&cr->cr_replayfid);
666 __swab64s (&cr->cr_time);
667 __swab64s (&cr->cr_rdev);
670 void lustre_swab_mds_rec_link (struct mds_rec_link *lk)
672 __swab32s (&lk->lk_opcode);
673 lustre_swab_ll_fid (&lk->lk_fid1);
674 lustre_swab_ll_fid (&lk->lk_fid2);
677 void lustre_swab_mds_rec_unlink (struct mds_rec_unlink *ul)
679 __swab32s (&ul->ul_opcode);
680 __swab32s (&ul->ul_mode);
681 lustre_swab_ll_fid (&ul->ul_fid1);
682 lustre_swab_ll_fid (&ul->ul_fid2);
685 void lustre_swab_mds_rec_rename (struct mds_rec_rename *rn)
687 __swab32s (&rn->rn_opcode);
688 lustre_swab_ll_fid (&rn->rn_fid1);
689 lustre_swab_ll_fid (&rn->rn_fid2);
692 void lustre_swab_lov_desc (struct lov_desc *ld)
694 __swab32s (&ld->ld_tgt_count);
695 __swab32s (&ld->ld_active_tgt_count);
696 __swab32s (&ld->ld_default_stripe_count);
697 __swab64s (&ld->ld_default_stripe_size);
698 __swab64s (&ld->ld_default_stripe_offset);
699 __swab32s (&ld->ld_pattern);
700 /* uuid endian insensitive */
703 void lustre_swab_ldlm_res_id (struct ldlm_res_id *id)
707 for (i = 0; i < RES_NAME_SIZE; i++)
708 __swab64s (&id->name[i]);
711 void lustre_swab_ldlm_policy_data (ldlm_policy_data_t *d)
713 /* the lock data is a union and the first three fields of both EXTENT
714 * and FLOCK types are __u64, so it's ok to swab them in the same way */
715 __swab64s (&d->l_flock.start);
716 __swab64s (&d->l_flock.end);
717 __swab64s (&d->l_flock.pid);
718 __swab64s (&d->l_flock.blocking_pid);
721 void lustre_swab_ldlm_intent (struct ldlm_intent *i)
726 void lustre_swab_ldlm_resource_desc (struct ldlm_resource_desc *r)
728 __swab32s (&r->lr_type);
729 lustre_swab_ldlm_res_id (&r->lr_name);
732 void lustre_swab_ldlm_lock_desc (struct ldlm_lock_desc *l)
734 lustre_swab_ldlm_resource_desc (&l->l_resource);
735 __swab32s (&l->l_req_mode);
736 __swab32s (&l->l_granted_mode);
737 lustre_swab_ldlm_policy_data (&l->l_policy_data);
740 void lustre_swab_ldlm_request (struct ldlm_request *rq)
742 __swab32s (&rq->lock_flags);
743 lustre_swab_ldlm_lock_desc (&rq->lock_desc);
744 /* lock_handle1 opaque */
745 /* lock_handle2 opaque */
748 void lustre_swab_ldlm_reply (struct ldlm_reply *r)
750 __swab32s (&r->lock_flags);
751 lustre_swab_ldlm_lock_desc (&r->lock_desc);
752 /* lock_handle opaque */
753 __swab64s (&r->lock_policy_res1);
754 __swab64s (&r->lock_policy_res2);
757 void lustre_swab_ptlbd_op (struct ptlbd_op *op)
759 __swab16s (&op->op_cmd);
760 __swab16s (&op->op_lun);
761 __swab16s (&op->op_niob_cnt);
762 /* ignore op__padding */
763 __swab32s (&op->op_block_cnt);
766 void lustre_swab_ptlbd_niob (struct ptlbd_niob *n)
768 __swab64s (&n->n_xid);
769 __swab64s (&n->n_block_nr);
770 __swab32s (&n->n_offset);
771 __swab32s (&n->n_length);
774 void lustre_swab_ptlbd_rsp (struct ptlbd_rsp *r)
776 __swab16s (&r->r_status);
777 __swab16s (&r->r_error_cnt);
780 /* no one calls this */
781 int llog_log_swabbed(struct llog_log_hdr *hdr)
783 if (hdr->llh_hdr.lrh_type == __swab32(LLOG_HDR_MAGIC))
785 if (hdr->llh_hdr.lrh_type == LLOG_HDR_MAGIC)
790 void lustre_swab_llogd_body (struct llogd_body *d)
792 __swab64s (&d->lgd_logid.lgl_oid);
793 __swab64s (&d->lgd_logid.lgl_ogr);
794 __swab32s (&d->lgd_logid.lgl_ogen);
795 __swab32s (&d->lgd_ctxt_idx);
796 __swab32s (&d->lgd_llh_flags);
797 __swab32s (&d->lgd_index);
798 __swab32s (&d->lgd_saved_index);
799 __swab32s (&d->lgd_len);
800 __swab64s (&d->lgd_cur_offset);
803 void lustre_swab_llog_hdr (struct llog_log_hdr *h)
805 __swab32s (&h->llh_hdr.lrh_index);
806 __swab32s (&h->llh_hdr.lrh_len);
807 __swab32s (&h->llh_hdr.lrh_type);
808 __swab64s (&h->llh_timestamp);
809 __swab32s (&h->llh_count);
810 __swab32s (&h->llh_bitmap_offset);
811 __swab32s (&h->llh_flags);
812 __swab32s (&h->llh_tail.lrt_index);
813 __swab32s (&h->llh_tail.lrt_len);
816 void lustre_swab_llogd_conn_body (struct llogd_conn_body *d)
818 __swab64s (&d->lgdc_gen.mnt_cnt);
819 __swab64s (&d->lgdc_gen.conn_cnt);
820 __swab64s (&d->lgdc_logid.lgl_oid);
821 __swab64s (&d->lgdc_logid.lgl_ogr);
822 __swab32s (&d->lgdc_logid.lgl_ogen);
823 __swab32s (&d->lgdc_ctxt_idx);
826 void lustre_assert_wire_constants(void)
828 /* Wire protocol assertions generated by 'wirecheck'
829 * running on Linux build 2.4.24-cmd #1 SMP Wed Aug 18 14:24:44 MDT 2004 i686 i686 i386 GNU/L
830 * with gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) */
834 LASSERTF(PTLRPC_MSG_MAGIC == 0x0BD00BD0," found %lld\n",
835 (long long)PTLRPC_MSG_MAGIC);
836 LASSERTF(PTLRPC_MSG_VERSION == 0x00000003," found %lld\n",
837 (long long)PTLRPC_MSG_VERSION);
838 LASSERTF(PTL_RPC_MSG_REQUEST == 4711, " found %lld\n",
839 (long long)PTL_RPC_MSG_REQUEST);
840 LASSERTF(PTL_RPC_MSG_ERR == 4712, " found %lld\n",
841 (long long)PTL_RPC_MSG_ERR);
842 LASSERTF(PTL_RPC_MSG_REPLY == 4713, " found %lld\n",
843 (long long)PTL_RPC_MSG_REPLY);
844 LASSERTF(MSG_LAST_REPLAY == 1, " found %lld\n",
845 (long long)MSG_LAST_REPLAY);
846 LASSERTF(MSG_RESENT == 2, " found %lld\n",
847 (long long)MSG_RESENT);
848 LASSERTF(MSG_REPLAY == 4, " found %lld\n",
849 (long long)MSG_REPLAY);
850 LASSERTF(MSG_CONNECT_RECOVERING == 1, " found %lld\n",
851 (long long)MSG_CONNECT_RECOVERING);
852 LASSERTF(MSG_CONNECT_RECONNECT == 2, " found %lld\n",
853 (long long)MSG_CONNECT_RECONNECT);
854 LASSERTF(MSG_CONNECT_REPLAYABLE == 4, " found %lld\n",
855 (long long)MSG_CONNECT_REPLAYABLE);
856 LASSERTF(OST_REPLY == 0, " found %lld\n",
857 (long long)OST_REPLY);
858 LASSERTF(OST_GETATTR == 1, " found %lld\n",
859 (long long)OST_GETATTR);
860 LASSERTF(OST_SETATTR == 2, " found %lld\n",
861 (long long)OST_SETATTR);
862 LASSERTF(OST_READ == 3, " found %lld\n",
863 (long long)OST_READ);
864 LASSERTF(OST_WRITE == 4, " found %lld\n",
865 (long long)OST_WRITE);
866 LASSERTF(OST_CREATE == 5, " found %lld\n",
867 (long long)OST_CREATE);
868 LASSERTF(OST_DESTROY == 6, " found %lld\n",
869 (long long)OST_DESTROY);
870 LASSERTF(OST_GET_INFO == 7, " found %lld\n",
871 (long long)OST_GET_INFO);
872 LASSERTF(OST_CONNECT == 8, " found %lld\n",
873 (long long)OST_CONNECT);
874 LASSERTF(OST_DISCONNECT == 9, " found %lld\n",
875 (long long)OST_DISCONNECT);
876 LASSERTF(OST_PUNCH == 10, " found %lld\n",
877 (long long)OST_PUNCH);
878 LASSERTF(OST_OPEN == 11, " found %lld\n",
879 (long long)OST_OPEN);
880 LASSERTF(OST_CLOSE == 12, " found %lld\n",
881 (long long)OST_CLOSE);
882 LASSERTF(OST_STATFS == 13, " found %lld\n",
883 (long long)OST_STATFS);
884 LASSERTF(OST_SAN_READ == 14, " found %lld\n",
885 (long long)OST_SAN_READ);
886 LASSERTF(OST_SAN_WRITE == 15, " found %lld\n",
887 (long long)OST_SAN_WRITE);
888 LASSERTF(OST_SYNC == 16, " found %lld\n",
889 (long long)OST_SYNC);
890 LASSERTF(OST_LAST_OPC == 18, " found %lld\n",
891 (long long)OST_LAST_OPC);
892 LASSERTF(OBD_OBJECT_EOF == 0xffffffffffffffffULL," found %lld\n",
893 (long long)OBD_OBJECT_EOF);
894 LASSERTF(OST_REQ_HAS_OA1 == 1, " found %lld\n",
895 (long long)OST_REQ_HAS_OA1);
896 LASSERTF(MDS_GETATTR == 33, " found %lld\n",
897 (long long)MDS_GETATTR);
898 LASSERTF(MDS_GETATTR_NAME == 34, " found %lld\n",
899 (long long)MDS_GETATTR_NAME);
900 LASSERTF(MDS_CLOSE == 35, " found %lld\n",
901 (long long)MDS_CLOSE);
902 LASSERTF(MDS_REINT == 36, " found %lld\n",
903 (long long)MDS_REINT);
904 LASSERTF(MDS_READPAGE == 37, " found %lld\n",
905 (long long)MDS_READPAGE);
906 LASSERTF(MDS_CONNECT == 38, " found %lld\n",
907 (long long)MDS_CONNECT);
908 LASSERTF(MDS_DISCONNECT == 39, " found %lld\n",
909 (long long)MDS_DISCONNECT);
910 LASSERTF(MDS_GETSTATUS == 40, " found %lld\n",
911 (long long)MDS_GETSTATUS);
912 LASSERTF(MDS_STATFS == 41, " found %lld\n",
913 (long long)MDS_STATFS);
914 LASSERTF(MDS_PIN == 42, " found %lld\n",
916 LASSERTF(MDS_UNPIN == 43, " found %lld\n",
917 (long long)MDS_UNPIN);
918 LASSERTF(MDS_SYNC == 44, " found %lld\n",
919 (long long)MDS_SYNC);
920 LASSERTF(MDS_DONE_WRITING == 45, " found %lld\n",
921 (long long)MDS_DONE_WRITING);
922 LASSERTF(MDS_LAST_OPC == 46, " found %lld\n",
923 (long long)MDS_LAST_OPC);
924 LASSERTF(REINT_SETATTR == 1, " found %lld\n",
925 (long long)REINT_SETATTR);
926 LASSERTF(REINT_CREATE == 2, " found %lld\n",
927 (long long)REINT_CREATE);
928 LASSERTF(REINT_LINK == 3, " found %lld\n",
929 (long long)REINT_LINK);
930 LASSERTF(REINT_UNLINK == 4, " found %lld\n",
931 (long long)REINT_UNLINK);
932 LASSERTF(REINT_RENAME == 5, " found %lld\n",
933 (long long)REINT_RENAME);
934 LASSERTF(REINT_OPEN == 6, " found %lld\n",
935 (long long)REINT_OPEN);
936 LASSERTF(REINT_MAX == 8, " found %lld\n",
937 (long long)REINT_MAX);
938 LASSERTF(DISP_IT_EXECD == 1, " found %lld\n",
939 (long long)DISP_IT_EXECD);
940 LASSERTF(DISP_LOOKUP_EXECD == 2, " found %lld\n",
941 (long long)DISP_LOOKUP_EXECD);
942 LASSERTF(DISP_LOOKUP_NEG == 4, " found %lld\n",
943 (long long)DISP_LOOKUP_NEG);
944 LASSERTF(DISP_LOOKUP_POS == 8, " found %lld\n",
945 (long long)DISP_LOOKUP_POS);
946 LASSERTF(DISP_OPEN_CREATE == 16, " found %lld\n",
947 (long long)DISP_OPEN_CREATE);
948 LASSERTF(DISP_OPEN_OPEN == 32, " found %lld\n",
949 (long long)DISP_OPEN_OPEN);
950 LASSERTF(MDS_STATUS_CONN == 1, " found %lld\n",
951 (long long)MDS_STATUS_CONN);
952 LASSERTF(MDS_STATUS_LOV == 2, " found %lld\n",
953 (long long)MDS_STATUS_LOV);
954 LASSERTF(MDS_OPEN_HAS_EA == 1073741824, " found %lld\n",
955 (long long)MDS_OPEN_HAS_EA);
956 LASSERTF(LDLM_ENQUEUE == 101, " found %lld\n",
957 (long long)LDLM_ENQUEUE);
958 LASSERTF(LDLM_CONVERT == 102, " found %lld\n",
959 (long long)LDLM_CONVERT);
960 LASSERTF(LDLM_CANCEL == 103, " found %lld\n",
961 (long long)LDLM_CANCEL);
962 LASSERTF(LDLM_BL_CALLBACK == 104, " found %lld\n",
963 (long long)LDLM_BL_CALLBACK);
964 LASSERTF(LDLM_CP_CALLBACK == 105, " found %lld\n",
965 (long long)LDLM_CP_CALLBACK);
966 LASSERTF(LDLM_LAST_OPC == 107, " found %lld\n",
967 (long long)LDLM_LAST_OPC);
968 LASSERTF(LCK_EX == 1, " found %lld\n",
970 LASSERTF(LCK_PW == 2, " found %lld\n",
972 LASSERTF(LCK_PR == 4, " found %lld\n",
974 LASSERTF(LCK_CW == 8, " found %lld\n",
976 LASSERTF(LCK_CR == 16, " found %lld\n",
978 LASSERTF(LCK_NL == 32, " found %lld\n",
980 LASSERTF(PTLBD_QUERY == 200, " found %lld\n",
981 (long long)PTLBD_QUERY);
982 LASSERTF(PTLBD_READ == 201, " found %lld\n",
983 (long long)PTLBD_READ);
984 LASSERTF(PTLBD_WRITE == 202, " found %lld\n",
985 (long long)PTLBD_WRITE);
986 LASSERTF(PTLBD_FLUSH == 203, " found %lld\n",
987 (long long)PTLBD_FLUSH);
988 LASSERTF(PTLBD_CONNECT == 204, " found %lld\n",
989 (long long)PTLBD_CONNECT);
990 LASSERTF(PTLBD_DISCONNECT == 205, " found %lld\n",
991 (long long)PTLBD_DISCONNECT);
992 LASSERTF(PTLBD_LAST_OPC == 206, " found %lld\n",
993 (long long)PTLBD_LAST_OPC);
994 LASSERTF(MGMT_CONNECT == 250, " found %lld\n",
995 (long long)MGMT_CONNECT);
996 LASSERTF(MGMT_DISCONNECT == 251, " found %lld\n",
997 (long long)MGMT_DISCONNECT);
998 LASSERTF(MGMT_EXCEPTION == 252, " found %lld\n",
999 (long long)MGMT_EXCEPTION);
1000 LASSERTF(OBD_PING == 400, " found %lld\n",
1001 (long long)OBD_PING);
1002 LASSERTF(OBD_LOG_CANCEL == 401, " found %lld\n",
1003 (long long)OBD_LOG_CANCEL);
1004 LASSERTF(OBD_LAST_OPC == 402, " found %lld\n",
1005 (long long)OBD_LAST_OPC);
1006 /* Sizes and Offsets */
1009 /* Checks for struct lustre_handle */
1010 LASSERTF((int)sizeof(struct lustre_handle) == 8, " found %lld\n",
1011 (long long)(int)sizeof(struct lustre_handle));
1012 LASSERTF((int)offsetof(struct lustre_handle, cookie) == 0, " found %lld\n",
1013 (long long)(int)offsetof(struct lustre_handle, cookie));
1014 LASSERTF((int)sizeof(((struct lustre_handle *)0)->cookie) == 8, " found %lld\n",
1015 (long long)(int)sizeof(((struct lustre_handle *)0)->cookie));
1017 /* Checks for struct lustre_msg */
1018 LASSERTF((int)sizeof(struct lustre_msg) == 64, " found %lld\n",
1019 (long long)(int)sizeof(struct lustre_msg));
1020 LASSERTF((int)offsetof(struct lustre_msg, handle) == 0, " found %lld\n",
1021 (long long)(int)offsetof(struct lustre_msg, handle));
1022 LASSERTF((int)sizeof(((struct lustre_msg *)0)->handle) == 8, " found %lld\n",
1023 (long long)(int)sizeof(((struct lustre_msg *)0)->handle));
1024 LASSERTF((int)offsetof(struct lustre_msg, magic) == 8, " found %lld\n",
1025 (long long)(int)offsetof(struct lustre_msg, magic));
1026 LASSERTF((int)sizeof(((struct lustre_msg *)0)->magic) == 4, " found %lld\n",
1027 (long long)(int)sizeof(((struct lustre_msg *)0)->magic));
1028 LASSERTF((int)offsetof(struct lustre_msg, type) == 12, " found %lld\n",
1029 (long long)(int)offsetof(struct lustre_msg, type));
1030 LASSERTF((int)sizeof(((struct lustre_msg *)0)->type) == 4, " found %lld\n",
1031 (long long)(int)sizeof(((struct lustre_msg *)0)->type));
1032 LASSERTF((int)offsetof(struct lustre_msg, version) == 16, " found %lld\n",
1033 (long long)(int)offsetof(struct lustre_msg, version));
1034 LASSERTF((int)sizeof(((struct lustre_msg *)0)->version) == 4, " found %lld\n",
1035 (long long)(int)sizeof(((struct lustre_msg *)0)->version));
1036 LASSERTF((int)offsetof(struct lustre_msg, opc) == 20, " found %lld\n",
1037 (long long)(int)offsetof(struct lustre_msg, opc));
1038 LASSERTF((int)sizeof(((struct lustre_msg *)0)->opc) == 4, " found %lld\n",
1039 (long long)(int)sizeof(((struct lustre_msg *)0)->opc));
1040 LASSERTF((int)offsetof(struct lustre_msg, last_xid) == 24, " found %lld\n",
1041 (long long)(int)offsetof(struct lustre_msg, last_xid));
1042 LASSERTF((int)sizeof(((struct lustre_msg *)0)->last_xid) == 8, " found %lld\n",
1043 (long long)(int)sizeof(((struct lustre_msg *)0)->last_xid));
1044 LASSERTF((int)offsetof(struct lustre_msg, last_committed) == 32, " found %lld\n",
1045 (long long)(int)offsetof(struct lustre_msg, last_committed));
1046 LASSERTF((int)sizeof(((struct lustre_msg *)0)->last_committed) == 8, " found %lld\n",
1047 (long long)(int)sizeof(((struct lustre_msg *)0)->last_committed));
1048 LASSERTF((int)offsetof(struct lustre_msg, transno) == 40, " found %lld\n",
1049 (long long)(int)offsetof(struct lustre_msg, transno));
1050 LASSERTF((int)sizeof(((struct lustre_msg *)0)->transno) == 8, " found %lld\n",
1051 (long long)(int)sizeof(((struct lustre_msg *)0)->transno));
1052 LASSERTF((int)offsetof(struct lustre_msg, status) == 48, " found %lld\n",
1053 (long long)(int)offsetof(struct lustre_msg, status));
1054 LASSERTF((int)sizeof(((struct lustre_msg *)0)->status) == 4, " found %lld\n",
1055 (long long)(int)sizeof(((struct lustre_msg *)0)->status));
1056 LASSERTF((int)offsetof(struct lustre_msg, flags) == 52, " found %lld\n",
1057 (long long)(int)offsetof(struct lustre_msg, flags));
1058 LASSERTF((int)sizeof(((struct lustre_msg *)0)->flags) == 4, " found %lld\n",
1059 (long long)(int)sizeof(((struct lustre_msg *)0)->flags));
1060 LASSERTF((int)offsetof(struct lustre_msg, bufcount) == 60, " found %lld\n",
1061 (long long)(int)offsetof(struct lustre_msg, bufcount));
1062 LASSERTF((int)sizeof(((struct lustre_msg *)0)->bufcount) == 4, " found %lld\n",
1063 (long long)(int)sizeof(((struct lustre_msg *)0)->bufcount));
1064 LASSERTF((int)offsetof(struct lustre_msg, buflens[7]) == 92, " found %lld\n",
1065 (long long)(int)offsetof(struct lustre_msg, buflens[7]));
1066 LASSERTF((int)sizeof(((struct lustre_msg *)0)->buflens[7]) == 4, " found %lld\n",
1067 (long long)(int)sizeof(((struct lustre_msg *)0)->buflens[7]));
1069 /* Checks for struct obdo */
1070 LASSERTF((int)sizeof(struct obdo) == 176, " found %lld\n",
1071 (long long)(int)sizeof(struct obdo));
1072 LASSERTF((int)offsetof(struct obdo, o_id) == 0, " found %lld\n",
1073 (long long)(int)offsetof(struct obdo, o_id));
1074 LASSERTF((int)sizeof(((struct obdo *)0)->o_id) == 8, " found %lld\n",
1075 (long long)(int)sizeof(((struct obdo *)0)->o_id));
1076 LASSERTF((int)offsetof(struct obdo, o_gr) == 8, " found %lld\n",
1077 (long long)(int)offsetof(struct obdo, o_gr));
1078 LASSERTF((int)sizeof(((struct obdo *)0)->o_gr) == 8, " found %lld\n",
1079 (long long)(int)sizeof(((struct obdo *)0)->o_gr));
1080 LASSERTF((int)offsetof(struct obdo, o_atime) == 16, " found %lld\n",
1081 (long long)(int)offsetof(struct obdo, o_atime));
1082 LASSERTF((int)sizeof(((struct obdo *)0)->o_atime) == 8, " found %lld\n",
1083 (long long)(int)sizeof(((struct obdo *)0)->o_atime));
1084 LASSERTF((int)offsetof(struct obdo, o_mtime) == 24, " found %lld\n",
1085 (long long)(int)offsetof(struct obdo, o_mtime));
1086 LASSERTF((int)sizeof(((struct obdo *)0)->o_mtime) == 8, " found %lld\n",
1087 (long long)(int)sizeof(((struct obdo *)0)->o_mtime));
1088 LASSERTF((int)offsetof(struct obdo, o_ctime) == 32, " found %lld\n",
1089 (long long)(int)offsetof(struct obdo, o_ctime));
1090 LASSERTF((int)sizeof(((struct obdo *)0)->o_ctime) == 8, " found %lld\n",
1091 (long long)(int)sizeof(((struct obdo *)0)->o_ctime));
1092 LASSERTF((int)offsetof(struct obdo, o_size) == 40, " found %lld\n",
1093 (long long)(int)offsetof(struct obdo, o_size));
1094 LASSERTF((int)sizeof(((struct obdo *)0)->o_size) == 8, " found %lld\n",
1095 (long long)(int)sizeof(((struct obdo *)0)->o_size));
1096 LASSERTF((int)offsetof(struct obdo, o_blocks) == 48, " found %lld\n",
1097 (long long)(int)offsetof(struct obdo, o_blocks));
1098 LASSERTF((int)sizeof(((struct obdo *)0)->o_blocks) == 8, " found %lld\n",
1099 (long long)(int)sizeof(((struct obdo *)0)->o_blocks));
1100 LASSERTF((int)offsetof(struct obdo, o_grant) == 56, " found %lld\n",
1101 (long long)(int)offsetof(struct obdo, o_grant));
1102 LASSERTF((int)sizeof(((struct obdo *)0)->o_grant) == 8, " found %lld\n",
1103 (long long)(int)sizeof(((struct obdo *)0)->o_grant));
1104 LASSERTF((int)offsetof(struct obdo, o_blksize) == 64, " found %lld\n",
1105 (long long)(int)offsetof(struct obdo, o_blksize));
1106 LASSERTF((int)sizeof(((struct obdo *)0)->o_blksize) == 4, " found %lld\n",
1107 (long long)(int)sizeof(((struct obdo *)0)->o_blksize));
1108 LASSERTF((int)offsetof(struct obdo, o_mode) == 68, " found %lld\n",
1109 (long long)(int)offsetof(struct obdo, o_mode));
1110 LASSERTF((int)sizeof(((struct obdo *)0)->o_mode) == 4, " found %lld\n",
1111 (long long)(int)sizeof(((struct obdo *)0)->o_mode));
1112 LASSERTF((int)offsetof(struct obdo, o_uid) == 72, " found %lld\n",
1113 (long long)(int)offsetof(struct obdo, o_uid));
1114 LASSERTF((int)sizeof(((struct obdo *)0)->o_uid) == 4, " found %lld\n",
1115 (long long)(int)sizeof(((struct obdo *)0)->o_uid));
1116 LASSERTF((int)offsetof(struct obdo, o_gid) == 76, " found %lld\n",
1117 (long long)(int)offsetof(struct obdo, o_gid));
1118 LASSERTF((int)sizeof(((struct obdo *)0)->o_gid) == 4, " found %lld\n",
1119 (long long)(int)sizeof(((struct obdo *)0)->o_gid));
1120 LASSERTF((int)offsetof(struct obdo, o_flags) == 80, " found %lld\n",
1121 (long long)(int)offsetof(struct obdo, o_flags));
1122 LASSERTF((int)sizeof(((struct obdo *)0)->o_flags) == 4, " found %lld\n",
1123 (long long)(int)sizeof(((struct obdo *)0)->o_flags));
1124 LASSERTF((int)offsetof(struct obdo, o_nlink) == 84, " found %lld\n",
1125 (long long)(int)offsetof(struct obdo, o_nlink));
1126 LASSERTF((int)sizeof(((struct obdo *)0)->o_nlink) == 4, " found %lld\n",
1127 (long long)(int)sizeof(((struct obdo *)0)->o_nlink));
1128 LASSERTF((int)offsetof(struct obdo, o_generation) == 88, " found %lld\n",
1129 (long long)(int)offsetof(struct obdo, o_generation));
1130 LASSERTF((int)sizeof(((struct obdo *)0)->o_generation) == 4, " found %lld\n",
1131 (long long)(int)sizeof(((struct obdo *)0)->o_generation));
1132 LASSERTF((int)offsetof(struct obdo, o_valid) == 92, " found %lld\n",
1133 (long long)(int)offsetof(struct obdo, o_valid));
1134 LASSERTF((int)sizeof(((struct obdo *)0)->o_valid) == 4, " found %lld\n",
1135 (long long)(int)sizeof(((struct obdo *)0)->o_valid));
1136 LASSERTF((int)offsetof(struct obdo, o_misc) == 96, " found %lld\n",
1137 (long long)(int)offsetof(struct obdo, o_misc));
1138 LASSERTF((int)sizeof(((struct obdo *)0)->o_misc) == 4, " found %lld\n",
1139 (long long)(int)sizeof(((struct obdo *)0)->o_misc));
1140 LASSERTF((int)offsetof(struct obdo, o_easize) == 100, " found %lld\n",
1141 (long long)(int)offsetof(struct obdo, o_easize));
1142 LASSERTF((int)sizeof(((struct obdo *)0)->o_easize) == 4, " found %lld\n",
1143 (long long)(int)sizeof(((struct obdo *)0)->o_easize));
1144 LASSERTF((int)offsetof(struct obdo, o_mds) == 104, " found %lld\n",
1145 (long long)(int)offsetof(struct obdo, o_mds));
1146 LASSERTF((int)sizeof(((struct obdo *)0)->o_mds) == 4, " found %lld\n",
1147 (long long)(int)sizeof(((struct obdo *)0)->o_mds));
1148 LASSERTF((int)offsetof(struct obdo, o_padding) == 108, " found %lld\n",
1149 (long long)(int)offsetof(struct obdo, o_padding));
1150 LASSERTF((int)sizeof(((struct obdo *)0)->o_padding) == 4, " found %lld\n",
1151 (long long)(int)sizeof(((struct obdo *)0)->o_padding));
1152 LASSERTF((int)offsetof(struct obdo, o_inline) == 112, " found %lld\n",
1153 (long long)(int)offsetof(struct obdo, o_inline));
1154 LASSERTF((int)sizeof(((struct obdo *)0)->o_inline) == 64, " found %lld\n",
1155 (long long)(int)sizeof(((struct obdo *)0)->o_inline));
1156 LASSERTF(OBD_MD_FLID == 1, " found %lld\n",
1157 (long long)OBD_MD_FLID);
1158 LASSERTF(OBD_MD_FLATIME == 2, " found %lld\n",
1159 (long long)OBD_MD_FLATIME);
1160 LASSERTF(OBD_MD_FLMTIME == 4, " found %lld\n",
1161 (long long)OBD_MD_FLMTIME);
1162 LASSERTF(OBD_MD_FLCTIME == 8, " found %lld\n",
1163 (long long)OBD_MD_FLCTIME);
1164 LASSERTF(OBD_MD_FLSIZE == 16, " found %lld\n",
1165 (long long)OBD_MD_FLSIZE);
1166 LASSERTF(OBD_MD_FLBLOCKS == 32, " found %lld\n",
1167 (long long)OBD_MD_FLBLOCKS);
1168 LASSERTF(OBD_MD_FLBLKSZ == 64, " found %lld\n",
1169 (long long)OBD_MD_FLBLKSZ);
1170 LASSERTF(OBD_MD_FLMODE == 128, " found %lld\n",
1171 (long long)OBD_MD_FLMODE);
1172 LASSERTF(OBD_MD_FLTYPE == 256, " found %lld\n",
1173 (long long)OBD_MD_FLTYPE);
1174 LASSERTF(OBD_MD_FLUID == 512, " found %lld\n",
1175 (long long)OBD_MD_FLUID);
1176 LASSERTF(OBD_MD_FLGID == 1024, " found %lld\n",
1177 (long long)OBD_MD_FLGID);
1178 LASSERTF(OBD_MD_FLFLAGS == 2048, " found %lld\n",
1179 (long long)OBD_MD_FLFLAGS);
1180 LASSERTF(OBD_MD_FLNLINK == 8192, " found %lld\n",
1181 (long long)OBD_MD_FLNLINK);
1182 LASSERTF(OBD_MD_FLGENER == 16384, " found %lld\n",
1183 (long long)OBD_MD_FLGENER);
1184 LASSERTF(OBD_MD_FLINLINE == 32768, " found %lld\n",
1185 (long long)OBD_MD_FLINLINE);
1186 LASSERTF(OBD_MD_FLRDEV == 65536, " found %lld\n",
1187 (long long)OBD_MD_FLRDEV);
1188 LASSERTF(OBD_MD_FLEASIZE == 131072, " found %lld\n",
1189 (long long)OBD_MD_FLEASIZE);
1190 LASSERTF(OBD_MD_LINKNAME == 262144, " found %lld\n",
1191 (long long)OBD_MD_LINKNAME);
1192 LASSERTF(OBD_MD_FLHANDLE == 524288, " found %lld\n",
1193 (long long)OBD_MD_FLHANDLE);
1194 LASSERTF(OBD_MD_FLCKSUM == 1048576, " found %lld\n",
1195 (long long)OBD_MD_FLCKSUM);
1196 LASSERTF(OBD_MD_FLQOS == 2097152, " found %lld\n",
1197 (long long)OBD_MD_FLQOS);
1198 LASSERTF(OBD_MD_FLOSCOPQ == 4194304, " found %lld\n",
1199 (long long)OBD_MD_FLOSCOPQ);
1200 LASSERTF(OBD_MD_FLCOOKIE == 8388608, " found %lld\n",
1201 (long long)OBD_MD_FLCOOKIE);
1202 LASSERTF(OBD_MD_FLGROUP == 16777216, " found %lld\n",
1203 (long long)OBD_MD_FLGROUP);
1204 LASSERTF(OBD_FL_INLINEDATA == 1, " found %lld\n",
1205 (long long)OBD_FL_INLINEDATA);
1206 LASSERTF(OBD_FL_OBDMDEXISTS == 2, " found %lld\n",
1207 (long long)OBD_FL_OBDMDEXISTS);
1208 LASSERTF(OBD_FL_DELORPHAN == 4, " found %lld\n",
1209 (long long)OBD_FL_DELORPHAN);
1210 LASSERTF(OBD_FL_NORPC == 8, " found %lld\n",
1211 (long long)OBD_FL_NORPC);
1212 LASSERTF(OBD_FL_IDONLY == 16, " found %lld\n",
1213 (long long)OBD_FL_IDONLY);
1214 LASSERTF(OBD_FL_RECREATE_OBJS == 32, " found %lld\n",
1215 (long long)OBD_FL_RECREATE_OBJS);
1217 /* Checks for struct lov_mds_md_v1 */
1218 LASSERTF((int)sizeof(struct lov_mds_md_v1) == 32, " found %lld\n",
1219 (long long)(int)sizeof(struct lov_mds_md_v1));
1220 LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_magic) == 0, " found %lld\n",
1221 (long long)(int)offsetof(struct lov_mds_md_v1, lmm_magic));
1222 LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_magic) == 4, " found %lld\n",
1223 (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_magic));
1224 LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_pattern) == 4, " found %lld\n",
1225 (long long)(int)offsetof(struct lov_mds_md_v1, lmm_pattern));
1226 LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_pattern) == 4, " found %lld\n",
1227 (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_pattern));
1228 LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_object_id) == 8, " found %lld\n",
1229 (long long)(int)offsetof(struct lov_mds_md_v1, lmm_object_id));
1230 LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id) == 8, " found %lld\n",
1231 (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id));
1232 LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_object_gr) == 16, " found %lld\n",
1233 (long long)(int)offsetof(struct lov_mds_md_v1, lmm_object_gr));
1234 LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr) == 8, " found %lld\n",
1235 (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr));
1236 LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_stripe_size) == 24, " found %lld\n",
1237 (long long)(int)offsetof(struct lov_mds_md_v1, lmm_stripe_size));
1238 LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size) == 4, " found %lld\n",
1239 (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size));
1240 LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_stripe_count) == 28, " found %lld\n",
1241 (long long)(int)offsetof(struct lov_mds_md_v1, lmm_stripe_count));
1242 LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count) == 4, " found %lld\n",
1243 (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count));
1244 LASSERTF((int)offsetof(struct lov_mds_md_v1, lmm_objects) == 32, " found %lld\n",
1245 (long long)(int)offsetof(struct lov_mds_md_v1, lmm_objects));
1246 LASSERTF((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_objects) == 0, " found %lld\n",
1247 (long long)(int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_objects));
1249 /* Checks for struct lov_ost_data_v1 */
1250 LASSERTF((int)sizeof(struct lov_ost_data_v1) == 24, " found %lld\n",
1251 (long long)(int)sizeof(struct lov_ost_data_v1));
1252 LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_id) == 0, " found %lld\n",
1253 (long long)(int)offsetof(struct lov_ost_data_v1, l_object_id));
1254 LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id) == 8, " found %lld\n",
1255 (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id));
1256 LASSERTF((int)offsetof(struct lov_ost_data_v1, l_object_gr) == 8, " found %lld\n",
1257 (long long)(int)offsetof(struct lov_ost_data_v1, l_object_gr));
1258 LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr) == 8, " found %lld\n",
1259 (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr));
1260 LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_gen) == 16, " found %lld\n",
1261 (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_gen));
1262 LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4, " found %lld\n",
1263 (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen));
1264 LASSERTF((int)offsetof(struct lov_ost_data_v1, l_ost_idx) == 20, " found %lld\n",
1265 (long long)(int)offsetof(struct lov_ost_data_v1, l_ost_idx));
1266 LASSERTF((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_idx) == 4, " found %lld\n",
1267 (long long)(int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_idx));
1268 LASSERTF(LOV_MAGIC_V0 == 198183888, " found %lld\n",
1269 (long long)LOV_MAGIC_V0);
1270 LASSERTF(LOV_MAGIC_V1 == 198249424, " found %lld\n",
1271 (long long)LOV_MAGIC_V1);
1272 LASSERTF(LOV_PATTERN_RAID0 == 1, " found %lld\n",
1273 (long long)LOV_PATTERN_RAID0);
1274 LASSERTF(LOV_PATTERN_RAID1 == 2, " found %lld\n",
1275 (long long)LOV_PATTERN_RAID1);
1277 /* Checks for struct obd_statfs */
1278 LASSERTF((int)sizeof(struct obd_statfs) == 144, " found %lld\n",
1279 (long long)(int)sizeof(struct obd_statfs));
1280 LASSERTF((int)offsetof(struct obd_statfs, os_type) == 0, " found %lld\n",
1281 (long long)(int)offsetof(struct obd_statfs, os_type));
1282 LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_type) == 8, " found %lld\n",
1283 (long long)(int)sizeof(((struct obd_statfs *)0)->os_type));
1284 LASSERTF((int)offsetof(struct obd_statfs, os_blocks) == 8, " found %lld\n",
1285 (long long)(int)offsetof(struct obd_statfs, os_blocks));
1286 LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_blocks) == 8, " found %lld\n",
1287 (long long)(int)sizeof(((struct obd_statfs *)0)->os_blocks));
1288 LASSERTF((int)offsetof(struct obd_statfs, os_bfree) == 16, " found %lld\n",
1289 (long long)(int)offsetof(struct obd_statfs, os_bfree));
1290 LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_bfree) == 8, " found %lld\n",
1291 (long long)(int)sizeof(((struct obd_statfs *)0)->os_bfree));
1292 LASSERTF((int)offsetof(struct obd_statfs, os_bavail) == 24, " found %lld\n",
1293 (long long)(int)offsetof(struct obd_statfs, os_bavail));
1294 LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_bavail) == 8, " found %lld\n",
1295 (long long)(int)sizeof(((struct obd_statfs *)0)->os_bavail));
1296 LASSERTF((int)offsetof(struct obd_statfs, os_ffree) == 40, " found %lld\n",
1297 (long long)(int)offsetof(struct obd_statfs, os_ffree));
1298 LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_ffree) == 8, " found %lld\n",
1299 (long long)(int)sizeof(((struct obd_statfs *)0)->os_ffree));
1300 LASSERTF((int)offsetof(struct obd_statfs, os_fsid) == 48, " found %lld\n",
1301 (long long)(int)offsetof(struct obd_statfs, os_fsid));
1302 LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_fsid) == 40, " found %lld\n",
1303 (long long)(int)sizeof(((struct obd_statfs *)0)->os_fsid));
1304 LASSERTF((int)offsetof(struct obd_statfs, os_bsize) == 88, " found %lld\n",
1305 (long long)(int)offsetof(struct obd_statfs, os_bsize));
1306 LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_bsize) == 4, " found %lld\n",
1307 (long long)(int)sizeof(((struct obd_statfs *)0)->os_bsize));
1308 LASSERTF((int)offsetof(struct obd_statfs, os_namelen) == 92, " found %lld\n",
1309 (long long)(int)offsetof(struct obd_statfs, os_namelen));
1310 LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_namelen) == 4, " found %lld\n",
1311 (long long)(int)sizeof(((struct obd_statfs *)0)->os_namelen));
1312 LASSERTF((int)offsetof(struct obd_statfs, os_spare) == 104, " found %lld\n",
1313 (long long)(int)offsetof(struct obd_statfs, os_spare));
1314 LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare) == 40, " found %lld\n",
1315 (long long)(int)sizeof(((struct obd_statfs *)0)->os_spare));
1317 /* Checks for struct obd_ioobj */
1318 LASSERTF((int)sizeof(struct obd_ioobj) == 24, " found %lld\n",
1319 (long long)(int)sizeof(struct obd_ioobj));
1320 LASSERTF((int)offsetof(struct obd_ioobj, ioo_id) == 0, " found %lld\n",
1321 (long long)(int)offsetof(struct obd_ioobj, ioo_id));
1322 LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_id) == 8, " found %lld\n",
1323 (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_id));
1324 LASSERTF((int)offsetof(struct obd_ioobj, ioo_gr) == 8, " found %lld\n",
1325 (long long)(int)offsetof(struct obd_ioobj, ioo_gr));
1326 LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_gr) == 8, " found %lld\n",
1327 (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_gr));
1328 LASSERTF((int)offsetof(struct obd_ioobj, ioo_type) == 16, " found %lld\n",
1329 (long long)(int)offsetof(struct obd_ioobj, ioo_type));
1330 LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_type) == 4, " found %lld\n",
1331 (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_type));
1332 LASSERTF((int)offsetof(struct obd_ioobj, ioo_bufcnt) == 20, " found %lld\n",
1333 (long long)(int)offsetof(struct obd_ioobj, ioo_bufcnt));
1334 LASSERTF((int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt) == 4, " found %lld\n",
1335 (long long)(int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt));
1337 /* Checks for struct niobuf_remote */
1338 LASSERTF((int)sizeof(struct niobuf_remote) == 16, " found %lld\n",
1339 (long long)(int)sizeof(struct niobuf_remote));
1340 LASSERTF((int)offsetof(struct niobuf_remote, offset) == 0, " found %lld\n",
1341 (long long)(int)offsetof(struct niobuf_remote, offset));
1342 LASSERTF((int)sizeof(((struct niobuf_remote *)0)->offset) == 8, " found %lld\n",
1343 (long long)(int)sizeof(((struct niobuf_remote *)0)->offset));
1344 LASSERTF((int)offsetof(struct niobuf_remote, len) == 8, " found %lld\n",
1345 (long long)(int)offsetof(struct niobuf_remote, len));
1346 LASSERTF((int)sizeof(((struct niobuf_remote *)0)->len) == 4, " found %lld\n",
1347 (long long)(int)sizeof(((struct niobuf_remote *)0)->len));
1348 LASSERTF((int)offsetof(struct niobuf_remote, flags) == 12, " found %lld\n",
1349 (long long)(int)offsetof(struct niobuf_remote, flags));
1350 LASSERTF((int)sizeof(((struct niobuf_remote *)0)->flags) == 4, " found %lld\n",
1351 (long long)(int)sizeof(((struct niobuf_remote *)0)->flags));
1352 LASSERTF(OBD_BRW_READ == 1, " found %lld\n",
1353 (long long)OBD_BRW_READ);
1354 LASSERTF(OBD_BRW_WRITE == 2, " found %lld\n",
1355 (long long)OBD_BRW_WRITE);
1356 LASSERTF(OBD_BRW_SYNC == 8, " found %lld\n",
1357 (long long)OBD_BRW_SYNC);
1358 LASSERTF(OBD_BRW_FROM_GRANT == 32, " found %lld\n",
1359 (long long)OBD_BRW_FROM_GRANT);
1361 /* Checks for struct ost_body */
1362 LASSERTF((int)sizeof(struct ost_body) == 176, " found %lld\n",
1363 (long long)(int)sizeof(struct ost_body));
1364 LASSERTF((int)offsetof(struct ost_body, oa) == 0, " found %lld\n",
1365 (long long)(int)offsetof(struct ost_body, oa));
1366 LASSERTF((int)sizeof(((struct ost_body *)0)->oa) == 176, " found %lld\n",
1367 (long long)(int)sizeof(((struct ost_body *)0)->oa));
1369 /* Checks for struct ll_fid */
1370 LASSERTF((int)sizeof(struct ll_fid) == 24, " found %lld\n",
1371 (long long)(int)sizeof(struct ll_fid));
1372 LASSERTF((int)offsetof(struct ll_fid, id) == 0, " found %lld\n",
1373 (long long)(int)offsetof(struct ll_fid, id));
1374 LASSERTF((int)sizeof(((struct ll_fid *)0)->id) == 8, " found %lld\n",
1375 (long long)(int)sizeof(((struct ll_fid *)0)->id));
1376 LASSERTF((int)offsetof(struct ll_fid, generation) == 8, " found %lld\n",
1377 (long long)(int)offsetof(struct ll_fid, generation));
1378 LASSERTF((int)sizeof(((struct ll_fid *)0)->generation) == 4, " found %lld\n",
1379 (long long)(int)sizeof(((struct ll_fid *)0)->generation));
1380 LASSERTF((int)offsetof(struct ll_fid, f_type) == 12, " found %lld\n",
1381 (long long)(int)offsetof(struct ll_fid, f_type));
1382 LASSERTF((int)sizeof(((struct ll_fid *)0)->f_type) == 4, " found %lld\n",
1383 (long long)(int)sizeof(((struct ll_fid *)0)->f_type));
1385 /* Checks for struct mds_status_req */
1386 LASSERTF((int)sizeof(struct mds_status_req) == 8, " found %lld\n",
1387 (long long)(int)sizeof(struct mds_status_req));
1388 LASSERTF((int)offsetof(struct mds_status_req, flags) == 0, " found %lld\n",
1389 (long long)(int)offsetof(struct mds_status_req, flags));
1390 LASSERTF((int)sizeof(((struct mds_status_req *)0)->flags) == 4, " found %lld\n",
1391 (long long)(int)sizeof(((struct mds_status_req *)0)->flags));
1392 LASSERTF((int)offsetof(struct mds_status_req, repbuf) == 4, " found %lld\n",
1393 (long long)(int)offsetof(struct mds_status_req, repbuf));
1394 LASSERTF((int)sizeof(((struct mds_status_req *)0)->repbuf) == 4, " found %lld\n",
1395 (long long)(int)sizeof(((struct mds_status_req *)0)->repbuf));
1397 /* Checks for struct mds_body */
1398 LASSERTF((int)sizeof(struct mds_body) == 136, " found %lld\n",
1399 (long long)(int)sizeof(struct mds_body));
1400 LASSERTF((int)offsetof(struct mds_body, fid1) == 0, " found %lld\n",
1401 (long long)(int)offsetof(struct mds_body, fid1));
1402 LASSERTF((int)sizeof(((struct mds_body *)0)->fid1) == 24, " found %lld\n",
1403 (long long)(int)sizeof(((struct mds_body *)0)->fid1));
1404 LASSERTF((int)offsetof(struct mds_body, fid2) == 24, " found %lld\n",
1405 (long long)(int)offsetof(struct mds_body, fid2));
1406 LASSERTF((int)sizeof(((struct mds_body *)0)->fid2) == 24, " found %lld\n",
1407 (long long)(int)sizeof(((struct mds_body *)0)->fid2));
1408 LASSERTF((int)offsetof(struct mds_body, handle) == 48, " found %lld\n",
1409 (long long)(int)offsetof(struct mds_body, handle));
1410 LASSERTF((int)sizeof(((struct mds_body *)0)->handle) == 8, " found %lld\n",
1411 (long long)(int)sizeof(((struct mds_body *)0)->handle));
1412 LASSERTF((int)offsetof(struct mds_body, size) == 56, " found %lld\n",
1413 (long long)(int)offsetof(struct mds_body, size));
1414 LASSERTF((int)sizeof(((struct mds_body *)0)->size) == 8, " found %lld\n",
1415 (long long)(int)sizeof(((struct mds_body *)0)->size));
1416 LASSERTF((int)offsetof(struct mds_body, blocks) == 64, " found %lld\n",
1417 (long long)(int)offsetof(struct mds_body, blocks));
1418 LASSERTF((int)sizeof(((struct mds_body *)0)->blocks) == 8, " found %lld\n",
1419 (long long)(int)sizeof(((struct mds_body *)0)->blocks));
1420 LASSERTF((int)offsetof(struct mds_body, io_epoch) == 72, " found %lld\n",
1421 (long long)(int)offsetof(struct mds_body, io_epoch));
1422 LASSERTF((int)sizeof(((struct mds_body *)0)->io_epoch) == 8, " found %lld\n",
1423 (long long)(int)sizeof(((struct mds_body *)0)->io_epoch));
1424 LASSERTF((int)offsetof(struct mds_body, ino) == 80, " found %lld\n",
1425 (long long)(int)offsetof(struct mds_body, ino));
1426 LASSERTF((int)sizeof(((struct mds_body *)0)->ino) == 4, " found %lld\n",
1427 (long long)(int)sizeof(((struct mds_body *)0)->ino));
1428 LASSERTF((int)offsetof(struct mds_body, valid) == 84, " found %lld\n",
1429 (long long)(int)offsetof(struct mds_body, valid));
1430 LASSERTF((int)sizeof(((struct mds_body *)0)->valid) == 4, " found %lld\n",
1431 (long long)(int)sizeof(((struct mds_body *)0)->valid));
1432 LASSERTF((int)offsetof(struct mds_body, mode) == 88, " found %lld\n",
1433 (long long)(int)offsetof(struct mds_body, mode));
1434 LASSERTF((int)sizeof(((struct mds_body *)0)->mode) == 4, " found %lld\n",
1435 (long long)(int)sizeof(((struct mds_body *)0)->mode));
1436 LASSERTF((int)offsetof(struct mds_body, uid) == 92, " found %lld\n",
1437 (long long)(int)offsetof(struct mds_body, uid));
1438 LASSERTF((int)sizeof(((struct mds_body *)0)->uid) == 4, " found %lld\n",
1439 (long long)(int)sizeof(((struct mds_body *)0)->uid));
1440 LASSERTF((int)offsetof(struct mds_body, gid) == 96, " found %lld\n",
1441 (long long)(int)offsetof(struct mds_body, gid));
1442 LASSERTF((int)sizeof(((struct mds_body *)0)->gid) == 4, " found %lld\n",
1443 (long long)(int)sizeof(((struct mds_body *)0)->gid));
1444 LASSERTF((int)offsetof(struct mds_body, mtime) == 100, " found %lld\n",
1445 (long long)(int)offsetof(struct mds_body, mtime));
1446 LASSERTF((int)sizeof(((struct mds_body *)0)->mtime) == 4, " found %lld\n",
1447 (long long)(int)sizeof(((struct mds_body *)0)->mtime));
1448 LASSERTF((int)offsetof(struct mds_body, ctime) == 104, " found %lld\n",
1449 (long long)(int)offsetof(struct mds_body, ctime));
1450 LASSERTF((int)sizeof(((struct mds_body *)0)->ctime) == 4, " found %lld\n",
1451 (long long)(int)sizeof(((struct mds_body *)0)->ctime));
1452 LASSERTF((int)offsetof(struct mds_body, atime) == 108, " found %lld\n",
1453 (long long)(int)offsetof(struct mds_body, atime));
1454 LASSERTF((int)sizeof(((struct mds_body *)0)->atime) == 4, " found %lld\n",
1455 (long long)(int)sizeof(((struct mds_body *)0)->atime));
1456 LASSERTF((int)offsetof(struct mds_body, flags) == 112, " found %lld\n",
1457 (long long)(int)offsetof(struct mds_body, flags));
1458 LASSERTF((int)sizeof(((struct mds_body *)0)->flags) == 4, " found %lld\n",
1459 (long long)(int)sizeof(((struct mds_body *)0)->flags));
1460 LASSERTF((int)offsetof(struct mds_body, rdev) == 116, " found %lld\n",
1461 (long long)(int)offsetof(struct mds_body, rdev));
1462 LASSERTF((int)sizeof(((struct mds_body *)0)->rdev) == 4, " found %lld\n",
1463 (long long)(int)sizeof(((struct mds_body *)0)->rdev));
1464 LASSERTF((int)offsetof(struct mds_body, nlink) == 120, " found %lld\n",
1465 (long long)(int)offsetof(struct mds_body, nlink));
1466 LASSERTF((int)sizeof(((struct mds_body *)0)->nlink) == 4, " found %lld\n",
1467 (long long)(int)sizeof(((struct mds_body *)0)->nlink));
1468 LASSERTF((int)offsetof(struct mds_body, generation) == 124, " found %lld\n",
1469 (long long)(int)offsetof(struct mds_body, generation));
1470 LASSERTF((int)sizeof(((struct mds_body *)0)->generation) == 4, " found %lld\n",
1471 (long long)(int)sizeof(((struct mds_body *)0)->generation));
1472 LASSERTF((int)offsetof(struct mds_body, eadatasize) == 128, " found %lld\n",
1473 (long long)(int)offsetof(struct mds_body, eadatasize));
1474 LASSERTF((int)sizeof(((struct mds_body *)0)->eadatasize) == 4, " found %lld\n",
1475 (long long)(int)sizeof(((struct mds_body *)0)->eadatasize));
1476 LASSERTF((int)offsetof(struct mds_body, mds) == 132, " found %lld\n",
1477 (long long)(int)offsetof(struct mds_body, mds));
1478 LASSERTF((int)sizeof(((struct mds_body *)0)->mds) == 4, " found %lld\n",
1479 (long long)(int)sizeof(((struct mds_body *)0)->mds));
1480 LASSERTF(FMODE_READ == 1, " found %lld\n",
1481 (long long)FMODE_READ);
1482 LASSERTF(FMODE_WRITE == 2, " found %lld\n",
1483 (long long)FMODE_WRITE);
1484 LASSERTF(FMODE_EXEC == 4, " found %lld\n",
1485 (long long)FMODE_EXEC);
1486 LASSERTF(MDS_OPEN_CREAT == 64, " found %lld\n",
1487 (long long)MDS_OPEN_CREAT);
1488 LASSERTF(MDS_OPEN_EXCL == 128, " found %lld\n",
1489 (long long)MDS_OPEN_EXCL);
1490 LASSERTF(MDS_OPEN_TRUNC == 512, " found %lld\n",
1491 (long long)MDS_OPEN_TRUNC);
1492 LASSERTF(MDS_OPEN_APPEND == 1024, " found %lld\n",
1493 (long long)MDS_OPEN_APPEND);
1494 LASSERTF(MDS_OPEN_SYNC == 4096, " found %lld\n",
1495 (long long)MDS_OPEN_SYNC);
1496 LASSERTF(MDS_OPEN_DIRECTORY == 65536, " found %lld\n",
1497 (long long)MDS_OPEN_DIRECTORY);
1498 LASSERTF(MDS_OPEN_DELAY_CREATE == 16777216, " found %lld\n",
1499 (long long)MDS_OPEN_DELAY_CREATE);
1500 LASSERTF(MDS_OPEN_HAS_EA == 1073741824, " found %lld\n",
1501 (long long)MDS_OPEN_HAS_EA);
1503 /* Checks for struct mds_rec_setattr */
1504 LASSERTF((int)sizeof(struct mds_rec_setattr) == 80, " found %lld\n",
1505 (long long)(int)sizeof(struct mds_rec_setattr));
1506 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_opcode) == 0, " found %lld\n",
1507 (long long)(int)offsetof(struct mds_rec_setattr, sa_opcode));
1508 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_opcode) == 4, " found %lld\n",
1509 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_opcode));
1510 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_valid) == 4, " found %lld\n",
1511 (long long)(int)offsetof(struct mds_rec_setattr, sa_valid));
1512 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_valid) == 4, " found %lld\n",
1513 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_valid));
1514 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_fid) == 8, " found %lld\n",
1515 (long long)(int)offsetof(struct mds_rec_setattr, sa_fid));
1516 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_fid) == 24, " found %lld\n",
1517 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_fid));
1518 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_mode) == 32, " found %lld\n",
1519 (long long)(int)offsetof(struct mds_rec_setattr, sa_mode));
1520 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_mode) == 4, " found %lld\n",
1521 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_mode));
1522 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_uid) == 36, " found %lld\n",
1523 (long long)(int)offsetof(struct mds_rec_setattr, sa_uid));
1524 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_uid) == 4, " found %lld\n",
1525 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_uid));
1526 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_gid) == 40, " found %lld\n",
1527 (long long)(int)offsetof(struct mds_rec_setattr, sa_gid));
1528 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_gid) == 4, " found %lld\n",
1529 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_gid));
1530 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_attr_flags) == 44, " found %lld\n",
1531 (long long)(int)offsetof(struct mds_rec_setattr, sa_attr_flags));
1532 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags) == 4, " found %lld\n",
1533 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags));
1534 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_size) == 48, " found %lld\n",
1535 (long long)(int)offsetof(struct mds_rec_setattr, sa_size));
1536 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_size) == 8, " found %lld\n",
1537 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_size));
1538 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_atime) == 56, " found %lld\n",
1539 (long long)(int)offsetof(struct mds_rec_setattr, sa_atime));
1540 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_atime) == 8, " found %lld\n",
1541 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_atime));
1542 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_mtime) == 64, " found %lld\n",
1543 (long long)(int)offsetof(struct mds_rec_setattr, sa_mtime));
1544 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_mtime) == 8, " found %lld\n",
1545 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_mtime));
1546 LASSERTF((int)offsetof(struct mds_rec_setattr, sa_ctime) == 72, " found %lld\n",
1547 (long long)(int)offsetof(struct mds_rec_setattr, sa_ctime));
1548 LASSERTF((int)sizeof(((struct mds_rec_setattr *)0)->sa_ctime) == 8, " found %lld\n",
1549 (long long)(int)sizeof(((struct mds_rec_setattr *)0)->sa_ctime));
1551 /* Checks for struct mds_rec_create */
1552 LASSERTF((int)sizeof(struct mds_rec_create) == 80, " found %lld\n",
1553 (long long)(int)sizeof(struct mds_rec_create));
1554 LASSERTF((int)offsetof(struct mds_rec_create, cr_opcode) == 0, " found %lld\n",
1555 (long long)(int)offsetof(struct mds_rec_create, cr_opcode));
1556 LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_opcode) == 4, " found %lld\n",
1557 (long long)(int)sizeof(((struct mds_rec_create *)0)->cr_opcode));
1558 LASSERTF((int)offsetof(struct mds_rec_create, cr_flags) == 4, " found %lld\n",
1559 (long long)(int)offsetof(struct mds_rec_create, cr_flags));
1560 LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_flags) == 4, " found %lld\n",
1561 (long long)(int)sizeof(((struct mds_rec_create *)0)->cr_flags));
1562 LASSERTF((int)offsetof(struct mds_rec_create, cr_mode) == 8, " found %lld\n",
1563 (long long)(int)offsetof(struct mds_rec_create, cr_mode));
1564 LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_mode) == 4, " found %lld\n",
1565 (long long)(int)sizeof(((struct mds_rec_create *)0)->cr_mode));
1566 LASSERTF((int)offsetof(struct mds_rec_create, cr_padding) == 12, " found %lld\n",
1567 (long long)(int)offsetof(struct mds_rec_create, cr_padding));
1568 LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_padding) == 4, " found %lld\n",
1569 (long long)(int)sizeof(((struct mds_rec_create *)0)->cr_padding));
1570 LASSERTF((int)offsetof(struct mds_rec_create, cr_fid) == 16, " found %lld\n",
1571 (long long)(int)offsetof(struct mds_rec_create, cr_fid));
1572 LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_fid) == 24, " found %lld\n",
1573 (long long)(int)sizeof(((struct mds_rec_create *)0)->cr_fid));
1574 LASSERTF((int)offsetof(struct mds_rec_create, cr_replayfid) == 40, " found %lld\n",
1575 (long long)(int)offsetof(struct mds_rec_create, cr_replayfid));
1576 LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_replayfid) == 24, " found %lld\n",
1577 (long long)(int)sizeof(((struct mds_rec_create *)0)->cr_replayfid));
1578 LASSERTF((int)offsetof(struct mds_rec_create, cr_time) == 64, " found %lld\n",
1579 (long long)(int)offsetof(struct mds_rec_create, cr_time));
1580 LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_time) == 8, " found %lld\n",
1581 (long long)(int)sizeof(((struct mds_rec_create *)0)->cr_time));
1582 LASSERTF((int)offsetof(struct mds_rec_create, cr_rdev) == 72, " found %lld\n",
1583 (long long)(int)offsetof(struct mds_rec_create, cr_rdev));
1584 LASSERTF((int)sizeof(((struct mds_rec_create *)0)->cr_rdev) == 8, " found %lld\n",
1585 (long long)(int)sizeof(((struct mds_rec_create *)0)->cr_rdev));
1587 /* Checks for struct mds_rec_link */
1588 LASSERTF((int)sizeof(struct mds_rec_link) == 64, " found %lld\n",
1589 (long long)(int)sizeof(struct mds_rec_link));
1590 LASSERTF((int)offsetof(struct mds_rec_link, lk_opcode) == 0, " found %lld\n",
1591 (long long)(int)offsetof(struct mds_rec_link, lk_opcode));
1592 LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_opcode) == 4, " found %lld\n",
1593 (long long)(int)sizeof(((struct mds_rec_link *)0)->lk_opcode));
1594 LASSERTF((int)offsetof(struct mds_rec_link, lk_padding) == 4, " found %lld\n",
1595 (long long)(int)offsetof(struct mds_rec_link, lk_padding));
1596 LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_padding) == 4, " found %lld\n",
1597 (long long)(int)sizeof(((struct mds_rec_link *)0)->lk_padding));
1598 LASSERTF((int)offsetof(struct mds_rec_link, lk_fid1) == 8, " found %lld\n",
1599 (long long)(int)offsetof(struct mds_rec_link, lk_fid1));
1600 LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_fid1) == 24, " found %lld\n",
1601 (long long)(int)sizeof(((struct mds_rec_link *)0)->lk_fid1));
1602 LASSERTF((int)offsetof(struct mds_rec_link, lk_fid2) == 32, " found %lld\n",
1603 (long long)(int)offsetof(struct mds_rec_link, lk_fid2));
1604 LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_fid2) == 24, " found %lld\n",
1605 (long long)(int)sizeof(((struct mds_rec_link *)0)->lk_fid2));
1606 LASSERTF((int)offsetof(struct mds_rec_link, lk_time) == 56, " found %lld\n",
1607 (long long)(int)offsetof(struct mds_rec_link, lk_time));
1608 LASSERTF((int)sizeof(((struct mds_rec_link *)0)->lk_time) == 8, " found %lld\n",
1609 (long long)(int)sizeof(((struct mds_rec_link *)0)->lk_time));
1611 /* Checks for struct mds_rec_unlink */
1612 LASSERTF((int)sizeof(struct mds_rec_unlink) == 64, " found %lld\n",
1613 (long long)(int)sizeof(struct mds_rec_unlink));
1614 LASSERTF((int)offsetof(struct mds_rec_unlink, ul_opcode) == 0, " found %lld\n",
1615 (long long)(int)offsetof(struct mds_rec_unlink, ul_opcode));
1616 LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_opcode) == 4, " found %lld\n",
1617 (long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_opcode));
1618 LASSERTF((int)offsetof(struct mds_rec_unlink, ul_mode) == 4, " found %lld\n",
1619 (long long)(int)offsetof(struct mds_rec_unlink, ul_mode));
1620 LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_mode) == 4, " found %lld\n",
1621 (long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_mode));
1622 LASSERTF((int)offsetof(struct mds_rec_unlink, ul_fid1) == 8, " found %lld\n",
1623 (long long)(int)offsetof(struct mds_rec_unlink, ul_fid1));
1624 LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_fid1) == 24, " found %lld\n",
1625 (long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_fid1));
1626 LASSERTF((int)offsetof(struct mds_rec_unlink, ul_fid2) == 32, " found %lld\n",
1627 (long long)(int)offsetof(struct mds_rec_unlink, ul_fid2));
1628 LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_fid2) == 24, " found %lld\n",
1629 (long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_fid2));
1630 LASSERTF((int)offsetof(struct mds_rec_unlink, ul_time) == 56, " found %lld\n",
1631 (long long)(int)offsetof(struct mds_rec_unlink, ul_time));
1632 LASSERTF((int)sizeof(((struct mds_rec_unlink *)0)->ul_time) == 8, " found %lld\n",
1633 (long long)(int)sizeof(((struct mds_rec_unlink *)0)->ul_time));
1635 /* Checks for struct mds_rec_rename */
1636 LASSERTF((int)sizeof(struct mds_rec_rename) == 64, " found %lld\n",
1637 (long long)(int)sizeof(struct mds_rec_rename));
1638 LASSERTF((int)offsetof(struct mds_rec_rename, rn_opcode) == 0, " found %lld\n",
1639 (long long)(int)offsetof(struct mds_rec_rename, rn_opcode));
1640 LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_opcode) == 4, " found %lld\n",
1641 (long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_opcode));
1642 LASSERTF((int)offsetof(struct mds_rec_rename, rn_padding) == 4, " found %lld\n",
1643 (long long)(int)offsetof(struct mds_rec_rename, rn_padding));
1644 LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_padding) == 4, " found %lld\n",
1645 (long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_padding));
1646 LASSERTF((int)offsetof(struct mds_rec_rename, rn_fid1) == 8, " found %lld\n",
1647 (long long)(int)offsetof(struct mds_rec_rename, rn_fid1));
1648 LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_fid1) == 24, " found %lld\n",
1649 (long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_fid1));
1650 LASSERTF((int)offsetof(struct mds_rec_rename, rn_fid2) == 32, " found %lld\n",
1651 (long long)(int)offsetof(struct mds_rec_rename, rn_fid2));
1652 LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_fid2) == 24, " found %lld\n",
1653 (long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_fid2));
1654 LASSERTF((int)offsetof(struct mds_rec_rename, rn_time) == 56, " found %lld\n",
1655 (long long)(int)offsetof(struct mds_rec_rename, rn_time));
1656 LASSERTF((int)sizeof(((struct mds_rec_rename *)0)->rn_time) == 8, " found %lld\n",
1657 (long long)(int)sizeof(((struct mds_rec_rename *)0)->rn_time));
1659 /* Checks for struct lov_desc */
1660 LASSERTF((int)sizeof(struct lov_desc) == 72, " found %lld\n",
1661 (long long)(int)sizeof(struct lov_desc));
1662 LASSERTF((int)offsetof(struct lov_desc, ld_tgt_count) == 0, " found %lld\n",
1663 (long long)(int)offsetof(struct lov_desc, ld_tgt_count));
1664 LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_tgt_count) == 4, " found %lld\n",
1665 (long long)(int)sizeof(((struct lov_desc *)0)->ld_tgt_count));
1666 LASSERTF((int)offsetof(struct lov_desc, ld_active_tgt_count) == 4, " found %lld\n",
1667 (long long)(int)offsetof(struct lov_desc, ld_active_tgt_count));
1668 LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_active_tgt_count) == 4, " found %lld\n",
1669 (long long)(int)sizeof(((struct lov_desc *)0)->ld_active_tgt_count));
1670 LASSERTF((int)offsetof(struct lov_desc, ld_default_stripe_count) == 8, " found %lld\n",
1671 (long long)(int)offsetof(struct lov_desc, ld_default_stripe_count));
1672 LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_count) == 4, " found %lld\n",
1673 (long long)(int)sizeof(((struct lov_desc *)0)->ld_default_stripe_count));
1674 LASSERTF((int)offsetof(struct lov_desc, ld_pattern) == 12, " found %lld\n",
1675 (long long)(int)offsetof(struct lov_desc, ld_pattern));
1676 LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_pattern) == 4, " found %lld\n",
1677 (long long)(int)sizeof(((struct lov_desc *)0)->ld_pattern));
1678 LASSERTF((int)offsetof(struct lov_desc, ld_default_stripe_size) == 16, " found %lld\n",
1679 (long long)(int)offsetof(struct lov_desc, ld_default_stripe_size));
1680 LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_size) == 8, " found %lld\n",
1681 (long long)(int)sizeof(((struct lov_desc *)0)->ld_default_stripe_size));
1682 LASSERTF((int)offsetof(struct lov_desc, ld_default_stripe_offset) == 24, " found %lld\n",
1683 (long long)(int)offsetof(struct lov_desc, ld_default_stripe_offset));
1684 LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_offset) == 8, " found %lld\n",
1685 (long long)(int)sizeof(((struct lov_desc *)0)->ld_default_stripe_offset));
1686 LASSERTF((int)offsetof(struct lov_desc, ld_uuid) == 32, " found %lld\n",
1687 (long long)(int)offsetof(struct lov_desc, ld_uuid));
1688 LASSERTF((int)sizeof(((struct lov_desc *)0)->ld_uuid) == 40, " found %lld\n",
1689 (long long)(int)sizeof(((struct lov_desc *)0)->ld_uuid));
1691 /* Checks for struct ldlm_res_id */
1692 LASSERTF((int)sizeof(struct ldlm_res_id) == 32, " found %lld\n",
1693 (long long)(int)sizeof(struct ldlm_res_id));
1694 LASSERTF((int)offsetof(struct ldlm_res_id, name[4]) == 32, " found %lld\n",
1695 (long long)(int)offsetof(struct ldlm_res_id, name[4]));
1696 LASSERTF((int)sizeof(((struct ldlm_res_id *)0)->name[4]) == 8, " found %lld\n",
1697 (long long)(int)sizeof(((struct ldlm_res_id *)0)->name[4]));
1699 /* Checks for struct ldlm_extent */
1700 LASSERTF((int)sizeof(struct ldlm_extent) == 24, " found %lld\n",
1701 (long long)(int)sizeof(struct ldlm_extent));
1702 LASSERTF((int)offsetof(struct ldlm_extent, start) == 0, " found %lld\n",
1703 (long long)(int)offsetof(struct ldlm_extent, start));
1704 LASSERTF((int)sizeof(((struct ldlm_extent *)0)->start) == 8, " found %lld\n",
1705 (long long)(int)sizeof(((struct ldlm_extent *)0)->start));
1706 LASSERTF((int)offsetof(struct ldlm_extent, end) == 8, " found %lld\n",
1707 (long long)(int)offsetof(struct ldlm_extent, end));
1708 LASSERTF((int)sizeof(((struct ldlm_extent *)0)->end) == 8, " found %lld\n",
1709 (long long)(int)sizeof(((struct ldlm_extent *)0)->end));
1710 LASSERTF((int)offsetof(struct ldlm_extent, gid) == 16, " found %lld\n",
1711 (long long)(int)offsetof(struct ldlm_extent, gid));
1712 LASSERTF((int)sizeof(((struct ldlm_extent *)0)->gid) == 8, " found %lld\n",
1713 (long long)(int)sizeof(((struct ldlm_extent *)0)->gid));
1715 /* Checks for struct ldlm_flock */
1716 LASSERTF((int)sizeof(struct ldlm_flock) == 40, " found %lld\n",
1717 (long long)(int)sizeof(struct ldlm_flock));
1718 LASSERTF((int)offsetof(struct ldlm_flock, start) == 0, " found %lld\n",
1719 (long long)(int)offsetof(struct ldlm_flock, start));
1720 LASSERTF((int)sizeof(((struct ldlm_flock *)0)->start) == 8, " found %lld\n",
1721 (long long)(int)sizeof(((struct ldlm_flock *)0)->start));
1722 LASSERTF((int)offsetof(struct ldlm_flock, end) == 8, " found %lld\n",
1723 (long long)(int)offsetof(struct ldlm_flock, end));
1724 LASSERTF((int)sizeof(((struct ldlm_flock *)0)->end) == 8, " found %lld\n",
1725 (long long)(int)sizeof(((struct ldlm_flock *)0)->end));
1726 LASSERTF((int)offsetof(struct ldlm_flock, pid) == 16, " found %lld\n",
1727 (long long)(int)offsetof(struct ldlm_flock, pid));
1728 LASSERTF((int)sizeof(((struct ldlm_flock *)0)->pid) == 8, " found %lld\n",
1729 (long long)(int)sizeof(((struct ldlm_flock *)0)->pid));
1730 LASSERTF((int)offsetof(struct ldlm_flock, blocking_pid) == 24, " found %lld\n",
1731 (long long)(int)offsetof(struct ldlm_flock, blocking_pid));
1732 LASSERTF((int)sizeof(((struct ldlm_flock *)0)->blocking_pid) == 8, " found %lld\n",
1733 (long long)(int)sizeof(((struct ldlm_flock *)0)->blocking_pid));
1734 LASSERTF((int)offsetof(struct ldlm_flock, blocking_export) == 32, " found %lld\n",
1735 (long long)(int)offsetof(struct ldlm_flock, blocking_export));
1736 LASSERTF((int)sizeof(((struct ldlm_flock *)0)->blocking_export) == 8, " found %lld\n",
1737 (long long)(int)sizeof(((struct ldlm_flock *)0)->blocking_export));
1739 /* Checks for struct ldlm_intent */
1740 LASSERTF((int)sizeof(struct ldlm_intent) == 8, " found %lld\n",
1741 (long long)(int)sizeof(struct ldlm_intent));
1742 LASSERTF((int)offsetof(struct ldlm_intent, opc) == 0, " found %lld\n",
1743 (long long)(int)offsetof(struct ldlm_intent, opc));
1744 LASSERTF((int)sizeof(((struct ldlm_intent *)0)->opc) == 8, " found %lld\n",
1745 (long long)(int)sizeof(((struct ldlm_intent *)0)->opc));
1747 /* Checks for struct ldlm_resource_desc */
1748 LASSERTF((int)sizeof(struct ldlm_resource_desc) == 40, " found %lld\n",
1749 (long long)(int)sizeof(struct ldlm_resource_desc));
1750 LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_type) == 0, " found %lld\n",
1751 (long long)(int)offsetof(struct ldlm_resource_desc, lr_type));
1752 LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_type) == 4, " found %lld\n",
1753 (long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_type));
1754 LASSERTF((int)offsetof(struct ldlm_resource_desc, lr_name) == 8, " found %lld\n",
1755 (long long)(int)offsetof(struct ldlm_resource_desc, lr_name));
1756 LASSERTF((int)sizeof(((struct ldlm_resource_desc *)0)->lr_name) == 32, " found %lld\n",
1757 (long long)(int)sizeof(((struct ldlm_resource_desc *)0)->lr_name));
1759 /* Checks for struct ldlm_lock_desc */
1760 LASSERTF((int)sizeof(struct ldlm_lock_desc) == 88, " found %lld\n",
1761 (long long)(int)sizeof(struct ldlm_lock_desc));
1762 LASSERTF((int)offsetof(struct ldlm_lock_desc, l_resource) == 0, " found %lld\n",
1763 (long long)(int)offsetof(struct ldlm_lock_desc, l_resource));
1764 LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_resource) == 40, " found %lld\n",
1765 (long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_resource));
1766 LASSERTF((int)offsetof(struct ldlm_lock_desc, l_req_mode) == 40, " found %lld\n",
1767 (long long)(int)offsetof(struct ldlm_lock_desc, l_req_mode));
1768 LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_req_mode) == 4, " found %lld\n",
1769 (long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_req_mode));
1770 LASSERTF((int)offsetof(struct ldlm_lock_desc, l_granted_mode) == 44, " found %lld\n",
1771 (long long)(int)offsetof(struct ldlm_lock_desc, l_granted_mode));
1772 LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_granted_mode) == 4, " found %lld\n",
1773 (long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_granted_mode));
1774 LASSERTF((int)offsetof(struct ldlm_lock_desc, l_policy_data) == 48, " found %lld\n",
1775 (long long)(int)offsetof(struct ldlm_lock_desc, l_policy_data));
1776 LASSERTF((int)sizeof(((struct ldlm_lock_desc *)0)->l_policy_data) == 40, " found %lld\n",
1777 (long long)(int)sizeof(((struct ldlm_lock_desc *)0)->l_policy_data));
1779 /* Checks for struct ldlm_request */
1780 LASSERTF((int)sizeof(struct ldlm_request) == 112, " found %lld\n",
1781 (long long)(int)sizeof(struct ldlm_request));
1782 LASSERTF((int)offsetof(struct ldlm_request, lock_flags) == 0, " found %lld\n",
1783 (long long)(int)offsetof(struct ldlm_request, lock_flags));
1784 LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_flags) == 4, " found %lld\n",
1785 (long long)(int)sizeof(((struct ldlm_request *)0)->lock_flags));
1786 LASSERTF((int)offsetof(struct ldlm_request, lock_desc) == 8, " found %lld\n",
1787 (long long)(int)offsetof(struct ldlm_request, lock_desc));
1788 LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_desc) == 88, " found %lld\n",
1789 (long long)(int)sizeof(((struct ldlm_request *)0)->lock_desc));
1790 LASSERTF((int)offsetof(struct ldlm_request, lock_handle1) == 96, " found %lld\n",
1791 (long long)(int)offsetof(struct ldlm_request, lock_handle1));
1792 LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_handle1) == 8, " found %lld\n",
1793 (long long)(int)sizeof(((struct ldlm_request *)0)->lock_handle1));
1794 LASSERTF((int)offsetof(struct ldlm_request, lock_handle2) == 104, " found %lld\n",
1795 (long long)(int)offsetof(struct ldlm_request, lock_handle2));
1796 LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_handle2) == 8, " found %lld\n",
1797 (long long)(int)sizeof(((struct ldlm_request *)0)->lock_handle2));
1799 /* Checks for struct ldlm_reply */
1800 LASSERTF((int)sizeof(struct ldlm_reply) == 120, " found %lld\n",
1801 (long long)(int)sizeof(struct ldlm_reply));
1802 LASSERTF((int)offsetof(struct ldlm_reply, lock_flags) == 0, " found %lld\n",
1803 (long long)(int)offsetof(struct ldlm_reply, lock_flags));
1804 LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_flags) == 4, " found %lld\n",
1805 (long long)(int)sizeof(((struct ldlm_reply *)0)->lock_flags));
1806 LASSERTF((int)offsetof(struct ldlm_request, lock_desc) == 8, " found %lld\n",
1807 (long long)(int)offsetof(struct ldlm_request, lock_desc));
1808 LASSERTF((int)sizeof(((struct ldlm_request *)0)->lock_desc) == 88, " found %lld\n",
1809 (long long)(int)sizeof(((struct ldlm_request *)0)->lock_desc));
1810 LASSERTF((int)offsetof(struct ldlm_reply, lock_handle) == 96, " found %lld\n",
1811 (long long)(int)offsetof(struct ldlm_reply, lock_handle));
1812 LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_handle) == 8, " found %lld\n",
1813 (long long)(int)sizeof(((struct ldlm_reply *)0)->lock_handle));
1814 LASSERTF((int)offsetof(struct ldlm_reply, lock_policy_res1) == 104, " found %lld\n",
1815 (long long)(int)offsetof(struct ldlm_reply, lock_policy_res1));
1816 LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res1) == 8, " found %lld\n",
1817 (long long)(int)sizeof(((struct ldlm_reply *)0)->lock_policy_res1));
1818 LASSERTF((int)offsetof(struct ldlm_reply, lock_policy_res2) == 112, " found %lld\n",
1819 (long long)(int)offsetof(struct ldlm_reply, lock_policy_res2));
1820 LASSERTF((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res2) == 8, " found %lld\n",
1821 (long long)(int)sizeof(((struct ldlm_reply *)0)->lock_policy_res2));
1823 /* Checks for struct ost_lvb */
1824 LASSERTF((int)sizeof(struct ost_lvb) == 40, " found %lld\n",
1825 (long long)(int)sizeof(struct ost_lvb));
1826 LASSERTF((int)offsetof(struct ost_lvb, lvb_size) == 0, " found %lld\n",
1827 (long long)(int)offsetof(struct ost_lvb, lvb_size));
1828 LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_size) == 8, " found %lld\n",
1829 (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_size));
1830 LASSERTF((int)offsetof(struct ost_lvb, lvb_mtime) == 8, " found %lld\n",
1831 (long long)(int)offsetof(struct ost_lvb, lvb_mtime));
1832 LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_mtime) == 8, " found %lld\n",
1833 (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_mtime));
1834 LASSERTF((int)offsetof(struct ost_lvb, lvb_atime) == 16, " found %lld\n",
1835 (long long)(int)offsetof(struct ost_lvb, lvb_atime));
1836 LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_atime) == 8, " found %lld\n",
1837 (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_atime));
1838 LASSERTF((int)offsetof(struct ost_lvb, lvb_ctime) == 24, " found %lld\n",
1839 (long long)(int)offsetof(struct ost_lvb, lvb_ctime));
1840 LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_ctime) == 8, " found %lld\n",
1841 (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_ctime));
1842 LASSERTF((int)offsetof(struct ost_lvb, lvb_blocks) == 32, " found %lld\n",
1843 (long long)(int)offsetof(struct ost_lvb, lvb_blocks));
1844 LASSERTF((int)sizeof(((struct ost_lvb *)0)->lvb_blocks) == 8, " found %lld\n",
1845 (long long)(int)sizeof(((struct ost_lvb *)0)->lvb_blocks));
1847 /* Checks for struct ptlbd_op */
1848 LASSERTF((int)sizeof(struct ptlbd_op) == 12, " found %lld\n",
1849 (long long)(int)sizeof(struct ptlbd_op));
1850 LASSERTF((int)offsetof(struct ptlbd_op, op_cmd) == 0, " found %lld\n",
1851 (long long)(int)offsetof(struct ptlbd_op, op_cmd));
1852 LASSERTF((int)sizeof(((struct ptlbd_op *)0)->op_cmd) == 2, " found %lld\n",
1853 (long long)(int)sizeof(((struct ptlbd_op *)0)->op_cmd));
1854 LASSERTF((int)offsetof(struct ptlbd_op, op_lun) == 2, " found %lld\n",
1855 (long long)(int)offsetof(struct ptlbd_op, op_lun));
1856 LASSERTF((int)sizeof(((struct ptlbd_op *)0)->op_lun) == 2, " found %lld\n",
1857 (long long)(int)sizeof(((struct ptlbd_op *)0)->op_lun));
1858 LASSERTF((int)offsetof(struct ptlbd_op, op_niob_cnt) == 4, " found %lld\n",
1859 (long long)(int)offsetof(struct ptlbd_op, op_niob_cnt));
1860 LASSERTF((int)sizeof(((struct ptlbd_op *)0)->op_niob_cnt) == 2, " found %lld\n",
1861 (long long)(int)sizeof(((struct ptlbd_op *)0)->op_niob_cnt));
1862 LASSERTF((int)offsetof(struct ptlbd_op, op__padding) == 6, " found %lld\n",
1863 (long long)(int)offsetof(struct ptlbd_op, op__padding));
1864 LASSERTF((int)sizeof(((struct ptlbd_op *)0)->op__padding) == 2, " found %lld\n",
1865 (long long)(int)sizeof(((struct ptlbd_op *)0)->op__padding));
1866 LASSERTF((int)offsetof(struct ptlbd_op, op_block_cnt) == 8, " found %lld\n",
1867 (long long)(int)offsetof(struct ptlbd_op, op_block_cnt));
1868 LASSERTF((int)sizeof(((struct ptlbd_op *)0)->op_block_cnt) == 4, " found %lld\n",
1869 (long long)(int)sizeof(((struct ptlbd_op *)0)->op_block_cnt));
1871 /* Checks for struct ptlbd_niob */
1872 LASSERTF((int)sizeof(struct ptlbd_niob) == 24, " found %lld\n",
1873 (long long)(int)sizeof(struct ptlbd_niob));
1874 LASSERTF((int)offsetof(struct ptlbd_niob, n_xid) == 0, " found %lld\n",
1875 (long long)(int)offsetof(struct ptlbd_niob, n_xid));
1876 LASSERTF((int)sizeof(((struct ptlbd_niob *)0)->n_xid) == 8, " found %lld\n",
1877 (long long)(int)sizeof(((struct ptlbd_niob *)0)->n_xid));
1878 LASSERTF((int)offsetof(struct ptlbd_niob, n_block_nr) == 8, " found %lld\n",
1879 (long long)(int)offsetof(struct ptlbd_niob, n_block_nr));
1880 LASSERTF((int)sizeof(((struct ptlbd_niob *)0)->n_block_nr) == 8, " found %lld\n",
1881 (long long)(int)sizeof(((struct ptlbd_niob *)0)->n_block_nr));
1882 LASSERTF((int)offsetof(struct ptlbd_niob, n_offset) == 16, " found %lld\n",
1883 (long long)(int)offsetof(struct ptlbd_niob, n_offset));
1884 LASSERTF((int)sizeof(((struct ptlbd_niob *)0)->n_offset) == 4, " found %lld\n",
1885 (long long)(int)sizeof(((struct ptlbd_niob *)0)->n_offset));
1886 LASSERTF((int)offsetof(struct ptlbd_niob, n_length) == 20, " found %lld\n",
1887 (long long)(int)offsetof(struct ptlbd_niob, n_length));
1888 LASSERTF((int)sizeof(((struct ptlbd_niob *)0)->n_length) == 4, " found %lld\n",
1889 (long long)(int)sizeof(((struct ptlbd_niob *)0)->n_length));
1891 /* Checks for struct ptlbd_rsp */
1892 LASSERTF((int)sizeof(struct ptlbd_rsp) == 4, " found %lld\n",
1893 (long long)(int)sizeof(struct ptlbd_rsp));
1894 LASSERTF((int)offsetof(struct ptlbd_rsp, r_status) == 0, " found %lld\n",
1895 (long long)(int)offsetof(struct ptlbd_rsp, r_status));
1896 LASSERTF((int)sizeof(((struct ptlbd_rsp *)0)->r_status) == 2, " found %lld\n",
1897 (long long)(int)sizeof(((struct ptlbd_rsp *)0)->r_status));
1898 LASSERTF((int)offsetof(struct ptlbd_rsp, r_error_cnt) == 2, " found %lld\n",
1899 (long long)(int)offsetof(struct ptlbd_rsp, r_error_cnt));
1900 LASSERTF((int)sizeof(((struct ptlbd_rsp *)0)->r_error_cnt) == 2, " found %lld\n",
1901 (long long)(int)sizeof(((struct ptlbd_rsp *)0)->r_error_cnt));
1903 /* Checks for struct llog_logid */
1904 LASSERTF((int)sizeof(struct llog_logid) == 20, " found %lld\n",
1905 (long long)(int)sizeof(struct llog_logid));
1906 LASSERTF((int)offsetof(struct llog_logid, lgl_oid) == 0, " found %lld\n",
1907 (long long)(int)offsetof(struct llog_logid, lgl_oid));
1908 LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_oid) == 8, " found %lld\n",
1909 (long long)(int)sizeof(((struct llog_logid *)0)->lgl_oid));
1910 LASSERTF((int)offsetof(struct llog_logid, lgl_ogr) == 8, " found %lld\n",
1911 (long long)(int)offsetof(struct llog_logid, lgl_ogr));
1912 LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogr) == 8, " found %lld\n",
1913 (long long)(int)sizeof(((struct llog_logid *)0)->lgl_ogr));
1914 LASSERTF((int)offsetof(struct llog_logid, lgl_ogen) == 16, " found %lld\n",
1915 (long long)(int)offsetof(struct llog_logid, lgl_ogen));
1916 LASSERTF((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4, " found %lld\n",
1917 (long long)(int)sizeof(((struct llog_logid *)0)->lgl_ogen));
1918 LASSERTF(OST_SZ_REC == 274730752, " found %lld\n",
1919 (long long)OST_SZ_REC);
1920 LASSERTF(OST_RAID1_REC == 274731008, " found %lld\n",
1921 (long long)OST_RAID1_REC);
1922 LASSERTF(MDS_UNLINK_REC == 274801668, " found %lld\n",
1923 (long long)MDS_UNLINK_REC);
1924 LASSERTF(OBD_CFG_REC == 274857984, " found %lld\n",
1925 (long long)OBD_CFG_REC);
1926 LASSERTF(PTL_CFG_REC == 274923520, " found %lld\n",
1927 (long long)PTL_CFG_REC);
1928 LASSERTF(LLOG_GEN_REC == 274989056, " found %lld\n",
1929 (long long)LLOG_GEN_REC);
1930 LASSERTF(LLOG_HDR_MAGIC == 275010873, " found %lld\n",
1931 (long long)LLOG_HDR_MAGIC);
1932 LASSERTF(LLOG_LOGID_MAGIC == 275010875, " found %lld\n",
1933 (long long)LLOG_LOGID_MAGIC);
1935 /* Checks for struct llog_catid */
1936 LASSERTF((int)sizeof(struct llog_catid) == 32, " found %lld\n",
1937 (long long)(int)sizeof(struct llog_catid));
1938 LASSERTF((int)offsetof(struct llog_catid, lci_logid) == 0, " found %lld\n",
1939 (long long)(int)offsetof(struct llog_catid, lci_logid));
1940 LASSERTF((int)sizeof(((struct llog_catid *)0)->lci_logid) == 20, " found %lld\n",
1941 (long long)(int)sizeof(((struct llog_catid *)0)->lci_logid));
1943 /* Checks for struct llog_rec_hdr */
1944 LASSERTF((int)sizeof(struct llog_rec_hdr) == 16, " found %lld\n",
1945 (long long)(int)sizeof(struct llog_rec_hdr));
1946 LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_len) == 0, " found %lld\n",
1947 (long long)(int)offsetof(struct llog_rec_hdr, lrh_len));
1948 LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_len) == 4, " found %lld\n",
1949 (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_len));
1950 LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_index) == 4, " found %lld\n",
1951 (long long)(int)offsetof(struct llog_rec_hdr, lrh_index));
1952 LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_index) == 4, " found %lld\n",
1953 (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_index));
1954 LASSERTF((int)offsetof(struct llog_rec_hdr, lrh_type) == 8, " found %lld\n",
1955 (long long)(int)offsetof(struct llog_rec_hdr, lrh_type));
1956 LASSERTF((int)sizeof(((struct llog_rec_hdr *)0)->lrh_type) == 4, " found %lld\n",
1957 (long long)(int)sizeof(((struct llog_rec_hdr *)0)->lrh_type));
1959 /* Checks for struct llog_rec_tail */
1960 LASSERTF((int)sizeof(struct llog_rec_tail) == 8, " found %lld\n",
1961 (long long)(int)sizeof(struct llog_rec_tail));
1962 LASSERTF((int)offsetof(struct llog_rec_tail, lrt_len) == 0, " found %lld\n",
1963 (long long)(int)offsetof(struct llog_rec_tail, lrt_len));
1964 LASSERTF((int)sizeof(((struct llog_rec_tail *)0)->lrt_len) == 4, " found %lld\n",
1965 (long long)(int)sizeof(((struct llog_rec_tail *)0)->lrt_len));
1966 LASSERTF((int)offsetof(struct llog_rec_tail, lrt_index) == 4, " found %lld\n",
1967 (long long)(int)offsetof(struct llog_rec_tail, lrt_index));
1968 LASSERTF((int)sizeof(((struct llog_rec_tail *)0)->lrt_index) == 4, " found %lld\n",
1969 (long long)(int)sizeof(((struct llog_rec_tail *)0)->lrt_index));
1971 /* Checks for struct llog_logid_rec */
1972 LASSERTF((int)sizeof(struct llog_logid_rec) == 64, " found %lld\n",
1973 (long long)(int)sizeof(struct llog_logid_rec));
1974 LASSERTF((int)offsetof(struct llog_logid_rec, lid_hdr) == 0, " found %lld\n",
1975 (long long)(int)offsetof(struct llog_logid_rec, lid_hdr));
1976 LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_hdr) == 16, " found %lld\n",
1977 (long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_hdr));
1978 LASSERTF((int)offsetof(struct llog_logid_rec, lid_id) == 16, " found %lld\n",
1979 (long long)(int)offsetof(struct llog_logid_rec, lid_id));
1980 LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_id) == 20, " found %lld\n",
1981 (long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_id));
1982 LASSERTF((int)offsetof(struct llog_logid_rec, lid_tail) == 56, " found %lld\n",
1983 (long long)(int)offsetof(struct llog_logid_rec, lid_tail));
1984 LASSERTF((int)sizeof(((struct llog_logid_rec *)0)->lid_tail) == 8, " found %lld\n",
1985 (long long)(int)sizeof(((struct llog_logid_rec *)0)->lid_tail));
1987 /* Checks for struct llog_create_rec */
1988 LASSERTF((int)sizeof(struct llog_create_rec) == 64, " found %lld\n",
1989 (long long)(int)sizeof(struct llog_create_rec));
1990 LASSERTF((int)offsetof(struct llog_create_rec, lcr_hdr) == 0, " found %lld\n",
1991 (long long)(int)offsetof(struct llog_create_rec, lcr_hdr));
1992 LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_hdr) == 16, " found %lld\n",
1993 (long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_hdr));
1994 LASSERTF((int)offsetof(struct llog_create_rec, lcr_fid) == 16, " found %lld\n",
1995 (long long)(int)offsetof(struct llog_create_rec, lcr_fid));
1996 LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_fid) == 24, " found %lld\n",
1997 (long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_fid));
1998 LASSERTF((int)offsetof(struct llog_create_rec, lcr_oid) == 40, " found %lld\n",
1999 (long long)(int)offsetof(struct llog_create_rec, lcr_oid));
2000 LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_oid) == 8, " found %lld\n",
2001 (long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_oid));
2002 LASSERTF((int)offsetof(struct llog_create_rec, lcr_ogen) == 48, " found %lld\n",
2003 (long long)(int)offsetof(struct llog_create_rec, lcr_ogen));
2004 LASSERTF((int)sizeof(((struct llog_create_rec *)0)->lcr_ogen) == 4, " found %lld\n",
2005 (long long)(int)sizeof(((struct llog_create_rec *)0)->lcr_ogen));
2007 /* Checks for struct llog_orphan_rec */
2008 LASSERTF((int)sizeof(struct llog_orphan_rec) == 40, " found %lld\n",
2009 (long long)(int)sizeof(struct llog_orphan_rec));
2010 LASSERTF((int)offsetof(struct llog_orphan_rec, lor_hdr) == 0, " found %lld\n",
2011 (long long)(int)offsetof(struct llog_orphan_rec, lor_hdr));
2012 LASSERTF((int)sizeof(((struct llog_orphan_rec *)0)->lor_hdr) == 16, " found %lld\n",
2013 (long long)(int)sizeof(((struct llog_orphan_rec *)0)->lor_hdr));
2014 LASSERTF((int)offsetof(struct llog_orphan_rec, lor_oid) == 16, " found %lld\n",
2015 (long long)(int)offsetof(struct llog_orphan_rec, lor_oid));
2016 LASSERTF((int)sizeof(((struct llog_orphan_rec *)0)->lor_oid) == 8, " found %lld\n",
2017 (long long)(int)sizeof(((struct llog_orphan_rec *)0)->lor_oid));
2018 LASSERTF((int)offsetof(struct llog_orphan_rec, lor_ogen) == 24, " found %lld\n",
2019 (long long)(int)offsetof(struct llog_orphan_rec, lor_ogen));
2020 LASSERTF((int)sizeof(((struct llog_orphan_rec *)0)->lor_ogen) == 4, " found %lld\n",
2021 (long long)(int)sizeof(((struct llog_orphan_rec *)0)->lor_ogen));
2022 LASSERTF((int)offsetof(struct llog_orphan_rec, lor_tail) == 32, " found %lld\n",
2023 (long long)(int)offsetof(struct llog_orphan_rec, lor_tail));
2024 LASSERTF((int)sizeof(((struct llog_orphan_rec *)0)->lor_tail) == 8, " found %lld\n",
2025 (long long)(int)sizeof(((struct llog_orphan_rec *)0)->lor_tail));
2027 /* Checks for struct llog_unlink_rec */
2028 LASSERTF((int)sizeof(struct llog_unlink_rec) == 40, " found %lld\n",
2029 (long long)(int)sizeof(struct llog_unlink_rec));
2030 LASSERTF((int)offsetof(struct llog_unlink_rec, lur_hdr) == 0, " found %lld\n",
2031 (long long)(int)offsetof(struct llog_unlink_rec, lur_hdr));
2032 LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_hdr) == 16, " found %lld\n",
2033 (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_hdr));
2034 LASSERTF((int)offsetof(struct llog_unlink_rec, lur_oid) == 16, " found %lld\n",
2035 (long long)(int)offsetof(struct llog_unlink_rec, lur_oid));
2036 LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_oid) == 8, " found %lld\n",
2037 (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_oid));
2038 LASSERTF((int)offsetof(struct llog_unlink_rec, lur_ogen) == 24, " found %lld\n",
2039 (long long)(int)offsetof(struct llog_unlink_rec, lur_ogen));
2040 LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_ogen) == 4, " found %lld\n",
2041 (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_ogen));
2042 LASSERTF((int)offsetof(struct llog_unlink_rec, lur_tail) == 32, " found %lld\n",
2043 (long long)(int)offsetof(struct llog_unlink_rec, lur_tail));
2044 LASSERTF((int)sizeof(((struct llog_unlink_rec *)0)->lur_tail) == 8, " found %lld\n",
2045 (long long)(int)sizeof(((struct llog_unlink_rec *)0)->lur_tail));
2047 /* Checks for struct llog_size_change_rec */
2048 LASSERTF((int)sizeof(struct llog_size_change_rec) == 56, " found %lld\n",
2049 (long long)(int)sizeof(struct llog_size_change_rec));
2050 LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_hdr) == 0, " found %lld\n",
2051 (long long)(int)offsetof(struct llog_size_change_rec, lsc_hdr));
2052 LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_hdr) == 16, " found %lld\n",
2053 (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_hdr));
2054 LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_fid) == 16, " found %lld\n",
2055 (long long)(int)offsetof(struct llog_size_change_rec, lsc_fid));
2056 LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_fid) == 24, " found %lld\n",
2057 (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_fid));
2058 LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_io_epoch) == 40, " found %lld\n",
2059 (long long)(int)offsetof(struct llog_size_change_rec, lsc_io_epoch));
2060 LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_io_epoch) == 4, " found %lld\n",
2061 (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_io_epoch));
2062 LASSERTF((int)offsetof(struct llog_size_change_rec, lsc_tail) == 48, " found %lld\n",
2063 (long long)(int)offsetof(struct llog_size_change_rec, lsc_tail));
2064 LASSERTF((int)sizeof(((struct llog_size_change_rec *)0)->lsc_tail) == 8, " found %lld\n",
2065 (long long)(int)sizeof(((struct llog_size_change_rec *)0)->lsc_tail));
2067 /* Checks for struct llog_gen */
2068 LASSERTF((int)sizeof(struct llog_gen) == 16, " found %lld\n",
2069 (long long)(int)sizeof(struct llog_gen));
2070 LASSERTF((int)offsetof(struct llog_gen, mnt_cnt) == 0, " found %lld\n",
2071 (long long)(int)offsetof(struct llog_gen, mnt_cnt));
2072 LASSERTF((int)sizeof(((struct llog_gen *)0)->mnt_cnt) == 8, " found %lld\n",
2073 (long long)(int)sizeof(((struct llog_gen *)0)->mnt_cnt));
2074 LASSERTF((int)offsetof(struct llog_gen, conn_cnt) == 8, " found %lld\n",
2075 (long long)(int)offsetof(struct llog_gen, conn_cnt));
2076 LASSERTF((int)sizeof(((struct llog_gen *)0)->conn_cnt) == 8, " found %lld\n",
2077 (long long)(int)sizeof(((struct llog_gen *)0)->conn_cnt));
2079 /* Checks for struct llog_gen_rec */
2080 LASSERTF((int)sizeof(struct llog_gen_rec) == 40, " found %lld\n",
2081 (long long)(int)sizeof(struct llog_gen_rec));
2082 LASSERTF((int)offsetof(struct llog_gen_rec, lgr_hdr) == 0, " found %lld\n",
2083 (long long)(int)offsetof(struct llog_gen_rec, lgr_hdr));
2084 LASSERTF((int)sizeof(((struct llog_gen_rec *)0)->lgr_hdr) == 16, " found %lld\n",
2085 (long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_hdr));
2086 LASSERTF((int)offsetof(struct llog_gen_rec, lgr_gen) == 16, " found %lld\n",
2087 (long long)(int)offsetof(struct llog_gen_rec, lgr_gen));
2088 LASSERTF((int)sizeof(((struct llog_gen_rec *)0)->lgr_gen) == 16, " found %lld\n",
2089 (long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_gen));
2090 LASSERTF((int)offsetof(struct llog_gen_rec, lgr_tail) == 32, " found %lld\n",
2091 (long long)(int)offsetof(struct llog_gen_rec, lgr_tail));
2092 LASSERTF((int)sizeof(((struct llog_gen_rec *)0)->lgr_tail) == 8, " found %lld\n",
2093 (long long)(int)sizeof(((struct llog_gen_rec *)0)->lgr_tail));
2095 /* Checks for struct llog_log_hdr */
2096 LASSERTF((int)sizeof(struct llog_log_hdr) == 8192, " found %lld\n",
2097 (long long)(int)sizeof(struct llog_log_hdr));
2098 LASSERTF((int)offsetof(struct llog_log_hdr, llh_hdr) == 0, " found %lld\n",
2099 (long long)(int)offsetof(struct llog_log_hdr, llh_hdr));
2100 LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_hdr) == 16, " found %lld\n",
2101 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_hdr));
2102 LASSERTF((int)offsetof(struct llog_log_hdr, llh_timestamp) == 16, " found %lld\n",
2103 (long long)(int)offsetof(struct llog_log_hdr, llh_timestamp));
2104 LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_timestamp) == 8, " found %lld\n",
2105 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_timestamp));
2106 LASSERTF((int)offsetof(struct llog_log_hdr, llh_count) == 24, " found %lld\n",
2107 (long long)(int)offsetof(struct llog_log_hdr, llh_count));
2108 LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_count) == 4, " found %lld\n",
2109 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_count));
2110 LASSERTF((int)offsetof(struct llog_log_hdr, llh_bitmap_offset) == 28, " found %lld\n",
2111 (long long)(int)offsetof(struct llog_log_hdr, llh_bitmap_offset));
2112 LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap_offset) == 4, " found %lld\n",
2113 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap_offset));
2114 LASSERTF((int)offsetof(struct llog_log_hdr, llh_size) == 32, " found %lld\n",
2115 (long long)(int)offsetof(struct llog_log_hdr, llh_size));
2116 LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_size) == 4, " found %lld\n",
2117 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_size));
2118 LASSERTF((int)offsetof(struct llog_log_hdr, llh_flags) == 36, " found %lld\n",
2119 (long long)(int)offsetof(struct llog_log_hdr, llh_flags));
2120 LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_flags) == 4, " found %lld\n",
2121 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_flags));
2122 LASSERTF((int)offsetof(struct llog_log_hdr, llh_cat_idx) == 40, " found %lld\n",
2123 (long long)(int)offsetof(struct llog_log_hdr, llh_cat_idx));
2124 LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_cat_idx) == 4, " found %lld\n",
2125 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_cat_idx));
2126 LASSERTF((int)offsetof(struct llog_log_hdr, llh_tgtuuid) == 44, " found %lld\n",
2127 (long long)(int)offsetof(struct llog_log_hdr, llh_tgtuuid));
2128 LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid) == 40, " found %lld\n",
2129 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid));
2130 LASSERTF((int)offsetof(struct llog_log_hdr, llh_bitmap) == 88, " found %lld\n",
2131 (long long)(int)offsetof(struct llog_log_hdr, llh_bitmap));
2132 LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 8096, " found %lld\n",
2133 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap));
2134 LASSERTF((int)offsetof(struct llog_log_hdr, llh_tail) == 8184, " found %lld\n",
2135 (long long)(int)offsetof(struct llog_log_hdr, llh_tail));
2136 LASSERTF((int)sizeof(((struct llog_log_hdr *)0)->llh_tail) == 8, " found %lld\n",
2137 (long long)(int)sizeof(((struct llog_log_hdr *)0)->llh_tail));
2139 /* Checks for struct llog_cookie */
2140 LASSERTF((int)sizeof(struct llog_cookie) == 32, " found %lld\n",
2141 (long long)(int)sizeof(struct llog_cookie));
2142 LASSERTF((int)offsetof(struct llog_cookie, lgc_lgl) == 0, " found %lld\n",
2143 (long long)(int)offsetof(struct llog_cookie, lgc_lgl));
2144 LASSERTF((int)sizeof(((struct llog_cookie *)0)->lgc_lgl) == 20, " found %lld\n",
2145 (long long)(int)sizeof(((struct llog_cookie *)0)->lgc_lgl));
2146 LASSERTF((int)offsetof(struct llog_cookie, lgc_subsys) == 20, " found %lld\n",
2147 (long long)(int)offsetof(struct llog_cookie, lgc_subsys));
2148 LASSERTF((int)sizeof(((struct llog_cookie *)0)->lgc_subsys) == 4, " found %lld\n",
2149 (long long)(int)sizeof(((struct llog_cookie *)0)->lgc_subsys));
2150 LASSERTF((int)offsetof(struct llog_cookie, lgc_index) == 24, " found %lld\n",
2151 (long long)(int)offsetof(struct llog_cookie, lgc_index));
2152 LASSERTF((int)sizeof(((struct llog_cookie *)0)->lgc_index) == 4, " found %lld\n",
2153 (long long)(int)sizeof(((struct llog_cookie *)0)->lgc_index));
2155 /* Checks for struct llogd_body */
2156 LASSERTF((int)sizeof(struct llogd_body) == 48, " found %lld\n",
2157 (long long)(int)sizeof(struct llogd_body));
2158 LASSERTF((int)offsetof(struct llogd_body, lgd_logid) == 0, " found %lld\n",
2159 (long long)(int)offsetof(struct llogd_body, lgd_logid));
2160 LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_logid) == 20, " found %lld\n",
2161 (long long)(int)sizeof(((struct llogd_body *)0)->lgd_logid));
2162 LASSERTF((int)offsetof(struct llogd_body, lgd_ctxt_idx) == 20, " found %lld\n",
2163 (long long)(int)offsetof(struct llogd_body, lgd_ctxt_idx));
2164 LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_ctxt_idx) == 4, " found %lld\n",
2165 (long long)(int)sizeof(((struct llogd_body *)0)->lgd_ctxt_idx));
2166 LASSERTF((int)offsetof(struct llogd_body, lgd_llh_flags) == 24, " found %lld\n",
2167 (long long)(int)offsetof(struct llogd_body, lgd_llh_flags));
2168 LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_llh_flags) == 4, " found %lld\n",
2169 (long long)(int)sizeof(((struct llogd_body *)0)->lgd_llh_flags));
2170 LASSERTF((int)offsetof(struct llogd_body, lgd_index) == 28, " found %lld\n",
2171 (long long)(int)offsetof(struct llogd_body, lgd_index));
2172 LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_index) == 4, " found %lld\n",
2173 (long long)(int)sizeof(((struct llogd_body *)0)->lgd_index));
2174 LASSERTF((int)offsetof(struct llogd_body, lgd_saved_index) == 32, " found %lld\n",
2175 (long long)(int)offsetof(struct llogd_body, lgd_saved_index));
2176 LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_saved_index) == 4, " found %lld\n",
2177 (long long)(int)sizeof(((struct llogd_body *)0)->lgd_saved_index));
2178 LASSERTF((int)offsetof(struct llogd_body, lgd_len) == 36, " found %lld\n",
2179 (long long)(int)offsetof(struct llogd_body, lgd_len));
2180 LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_len) == 4, " found %lld\n",
2181 (long long)(int)sizeof(((struct llogd_body *)0)->lgd_len));
2182 LASSERTF((int)offsetof(struct llogd_body, lgd_cur_offset) == 40, " found %lld\n",
2183 (long long)(int)offsetof(struct llogd_body, lgd_cur_offset));
2184 LASSERTF((int)sizeof(((struct llogd_body *)0)->lgd_cur_offset) == 8, " found %lld\n",
2185 (long long)(int)sizeof(((struct llogd_body *)0)->lgd_cur_offset));
2186 LASSERTF(LLOG_ORIGIN_HANDLE_OPEN == 501, " found %lld\n",
2187 (long long)LLOG_ORIGIN_HANDLE_OPEN);
2188 LASSERTF(LLOG_ORIGIN_HANDLE_NEXT_BLOCK == 502, " found %lld\n",
2189 (long long)LLOG_ORIGIN_HANDLE_NEXT_BLOCK);
2190 LASSERTF(LLOG_ORIGIN_HANDLE_READ_HEADER == 503, " found %lld\n",
2191 (long long)LLOG_ORIGIN_HANDLE_READ_HEADER);
2192 LASSERTF(LLOG_ORIGIN_HANDLE_WRITE_REC == 504, " found %lld\n",
2193 (long long)LLOG_ORIGIN_HANDLE_WRITE_REC);
2194 LASSERTF(LLOG_ORIGIN_HANDLE_CLOSE == 505, " found %lld\n",
2195 (long long)LLOG_ORIGIN_HANDLE_CLOSE);
2196 LASSERTF(LLOG_ORIGIN_CONNECT == 506, " found %lld\n",
2197 (long long)LLOG_ORIGIN_CONNECT);
2198 LASSERTF(LLOG_CATINFO == 507, " found %lld\n",
2199 (long long)LLOG_CATINFO);
2201 /* Checks for struct llogd_conn_body */
2202 LASSERTF((int)sizeof(struct llogd_conn_body) == 40, " found %lld\n",
2203 (long long)(int)sizeof(struct llogd_conn_body));
2204 LASSERTF((int)offsetof(struct llogd_conn_body, lgdc_gen) == 0, " found %lld\n",
2205 (long long)(int)offsetof(struct llogd_conn_body, lgdc_gen));
2206 LASSERTF((int)sizeof(((struct llogd_conn_body *)0)->lgdc_gen) == 16, " found %lld\n",
2207 (long long)(int)sizeof(((struct llogd_conn_body *)0)->lgdc_gen));
2208 LASSERTF((int)offsetof(struct llogd_conn_body, lgdc_logid) == 16, " found %lld\n",
2209 (long long)(int)offsetof(struct llogd_conn_body, lgdc_logid));
2210 LASSERTF((int)sizeof(((struct llogd_conn_body *)0)->lgdc_logid) == 20, " found %lld\n",
2211 (long long)(int)sizeof(((struct llogd_conn_body *)0)->lgdc_logid));
2212 LASSERTF((int)offsetof(struct llogd_conn_body, lgdc_ctxt_idx) == 36, " found %lld\n",
2213 (long long)(int)offsetof(struct llogd_conn_body, lgdc_ctxt_idx));
2214 LASSERTF((int)sizeof(((struct llogd_conn_body *)0)->lgdc_ctxt_idx) == 4, " found %lld\n",
2215 (long long)(int)sizeof(((struct llogd_conn_body *)0)->lgdc_ctxt_idx));