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/lustre_net.h>
37 #define HDR_SIZE(count) \
38 size_round(offsetof (struct lustre_msg, buflens[(count)]))
40 int lustre_pack_msg(int count, int *lens, char **bufs, int *len,
41 struct lustre_msg **msg)
47 size = HDR_SIZE (count);
48 for (i = 0; i < count; i++)
49 size += size_round(lens[i]);
53 OBD_ALLOC(*msg, *len);
58 m->magic = PTLRPC_MSG_MAGIC;
59 m->version = PTLRPC_MSG_VERSION;
61 for (i = 0; i < count; i++)
62 m->buflens[i] = lens[i];
64 ptr = (char *)m + HDR_SIZE(count);
65 for (i = 0; i < count; i++) {
69 LOGL(tmp, lens[i], ptr);
76 /* This returns the size of the buffer that is required to hold a lustre_msg
77 * with the given sub-buffer lengths. */
78 int lustre_msg_size(int count, int *lengths)
83 size = HDR_SIZE (count);
84 for (i = 0; i < count; i++)
85 size += size_round(lengths[i]);
90 int lustre_unpack_msg(struct lustre_msg *m, int len)
97 /* We can provide a slightly better error log, if we check the
98 * message magic and version first. In the future, struct
99 * lustre_msg may grow, and we'd like to log a version mismatch,
100 * rather than a short message.
103 required_len = MAX (offsetof (struct lustre_msg, version) +
105 offsetof (struct lustre_msg, magic) +
107 if (len < required_len) {
108 /* can't even look inside the message */
109 CERROR ("message length %d too small for magic/version check\n",
114 flipped = lustre_msg_swabbed(m);
116 __swab32s (&m->version);
117 else if (m->magic != PTLRPC_MSG_MAGIC) {
118 CERROR("wrong lustre_msg magic %#08x\n", m->magic);
122 if (m->version != PTLRPC_MSG_VERSION) {
123 CERROR("wrong lustre_msg version %#08x\n", m->version);
127 /* Now we know the sender speaks my language (but possibly flipped)...*/
128 required_len = HDR_SIZE(0);
129 if (len < required_len) {
130 /* can't even look inside the message */
131 CERROR ("message length %d too small for lustre_msg\n", len);
136 __swab32s (&m->type);
138 __swab64s (&m->last_xid);
139 __swab64s (&m->last_committed);
140 __swab64s (&m->transno);
141 __swab32s (&m->status);
142 __swab32s (&m->bufcount);
143 __swab32s (&m->flags);
146 required_len = HDR_SIZE(m->bufcount);
148 if (len < required_len) {
149 /* didn't receive all the buffer lengths */
150 CERROR ("message length %d too small for %d buflens\n",
155 for (i = 0; i < m->bufcount; i++) {
157 __swab32s (&m->buflens[i]);
158 required_len += size_round(m->buflens[i]);
161 if (len < required_len) {
162 CERROR("len: %d, required_len %d\n", len, required_len);
163 CERROR("bufcount: %d\n", m->bufcount);
164 for (i = 0; i < m->bufcount; i++)
165 CERROR("buffer %d length %d\n", i, m->buflens[i]);
172 void *lustre_msg_buf(struct lustre_msg *m, int n, int min_size)
182 bufcount = m->bufcount;
184 CDEBUG(D_INFO, "msg %p buffer[%d] not present (count %d)\n",
189 buflen = m->buflens[n];
191 CERROR("msg %p buffer[%d] is zero length\n", m, n);
195 if (buflen < min_size) {
196 CERROR("msg %p buffer[%d] size %d too small (required %d)\n",
197 m, n, buflen, min_size);
201 offset = HDR_SIZE(bufcount);
202 for (i = 0; i < n; i++)
203 offset += size_round(m->buflens[i]);
205 return (char *)m + offset;
208 char *lustre_msg_string (struct lustre_msg *m, int index, int max_len)
210 /* max_len == 0 means the string should fill the buffer */
211 char *str = lustre_msg_buf (m, index, 0);
216 CERROR ("can't unpack string in msg %p buffer[%d]\n", m, index);
220 blen = m->buflens[index];
221 slen = strnlen (str, blen);
223 if (slen == blen) { /* not NULL terminated */
224 CERROR ("can't unpack non-NULL terminated string in "
225 "msg %p buffer[%d] len %d\n", m, index, blen);
230 if (slen != blen - 1) {
231 CERROR ("can't unpack short string in msg %p "
232 "buffer[%d] len %d: strlen %d\n",
233 m, index, blen, slen);
236 } else if (slen > max_len) {
237 CERROR ("can't unpack oversized string in msg %p "
238 "buffer[%d] len %d strlen %d: max %d expected\n",
239 m, index, blen, slen, max_len);
246 /* Wrap up the normal fixed length case */
247 void *lustre_swab_reqbuf (struct ptlrpc_request *req, int index, int min_size,
252 LASSERT_REQSWAB (req, index);
254 ptr = lustre_msg_buf(req->rq_reqmsg, index, min_size);
258 if (swabber != NULL &&
259 lustre_msg_swabbed (req->rq_reqmsg))
260 ((void (*)(void *))swabber)(ptr);
265 /* Wrap up the normal fixed length case */
266 void *lustre_swab_repbuf (struct ptlrpc_request *req, int index, int min_size,
271 LASSERT_REPSWAB (req, index);
273 ptr = lustre_msg_buf (req->rq_repmsg, index, min_size);
277 if (swabber != NULL &&
278 lustre_msg_swabbed (req->rq_repmsg))
279 ((void (*)(void *))swabber)(ptr);
284 /* byte flipping routines for all wire types declared in
285 * lustre_idl.h implemented here.
288 void lustre_swab_obdo (struct obdo *o)
290 __swab64s (&o->o_id);
291 __swab64s (&o->o_gr);
292 __swab64s (&o->o_atime);
293 __swab64s (&o->o_mtime);
294 __swab64s (&o->o_ctime);
295 __swab64s (&o->o_size);
296 __swab64s (&o->o_blocks);
297 __swab64s (&o->o_rdev);
298 __swab32s (&o->o_blksize);
299 __swab32s (&o->o_mode);
300 __swab32s (&o->o_uid);
301 __swab32s (&o->o_gid);
302 __swab32s (&o->o_flags);
303 __swab32s (&o->o_nlink);
304 __swab32s (&o->o_generation);
305 __swab32s (&o->o_valid);
306 __swab32s (&o->o_obdflags);
307 __swab32s (&o->o_easize);
308 /* o_inline is opaque */
311 void lustre_swab_obd_statfs (struct obd_statfs *os)
313 __swab64s (&os->os_type);
314 __swab64s (&os->os_blocks);
315 __swab64s (&os->os_bfree);
316 __swab64s (&os->os_bavail);
317 __swab64s (&os->os_ffree);
318 /* no need to swap os_fsid */
319 __swab32s (&os->os_bsize);
320 __swab32s (&os->os_namelen);
321 /* no need to swap os_spare */
324 void lustre_swab_obd_ioobj (struct obd_ioobj *ioo)
326 __swab64s (&ioo->ioo_id);
327 __swab64s (&ioo->ioo_gr);
328 __swab32s (&ioo->ioo_type);
329 __swab32s (&ioo->ioo_bufcnt);
332 void lustre_swab_niobuf_remote (struct niobuf_remote *nbr)
334 __swab64s (&nbr->offset);
335 __swab32s (&nbr->len);
336 __swab32s (&nbr->flags);
339 void lustre_swab_ost_body (struct ost_body *b)
341 lustre_swab_obdo (&b->oa);
344 void lustre_swab_ll_fid (struct ll_fid *fid)
346 __swab64s (&fid->id);
347 __swab32s (&fid->generation);
348 __swab32s (&fid->f_type);
351 void lustre_swab_mds_status_req (struct mds_status_req *r)
353 __swab32s (&r->flags);
354 __swab32s (&r->repbuf);
357 void lustre_swab_mds_fileh_body (struct mds_fileh_body *f)
359 lustre_swab_ll_fid (&f->f_fid);
362 void lustre_swab_mds_body (struct mds_body *b)
364 lustre_swab_ll_fid (&b->fid1);
365 lustre_swab_ll_fid (&b->fid2);
366 /* handle is opaque */
367 __swab64s (&b->size);
368 __swab64s (&b->blocks);
370 __swab32s (&b->valid);
371 __swab32s (&b->fsuid);
372 __swab32s (&b->fsgid);
373 __swab32s (&b->capability);
374 __swab32s (&b->mode);
377 __swab32s (&b->mtime);
378 __swab32s (&b->ctime);
379 __swab32s (&b->atime);
380 __swab32s (&b->flags);
381 __swab32s (&b->rdev);
382 __swab32s (&b->nlink);
383 __swab32s (&b->generation);
384 __swab32s (&b->suppgid);
385 __swab32s (&b->eadatasize);
388 void lustre_swab_mds_rec_setattr (struct mds_rec_setattr *sa)
390 __swab32s (&sa->sa_opcode);
391 __swab32s (&sa->sa_fsuid);
392 __swab32s (&sa->sa_fsgid);
393 __swab32s (&sa->sa_cap);
394 __swab32s (&sa->sa_reserved);
395 __swab32s (&sa->sa_valid);
396 lustre_swab_ll_fid (&sa->sa_fid);
397 __swab32s (&sa->sa_mode);
398 __swab32s (&sa->sa_uid);
399 __swab32s (&sa->sa_gid);
400 __swab32s (&sa->sa_attr_flags);
401 __swab64s (&sa->sa_size);
402 __swab64s (&sa->sa_atime);
403 __swab64s (&sa->sa_mtime);
404 __swab64s (&sa->sa_ctime);
405 __swab32s (&sa->sa_suppgid);
408 void lustre_swab_mds_rec_create (struct mds_rec_create *cr)
410 __swab32s (&cr->cr_opcode);
411 __swab32s (&cr->cr_fsuid);
412 __swab32s (&cr->cr_fsgid);
413 __swab32s (&cr->cr_cap);
414 __swab32s (&cr->cr_flags); /* for use with open */
415 __swab32s (&cr->cr_mode);
416 lustre_swab_ll_fid (&cr->cr_fid);
417 lustre_swab_ll_fid (&cr->cr_replayfid);
418 __swab32s (&cr->cr_uid);
419 __swab32s (&cr->cr_gid);
420 __swab64s (&cr->cr_time);
421 __swab64s (&cr->cr_rdev);
422 __swab32s (&cr->cr_suppgid);
425 void lustre_swab_mds_rec_link (struct mds_rec_link *lk)
427 __swab32s (&lk->lk_opcode);
428 __swab32s (&lk->lk_fsuid);
429 __swab32s (&lk->lk_fsgid);
430 __swab32s (&lk->lk_cap);
431 __swab32s (&lk->lk_suppgid1);
432 __swab32s (&lk->lk_suppgid2);
433 lustre_swab_ll_fid (&lk->lk_fid1);
434 lustre_swab_ll_fid (&lk->lk_fid2);
437 void lustre_swab_mds_rec_unlink (struct mds_rec_unlink *ul)
439 __swab32s (&ul->ul_opcode);
440 __swab32s (&ul->ul_fsuid);
441 __swab32s (&ul->ul_fsgid);
442 __swab32s (&ul->ul_cap);
443 __swab32s (&ul->ul_reserved);
444 __swab32s (&ul->ul_mode);
445 __swab32s (&ul->ul_suppgid);
446 lustre_swab_ll_fid (&ul->ul_fid1);
447 lustre_swab_ll_fid (&ul->ul_fid2);
450 void lustre_swab_mds_rec_rename (struct mds_rec_rename *rn)
452 __swab32s (&rn->rn_opcode);
453 __swab32s (&rn->rn_fsuid);
454 __swab32s (&rn->rn_fsgid);
455 __swab32s (&rn->rn_cap);
456 __swab32s (&rn->rn_suppgid1);
457 __swab32s (&rn->rn_suppgid2);
458 lustre_swab_ll_fid (&rn->rn_fid1);
459 lustre_swab_ll_fid (&rn->rn_fid2);
462 void lustre_swab_lov_desc (struct lov_desc *ld)
464 __swab32s (&ld->ld_tgt_count);
465 __swab32s (&ld->ld_active_tgt_count);
466 __swab32s (&ld->ld_default_stripe_count);
467 __swab64s (&ld->ld_default_stripe_size);
468 __swab64s (&ld->ld_default_stripe_offset);
469 __swab32s (&ld->ld_pattern);
470 /* uuid endian insensitive */
473 void lustre_swab_ldlm_res_id (struct ldlm_res_id *id)
477 for (i = 0; i < RES_NAME_SIZE; i++)
478 __swab64s (&id->name[i]);
481 void lustre_swab_ldlm_extent (struct ldlm_extent *e)
483 __swab64s (&e->start);
487 void lustre_swab_ldlm_intent (struct ldlm_intent *i)
492 void lustre_swab_ldlm_resource_desc (struct ldlm_resource_desc *r)
496 __swab32s (&r->lr_type);
497 lustre_swab_ldlm_res_id (&r->lr_name);
498 for (i = 0; i < RES_VERSION_SIZE; i++)
499 __swab32s (&r->lr_version[i]);
502 void lustre_swab_ldlm_lock_desc (struct ldlm_lock_desc *l)
506 lustre_swab_ldlm_resource_desc (&l->l_resource);
507 __swab32s (&l->l_req_mode);
508 __swab32s (&l->l_granted_mode);
509 lustre_swab_ldlm_extent (&l->l_extent);
510 for (i = 0; i < RES_VERSION_SIZE; i++)
511 __swab32s (&l->l_version[i]);
514 void lustre_swab_ldlm_request (struct ldlm_request *rq)
516 __swab32s (&rq->lock_flags);
517 lustre_swab_ldlm_lock_desc (&rq->lock_desc);
518 /* lock_handle1 opaque */
519 /* lock_handle2 opaque */
522 void lustre_swab_ldlm_reply (struct ldlm_reply *r)
524 __swab32s (&r->lock_flags);
525 __swab32s (&r->lock_mode);
526 lustre_swab_ldlm_res_id (&r->lock_resource_name);
527 /* lock_handle opaque */
528 lustre_swab_ldlm_extent (&r->lock_extent);
529 __swab64s (&r->lock_policy_res1);
530 __swab64s (&r->lock_policy_res2);
533 void lustre_swab_ptlbd_op (struct ptlbd_op *op)
535 __swab16s (&op->op_cmd);
536 __swab16s (&op->op_lun);
537 __swab16s (&op->op_niob_cnt);
538 /* ignore op__padding */
539 __swab32s (&op->op_block_cnt);
542 void lustre_swab_ptlbd_niob (struct ptlbd_niob *n)
544 __swab64s (&n->n_xid);
545 __swab64s (&n->n_block_nr);
546 __swab32s (&n->n_offset);
547 __swab32s (&n->n_length);
550 void lustre_swab_ptlbd_rsp (struct ptlbd_rsp *r)
552 __swab16s (&r->r_status);
553 __swab16s (&r->r_error_cnt);
556 void lustre_assert_wire_constants (void)
559 /* Wire protocol assertions generated by 'wirecheck' */
562 LASSERT (PTLRPC_MSG_MAGIC == 0x0BD00BD0);
563 LASSERT (PTLRPC_MSG_VERSION == 0x00040002);
564 LASSERT (PTL_RPC_MSG_REQUEST == 4711);
565 LASSERT (PTL_RPC_MSG_ERR == 4712);
566 LASSERT (PTL_RPC_MSG_REPLY == 4713);
567 LASSERT (MSG_LAST_REPLAY == 1);
568 LASSERT (MSG_RESENT == 2);
569 LASSERT (MSG_CONNECT_RECOVERING == 1);
570 LASSERT (MSG_CONNECT_RECONNECT == 2);
571 LASSERT (MSG_CONNECT_REPLAYABLE == 4);
572 LASSERT (OST_REPLY == 0);
573 LASSERT (OST_GETATTR == 1);
574 LASSERT (OST_SETATTR == 2);
575 LASSERT (OST_READ == 3);
576 LASSERT (OST_WRITE == 4);
577 LASSERT (OST_CREATE == 5);
578 LASSERT (OST_DESTROY == 6);
579 LASSERT (OST_GET_INFO == 7);
580 LASSERT (OST_CONNECT == 8);
581 LASSERT (OST_DISCONNECT == 9);
582 LASSERT (OST_PUNCH == 10);
583 LASSERT (OST_OPEN == 11);
584 LASSERT (OST_CLOSE == 12);
585 LASSERT (OST_STATFS == 13);
586 LASSERT (OST_SAN_READ == 14);
587 LASSERT (OST_SAN_WRITE == 15);
588 LASSERT (OST_SYNCFS == 16);
589 LASSERT (OST_LAST_OPC == 17);
590 LASSERT (OST_FIRST_OPC == 0);
591 LASSERT (OBD_FL_INLINEDATA == 1);
592 LASSERT (OBD_FL_OBDMDEXISTS == 2);
593 LASSERT (LOV_MAGIC == 198183888);
594 LASSERT (OBD_MD_FLALL == -1);
595 LASSERT (OBD_MD_FLID == 1);
596 LASSERT (OBD_MD_FLATIME == 2);
597 LASSERT (OBD_MD_FLMTIME == 4);
598 LASSERT (OBD_MD_FLCTIME == 8);
599 LASSERT (OBD_MD_FLSIZE == 16);
600 LASSERT (OBD_MD_FLBLOCKS == 32);
601 LASSERT (OBD_MD_FLBLKSZ == 64);
602 LASSERT (OBD_MD_FLMODE == 128);
603 LASSERT (OBD_MD_FLTYPE == 256);
604 LASSERT (OBD_MD_FLUID == 512);
605 LASSERT (OBD_MD_FLGID == 1024);
606 LASSERT (OBD_MD_FLFLAGS == 2048);
607 LASSERT (OBD_MD_FLOBDFLG == 4096);
608 LASSERT (OBD_MD_FLNLINK == 8192);
609 LASSERT (OBD_MD_FLGENER == 16384);
610 LASSERT (OBD_MD_FLINLINE == 32768);
611 LASSERT (OBD_MD_FLRDEV == 65536);
612 LASSERT (OBD_MD_FLEASIZE == 131072);
613 LASSERT (OBD_MD_LINKNAME == 262144);
614 LASSERT (OBD_MD_FLHANDLE == 524288);
615 LASSERT (OBD_MD_FLCKSUM == 1048576);
616 LASSERT (OBD_BRW_READ == 1);
617 LASSERT (OBD_BRW_WRITE == 2);
618 LASSERT (OBD_BRW_CREATE == 4);
619 LASSERT (OBD_BRW_SYNC == 8);
620 LASSERT (OBD_OBJECT_EOF == 0xffffffffffffffffULL);
621 LASSERT (OST_REQ_HAS_OA1 == 1);
622 LASSERT (MDS_GETATTR == 33);
623 LASSERT (MDS_GETATTR_NAME == 34);
624 LASSERT (MDS_CLOSE == 35);
625 LASSERT (MDS_REINT == 36);
626 LASSERT (MDS_READPAGE == 37);
627 LASSERT (MDS_CONNECT == 38);
628 LASSERT (MDS_DISCONNECT == 39);
629 LASSERT (MDS_GETSTATUS == 40);
630 LASSERT (MDS_STATFS == 41);
631 LASSERT (MDS_GETLOVINFO == 42);
632 LASSERT (MDS_LAST_OPC == 43);
633 LASSERT (MDS_FIRST_OPC == 33);
634 LASSERT (REINT_SETATTR == 1);
635 LASSERT (REINT_CREATE == 2);
636 LASSERT (REINT_LINK == 3);
637 LASSERT (REINT_UNLINK == 4);
638 LASSERT (REINT_RENAME == 5);
639 LASSERT (REINT_OPEN == 6);
640 LASSERT (REINT_MAX == 6);
641 LASSERT (IT_INTENT_EXEC == 1);
642 LASSERT (IT_OPEN_LOOKUP == 2);
643 LASSERT (IT_OPEN_NEG == 4);
644 LASSERT (IT_OPEN_POS == 8);
645 LASSERT (IT_OPEN_CREATE == 16);
646 LASSERT (IT_OPEN_OPEN == 32);
647 LASSERT (MDS_STATUS_CONN == 1);
648 LASSERT (MDS_STATUS_LOV == 2);
649 LASSERT (MDS_OPEN_HAS_EA == 1);
650 LASSERT (LOV_RAID0 == 0);
651 LASSERT (LOV_RAIDRR == 1);
652 LASSERT (LDLM_ENQUEUE == 101);
653 LASSERT (LDLM_CONVERT == 102);
654 LASSERT (LDLM_CANCEL == 103);
655 LASSERT (LDLM_BL_CALLBACK == 104);
656 LASSERT (LDLM_CP_CALLBACK == 105);
657 LASSERT (LDLM_LAST_OPC == 106);
658 LASSERT (LDLM_FIRST_OPC == 101);
659 LASSERT (PTLBD_QUERY == 200);
660 LASSERT (PTLBD_READ == 201);
661 LASSERT (PTLBD_WRITE == 202);
662 LASSERT (PTLBD_FLUSH == 203);
663 LASSERT (PTLBD_CONNECT == 204);
664 LASSERT (PTLBD_DISCONNECT == 205);
665 LASSERT (PTLBD_LAST_OPC == 204);
666 LASSERT (PTLBD_FIRST_OPC == 200);
667 LASSERT (OBD_PING == 400);
668 /* Sizes and Offsets */
671 /* Checks for struct lustre_handle */
672 LASSERT (sizeof (struct lustre_handle) == 8);
673 LASSERT (offsetof (struct lustre_handle, cookie) == 0);
674 LASSERT (sizeof (((struct lustre_handle *)0)->cookie) == 8);
676 /* Checks for struct lustre_msg */
677 LASSERT (sizeof (struct lustre_msg) == 60);
678 LASSERT (offsetof (struct lustre_msg, handle) == 0);
679 LASSERT (sizeof (((struct lustre_msg *)0)->handle) == 8);
680 LASSERT (offsetof (struct lustre_msg, magic) == 8);
681 LASSERT (sizeof (((struct lustre_msg *)0)->magic) == 4);
682 LASSERT (offsetof (struct lustre_msg, type) == 12);
683 LASSERT (sizeof (((struct lustre_msg *)0)->type) == 4);
684 LASSERT (offsetof (struct lustre_msg, version) == 16);
685 LASSERT (sizeof (((struct lustre_msg *)0)->version) == 4);
686 LASSERT (offsetof (struct lustre_msg, opc) == 20);
687 LASSERT (sizeof (((struct lustre_msg *)0)->opc) == 4);
688 LASSERT (offsetof (struct lustre_msg, last_xid) == 24);
689 LASSERT (sizeof (((struct lustre_msg *)0)->last_xid) == 8);
690 LASSERT (offsetof (struct lustre_msg, last_committed) == 32);
691 LASSERT (sizeof (((struct lustre_msg *)0)->last_committed) == 8);
692 LASSERT (offsetof (struct lustre_msg, transno) == 40);
693 LASSERT (sizeof (((struct lustre_msg *)0)->transno) == 8);
694 LASSERT (offsetof (struct lustre_msg, status) == 48);
695 LASSERT (sizeof (((struct lustre_msg *)0)->status) == 4);
696 LASSERT (offsetof (struct lustre_msg, flags) == 52);
697 LASSERT (sizeof (((struct lustre_msg *)0)->flags) == 4);
698 LASSERT (offsetof (struct lustre_msg, bufcount) == 56);
699 LASSERT (sizeof (((struct lustre_msg *)0)->bufcount) == 4);
700 LASSERT (offsetof (struct lustre_msg, buflens[7]) == 88);
701 LASSERT (sizeof (((struct lustre_msg *)0)->buflens[7]) == 4);
703 /* Checks for struct obdo */
704 LASSERT (sizeof (struct obdo) == 164);
705 LASSERT (offsetof (struct obdo, o_id) == 0);
706 LASSERT (sizeof (((struct obdo *)0)->o_id) == 8);
707 LASSERT (offsetof (struct obdo, o_gr) == 8);
708 LASSERT (sizeof (((struct obdo *)0)->o_gr) == 8);
709 LASSERT (offsetof (struct obdo, o_atime) == 16);
710 LASSERT (sizeof (((struct obdo *)0)->o_atime) == 8);
711 LASSERT (offsetof (struct obdo, o_mtime) == 24);
712 LASSERT (sizeof (((struct obdo *)0)->o_mtime) == 8);
713 LASSERT (offsetof (struct obdo, o_ctime) == 32);
714 LASSERT (sizeof (((struct obdo *)0)->o_ctime) == 8);
715 LASSERT (offsetof (struct obdo, o_size) == 40);
716 LASSERT (sizeof (((struct obdo *)0)->o_size) == 8);
717 LASSERT (offsetof (struct obdo, o_blocks) == 48);
718 LASSERT (sizeof (((struct obdo *)0)->o_blocks) == 8);
719 LASSERT (offsetof (struct obdo, o_rdev) == 56);
720 LASSERT (sizeof (((struct obdo *)0)->o_rdev) == 8);
721 LASSERT (offsetof (struct obdo, o_blksize) == 64);
722 LASSERT (sizeof (((struct obdo *)0)->o_blksize) == 4);
723 LASSERT (offsetof (struct obdo, o_mode) == 68);
724 LASSERT (sizeof (((struct obdo *)0)->o_mode) == 4);
725 LASSERT (offsetof (struct obdo, o_uid) == 72);
726 LASSERT (sizeof (((struct obdo *)0)->o_uid) == 4);
727 LASSERT (offsetof (struct obdo, o_gid) == 76);
728 LASSERT (sizeof (((struct obdo *)0)->o_gid) == 4);
729 LASSERT (offsetof (struct obdo, o_flags) == 80);
730 LASSERT (sizeof (((struct obdo *)0)->o_flags) == 4);
731 LASSERT (offsetof (struct obdo, o_nlink) == 84);
732 LASSERT (sizeof (((struct obdo *)0)->o_nlink) == 4);
733 LASSERT (offsetof (struct obdo, o_generation) == 88);
734 LASSERT (sizeof (((struct obdo *)0)->o_generation) == 4);
735 LASSERT (offsetof (struct obdo, o_valid) == 92);
736 LASSERT (sizeof (((struct obdo *)0)->o_valid) == 4);
737 LASSERT (offsetof (struct obdo, o_obdflags) == 96);
738 LASSERT (sizeof (((struct obdo *)0)->o_obdflags) == 4);
739 LASSERT (offsetof (struct obdo, o_easize) == 100);
740 LASSERT (sizeof (((struct obdo *)0)->o_easize) == 4);
741 LASSERT (offsetof (struct obdo, o_inline) == 104);
742 LASSERT (sizeof (((struct obdo *)0)->o_inline) == 60);
744 /* Checks for struct obd_statfs */
745 LASSERT (sizeof (struct obd_statfs) == 144);
746 LASSERT (offsetof (struct obd_statfs, os_type) == 0);
747 LASSERT (sizeof (((struct obd_statfs *)0)->os_type) == 8);
748 LASSERT (offsetof (struct obd_statfs, os_blocks) == 8);
749 LASSERT (sizeof (((struct obd_statfs *)0)->os_blocks) == 8);
750 LASSERT (offsetof (struct obd_statfs, os_bfree) == 16);
751 LASSERT (sizeof (((struct obd_statfs *)0)->os_bfree) == 8);
752 LASSERT (offsetof (struct obd_statfs, os_bavail) == 24);
753 LASSERT (sizeof (((struct obd_statfs *)0)->os_bavail) == 8);
754 LASSERT (offsetof (struct obd_statfs, os_ffree) == 40);
755 LASSERT (sizeof (((struct obd_statfs *)0)->os_ffree) == 8);
756 LASSERT (offsetof (struct obd_statfs, os_fsid) == 48);
757 LASSERT (sizeof (((struct obd_statfs *)0)->os_fsid) == 40);
758 LASSERT (offsetof (struct obd_statfs, os_bsize) == 88);
759 LASSERT (sizeof (((struct obd_statfs *)0)->os_bsize) == 4);
760 LASSERT (offsetof (struct obd_statfs, os_namelen) == 92);
761 LASSERT (sizeof (((struct obd_statfs *)0)->os_namelen) == 4);
763 /* Checks for struct obd_ioobj */
764 LASSERT (sizeof (struct obd_ioobj) == 24);
765 LASSERT (offsetof (struct obd_ioobj, ioo_id) == 0);
766 LASSERT (sizeof (((struct obd_ioobj *)0)->ioo_id) == 8);
767 LASSERT (offsetof (struct obd_ioobj, ioo_gr) == 8);
768 LASSERT (sizeof (((struct obd_ioobj *)0)->ioo_gr) == 8);
769 LASSERT (offsetof (struct obd_ioobj, ioo_type) == 16);
770 LASSERT (sizeof (((struct obd_ioobj *)0)->ioo_type) == 4);
771 LASSERT (offsetof (struct obd_ioobj, ioo_bufcnt) == 20);
772 LASSERT (sizeof (((struct obd_ioobj *)0)->ioo_bufcnt) == 4);
774 /* Checks for struct niobuf_remote */
775 LASSERT (sizeof (struct niobuf_remote) == 16);
776 LASSERT (offsetof (struct niobuf_remote, offset) == 0);
777 LASSERT (sizeof (((struct niobuf_remote *)0)->offset) == 8);
778 LASSERT (offsetof (struct niobuf_remote, len) == 8);
779 LASSERT (sizeof (((struct niobuf_remote *)0)->len) == 4);
780 LASSERT (offsetof (struct niobuf_remote, flags) == 12);
781 LASSERT (sizeof (((struct niobuf_remote *)0)->flags) == 4);
783 /* Checks for struct ost_body */
784 LASSERT (sizeof (struct ost_body) == 164);
785 LASSERT (offsetof (struct ost_body, oa) == 0);
786 LASSERT (sizeof (((struct ost_body *)0)->oa) == 164);
788 /* Checks for struct ll_fid */
789 LASSERT (sizeof (struct ll_fid) == 16);
790 LASSERT (offsetof (struct ll_fid, id) == 0);
791 LASSERT (sizeof (((struct ll_fid *)0)->id) == 8);
792 LASSERT (offsetof (struct ll_fid, generation) == 8);
793 LASSERT (sizeof (((struct ll_fid *)0)->generation) == 4);
794 LASSERT (offsetof (struct ll_fid, f_type) == 12);
795 LASSERT (sizeof (((struct ll_fid *)0)->f_type) == 4);
797 /* Checks for struct mds_status_req */
798 LASSERT (sizeof (struct mds_status_req) == 8);
799 LASSERT (offsetof (struct mds_status_req, flags) == 0);
800 LASSERT (sizeof (((struct mds_status_req *)0)->flags) == 4);
801 LASSERT (offsetof (struct mds_status_req, repbuf) == 4);
802 LASSERT (sizeof (((struct mds_status_req *)0)->repbuf) == 4);
804 /* Checks for struct mds_fileh_body */
805 LASSERT (sizeof (struct mds_fileh_body) == 24);
806 LASSERT (offsetof (struct mds_fileh_body, f_fid) == 0);
807 LASSERT (sizeof (((struct mds_fileh_body *)0)->f_fid) == 16);
809 /* Checks for struct mds_body */
810 LASSERT (sizeof (struct mds_body) == 124);
811 LASSERT (offsetof (struct mds_body, fid1) == 0);
812 LASSERT (sizeof (((struct mds_body *)0)->fid1) == 16);
813 LASSERT (offsetof (struct mds_body, fid2) == 16);
814 LASSERT (sizeof (((struct mds_body *)0)->fid2) == 16);
815 LASSERT (offsetof (struct mds_body, handle) == 32);
816 LASSERT (sizeof (((struct mds_body *)0)->handle) == 8);
817 LASSERT (offsetof (struct mds_body, size) == 40);
818 LASSERT (sizeof (((struct mds_body *)0)->size) == 8);
819 LASSERT (offsetof (struct mds_body, blocks) == 48);
820 LASSERT (sizeof (((struct mds_body *)0)->blocks) == 8);
821 LASSERT (offsetof (struct mds_body, ino) == 56);
822 LASSERT (sizeof (((struct mds_body *)0)->ino) == 4);
823 LASSERT (offsetof (struct mds_body, valid) == 60);
824 LASSERT (sizeof (((struct mds_body *)0)->valid) == 4);
825 LASSERT (offsetof (struct mds_body, fsuid) == 64);
826 LASSERT (sizeof (((struct mds_body *)0)->fsuid) == 4);
827 LASSERT (offsetof (struct mds_body, fsgid) == 68);
828 LASSERT (sizeof (((struct mds_body *)0)->fsgid) == 4);
829 LASSERT (offsetof (struct mds_body, capability) == 72);
830 LASSERT (sizeof (((struct mds_body *)0)->capability) == 4);
831 LASSERT (offsetof (struct mds_body, mode) == 76);
832 LASSERT (sizeof (((struct mds_body *)0)->mode) == 4);
833 LASSERT (offsetof (struct mds_body, uid) == 80);
834 LASSERT (sizeof (((struct mds_body *)0)->uid) == 4);
835 LASSERT (offsetof (struct mds_body, gid) == 84);
836 LASSERT (sizeof (((struct mds_body *)0)->gid) == 4);
837 LASSERT (offsetof (struct mds_body, mtime) == 88);
838 LASSERT (sizeof (((struct mds_body *)0)->mtime) == 4);
839 LASSERT (offsetof (struct mds_body, ctime) == 92);
840 LASSERT (sizeof (((struct mds_body *)0)->ctime) == 4);
841 LASSERT (offsetof (struct mds_body, atime) == 96);
842 LASSERT (sizeof (((struct mds_body *)0)->atime) == 4);
843 LASSERT (offsetof (struct mds_body, flags) == 100);
844 LASSERT (sizeof (((struct mds_body *)0)->flags) == 4);
845 LASSERT (offsetof (struct mds_body, rdev) == 104);
846 LASSERT (sizeof (((struct mds_body *)0)->rdev) == 4);
847 LASSERT (offsetof (struct mds_body, nlink) == 108);
848 LASSERT (sizeof (((struct mds_body *)0)->nlink) == 4);
849 LASSERT (offsetof (struct mds_body, generation) == 112);
850 LASSERT (sizeof (((struct mds_body *)0)->generation) == 4);
851 LASSERT (offsetof (struct mds_body, suppgid) == 116);
852 LASSERT (sizeof (((struct mds_body *)0)->suppgid) == 4);
854 /* Checks for struct mds_rec_setattr */
855 LASSERT (sizeof (struct mds_rec_setattr) == 92);
856 LASSERT (offsetof (struct mds_rec_setattr, sa_opcode) == 0);
857 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_opcode) == 4);
858 LASSERT (offsetof (struct mds_rec_setattr, sa_fsuid) == 4);
859 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_fsuid) == 4);
860 LASSERT (offsetof (struct mds_rec_setattr, sa_fsgid) == 8);
861 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_fsgid) == 4);
862 LASSERT (offsetof (struct mds_rec_setattr, sa_cap) == 12);
863 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_cap) == 4);
864 LASSERT (offsetof (struct mds_rec_setattr, sa_reserved) == 16);
865 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_reserved) == 4);
866 LASSERT (offsetof (struct mds_rec_setattr, sa_valid) == 20);
867 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_valid) == 4);
868 LASSERT (offsetof (struct mds_rec_setattr, sa_fid) == 24);
869 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_fid) == 16);
870 LASSERT (offsetof (struct mds_rec_setattr, sa_mode) == 40);
871 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_mode) == 4);
872 LASSERT (offsetof (struct mds_rec_setattr, sa_uid) == 44);
873 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_uid) == 4);
874 LASSERT (offsetof (struct mds_rec_setattr, sa_gid) == 48);
875 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_gid) == 4);
876 LASSERT (offsetof (struct mds_rec_setattr, sa_attr_flags) == 52);
877 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_attr_flags) == 4);
878 LASSERT (offsetof (struct mds_rec_setattr, sa_size) == 56);
879 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_size) == 8);
880 LASSERT (offsetof (struct mds_rec_setattr, sa_atime) == 64);
881 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_atime) == 8);
882 LASSERT (offsetof (struct mds_rec_setattr, sa_mtime) == 72);
883 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_mtime) == 8);
884 LASSERT (offsetof (struct mds_rec_setattr, sa_ctime) == 80);
885 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_ctime) == 8);
886 LASSERT (offsetof (struct mds_rec_setattr, sa_suppgid) == 88);
887 LASSERT (sizeof (((struct mds_rec_setattr *)0)->sa_suppgid) == 4);
889 /* Checks for struct mds_rec_create */
890 LASSERT (sizeof (struct mds_rec_create) == 84);
891 LASSERT (offsetof (struct mds_rec_create, cr_opcode) == 0);
892 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_opcode) == 4);
893 LASSERT (offsetof (struct mds_rec_create, cr_fsuid) == 4);
894 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_fsuid) == 4);
895 LASSERT (offsetof (struct mds_rec_create, cr_fsgid) == 8);
896 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_fsgid) == 4);
897 LASSERT (offsetof (struct mds_rec_create, cr_cap) == 12);
898 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_cap) == 4);
899 LASSERT (offsetof (struct mds_rec_create, cr_flags) == 16);
900 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_flags) == 4);
901 LASSERT (offsetof (struct mds_rec_create, cr_mode) == 20);
902 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_mode) == 4);
903 LASSERT (offsetof (struct mds_rec_create, cr_fid) == 24);
904 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_fid) == 16);
905 LASSERT (offsetof (struct mds_rec_create, cr_replayfid) == 40);
906 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_replayfid) == 16);
907 LASSERT (offsetof (struct mds_rec_create, cr_uid) == 56);
908 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_uid) == 4);
909 LASSERT (offsetof (struct mds_rec_create, cr_gid) == 60);
910 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_gid) == 4);
911 LASSERT (offsetof (struct mds_rec_create, cr_time) == 64);
912 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_time) == 8);
913 LASSERT (offsetof (struct mds_rec_create, cr_rdev) == 72);
914 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_rdev) == 8);
915 LASSERT (offsetof (struct mds_rec_create, cr_suppgid) == 80);
916 LASSERT (sizeof (((struct mds_rec_create *)0)->cr_suppgid) == 4);
918 /* Checks for struct mds_rec_link */
919 LASSERT (sizeof (struct mds_rec_link) == 56);
920 LASSERT (offsetof (struct mds_rec_link, lk_opcode) == 0);
921 LASSERT (sizeof (((struct mds_rec_link *)0)->lk_opcode) == 4);
922 LASSERT (offsetof (struct mds_rec_link, lk_fsuid) == 4);
923 LASSERT (sizeof (((struct mds_rec_link *)0)->lk_fsuid) == 4);
924 LASSERT (offsetof (struct mds_rec_link, lk_fsgid) == 8);
925 LASSERT (sizeof (((struct mds_rec_link *)0)->lk_fsgid) == 4);
926 LASSERT (offsetof (struct mds_rec_link, lk_cap) == 12);
927 LASSERT (sizeof (((struct mds_rec_link *)0)->lk_cap) == 4);
928 LASSERT (offsetof (struct mds_rec_link, lk_suppgid1) == 16);
929 LASSERT (sizeof (((struct mds_rec_link *)0)->lk_suppgid1) == 4);
930 LASSERT (offsetof (struct mds_rec_link, lk_suppgid2) == 20);
931 LASSERT (sizeof (((struct mds_rec_link *)0)->lk_suppgid2) == 4);
932 LASSERT (offsetof (struct mds_rec_link, lk_fid1) == 24);
933 LASSERT (sizeof (((struct mds_rec_link *)0)->lk_fid1) == 16);
934 LASSERT (offsetof (struct mds_rec_link, lk_fid2) == 40);
935 LASSERT (sizeof (((struct mds_rec_link *)0)->lk_fid2) == 16);
937 /* Checks for struct mds_rec_unlink */
938 LASSERT (sizeof (struct mds_rec_unlink) == 60);
939 LASSERT (offsetof (struct mds_rec_unlink, ul_opcode) == 0);
940 LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_opcode) == 4);
941 LASSERT (offsetof (struct mds_rec_unlink, ul_fsuid) == 4);
942 LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_fsuid) == 4);
943 LASSERT (offsetof (struct mds_rec_unlink, ul_fsgid) == 8);
944 LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_fsgid) == 4);
945 LASSERT (offsetof (struct mds_rec_unlink, ul_cap) == 12);
946 LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_cap) == 4);
947 LASSERT (offsetof (struct mds_rec_unlink, ul_reserved) == 16);
948 LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_reserved) == 4);
949 LASSERT (offsetof (struct mds_rec_unlink, ul_mode) == 20);
950 LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_mode) == 4);
951 LASSERT (offsetof (struct mds_rec_unlink, ul_suppgid) == 24);
952 LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_suppgid) == 4);
953 LASSERT (offsetof (struct mds_rec_unlink, ul_fid1) == 28);
954 LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_fid1) == 16);
955 LASSERT (offsetof (struct mds_rec_unlink, ul_fid2) == 44);
956 LASSERT (sizeof (((struct mds_rec_unlink *)0)->ul_fid2) == 16);
958 /* Checks for struct mds_rec_rename */
959 LASSERT (sizeof (struct mds_rec_rename) == 56);
960 LASSERT (offsetof (struct mds_rec_rename, rn_opcode) == 0);
961 LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_opcode) == 4);
962 LASSERT (offsetof (struct mds_rec_rename, rn_fsuid) == 4);
963 LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_fsuid) == 4);
964 LASSERT (offsetof (struct mds_rec_rename, rn_fsgid) == 8);
965 LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_fsgid) == 4);
966 LASSERT (offsetof (struct mds_rec_rename, rn_cap) == 12);
967 LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_cap) == 4);
968 LASSERT (offsetof (struct mds_rec_rename, rn_suppgid1) == 16);
969 LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_suppgid1) == 4);
970 LASSERT (offsetof (struct mds_rec_rename, rn_suppgid2) == 20);
971 LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_suppgid2) == 4);
972 LASSERT (offsetof (struct mds_rec_rename, rn_fid1) == 24);
973 LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_fid1) == 16);
974 LASSERT (offsetof (struct mds_rec_rename, rn_fid2) == 40);
975 LASSERT (sizeof (((struct mds_rec_rename *)0)->rn_fid2) == 16);
977 /* Checks for struct lov_desc */
978 LASSERT (sizeof (struct lov_desc) == 72);
979 LASSERT (offsetof (struct lov_desc, ld_tgt_count) == 0);
980 LASSERT (sizeof (((struct lov_desc *)0)->ld_tgt_count) == 4);
981 LASSERT (offsetof (struct lov_desc, ld_active_tgt_count) == 4);
982 LASSERT (sizeof (((struct lov_desc *)0)->ld_active_tgt_count) == 4);
983 LASSERT (offsetof (struct lov_desc, ld_default_stripe_count) == 8);
984 LASSERT (sizeof (((struct lov_desc *)0)->ld_default_stripe_count) == 4);
985 LASSERT (offsetof (struct lov_desc, ld_default_stripe_size) == 12);
986 LASSERT (sizeof (((struct lov_desc *)0)->ld_default_stripe_size) == 8);
987 LASSERT (offsetof (struct lov_desc, ld_default_stripe_offset) == 20);
988 LASSERT (sizeof (((struct lov_desc *)0)->ld_default_stripe_offset) == 8);
989 LASSERT (offsetof (struct lov_desc, ld_pattern) == 28);
990 LASSERT (sizeof (((struct lov_desc *)0)->ld_pattern) == 4);
991 LASSERT (offsetof (struct lov_desc, ld_uuid) == 32);
992 LASSERT (sizeof (((struct lov_desc *)0)->ld_uuid) == 37);
994 /* Checks for struct ldlm_res_id */
995 LASSERT (sizeof (struct ldlm_res_id) == 24);
996 LASSERT (offsetof (struct ldlm_res_id, name[3]) == 24);
997 LASSERT (sizeof (((struct ldlm_res_id *)0)->name[3]) == 8);
999 /* Checks for struct ldlm_extent */
1000 LASSERT (sizeof (struct ldlm_extent) == 16);
1001 LASSERT (offsetof (struct ldlm_extent, start) == 0);
1002 LASSERT (sizeof (((struct ldlm_extent *)0)->start) == 8);
1003 LASSERT (offsetof (struct ldlm_extent, end) == 8);
1004 LASSERT (sizeof (((struct ldlm_extent *)0)->end) == 8);
1006 /* Checks for struct ldlm_intent */
1007 LASSERT (sizeof (struct ldlm_intent) == 8);
1008 LASSERT (offsetof (struct ldlm_intent, opc) == 0);
1009 LASSERT (sizeof (((struct ldlm_intent *)0)->opc) == 8);
1011 /* Checks for struct ldlm_resource_desc */
1012 LASSERT (sizeof (struct ldlm_resource_desc) == 44);
1013 LASSERT (offsetof (struct ldlm_resource_desc, lr_type) == 0);
1014 LASSERT (sizeof (((struct ldlm_resource_desc *)0)->lr_type) == 4);
1015 LASSERT (offsetof (struct ldlm_resource_desc, lr_name) == 4);
1016 LASSERT (sizeof (((struct ldlm_resource_desc *)0)->lr_name) == 24);
1017 LASSERT (offsetof (struct ldlm_resource_desc, lr_version[4]) == 44);
1018 LASSERT (sizeof (((struct ldlm_resource_desc *)0)->lr_version[4]) == 4);
1020 /* Checks for struct ldlm_lock_desc */
1021 LASSERT (sizeof (struct ldlm_lock_desc) == 84);
1022 LASSERT (offsetof (struct ldlm_lock_desc, l_resource) == 0);
1023 LASSERT (sizeof (((struct ldlm_lock_desc *)0)->l_resource) == 44);
1024 LASSERT (offsetof (struct ldlm_lock_desc, l_req_mode) == 44);
1025 LASSERT (sizeof (((struct ldlm_lock_desc *)0)->l_req_mode) == 4);
1026 LASSERT (offsetof (struct ldlm_lock_desc, l_granted_mode) == 48);
1027 LASSERT (sizeof (((struct ldlm_lock_desc *)0)->l_granted_mode) == 4);
1028 LASSERT (offsetof (struct ldlm_lock_desc, l_extent) == 52);
1029 LASSERT (sizeof (((struct ldlm_lock_desc *)0)->l_extent) == 16);
1030 LASSERT (offsetof (struct ldlm_lock_desc, l_version[4]) == 84);
1031 LASSERT (sizeof (((struct ldlm_lock_desc *)0)->l_version[4]) == 4);
1033 /* Checks for struct ldlm_request */
1034 LASSERT (sizeof (struct ldlm_request) == 104);
1035 LASSERT (offsetof (struct ldlm_request, lock_flags) == 0);
1036 LASSERT (sizeof (((struct ldlm_request *)0)->lock_flags) == 4);
1037 LASSERT (offsetof (struct ldlm_request, lock_desc) == 4);
1038 LASSERT (sizeof (((struct ldlm_request *)0)->lock_desc) == 84);
1039 LASSERT (offsetof (struct ldlm_request, lock_handle1) == 88);
1040 LASSERT (sizeof (((struct ldlm_request *)0)->lock_handle1) == 8);
1041 LASSERT (offsetof (struct ldlm_request, lock_handle2) == 96);
1042 LASSERT (sizeof (((struct ldlm_request *)0)->lock_handle2) == 8);
1044 /* Checks for struct ldlm_reply */
1045 LASSERT (sizeof (struct ldlm_reply) == 72);
1046 LASSERT (offsetof (struct ldlm_reply, lock_flags) == 0);
1047 LASSERT (sizeof (((struct ldlm_reply *)0)->lock_flags) == 4);
1048 LASSERT (offsetof (struct ldlm_reply, lock_mode) == 4);
1049 LASSERT (sizeof (((struct ldlm_reply *)0)->lock_mode) == 4);
1050 LASSERT (offsetof (struct ldlm_reply, lock_resource_name) == 8);
1051 LASSERT (sizeof (((struct ldlm_reply *)0)->lock_resource_name) == 24);
1052 LASSERT (offsetof (struct ldlm_reply, lock_handle) == 32);
1053 LASSERT (sizeof (((struct ldlm_reply *)0)->lock_handle) == 8);
1054 LASSERT (offsetof (struct ldlm_reply, lock_extent) == 40);
1055 LASSERT (sizeof (((struct ldlm_reply *)0)->lock_extent) == 16);
1056 LASSERT (offsetof (struct ldlm_reply, lock_policy_res1) == 56);
1057 LASSERT (sizeof (((struct ldlm_reply *)0)->lock_policy_res1) == 8);
1058 LASSERT (offsetof (struct ldlm_reply, lock_policy_res2) == 64);
1059 LASSERT (sizeof (((struct ldlm_reply *)0)->lock_policy_res2) == 8);
1061 /* Checks for struct ptlbd_op */
1062 LASSERT (sizeof (struct ptlbd_op) == 12);
1063 LASSERT (offsetof (struct ptlbd_op, op_cmd) == 0);
1064 LASSERT (sizeof (((struct ptlbd_op *)0)->op_cmd) == 2);
1065 LASSERT (offsetof (struct ptlbd_op, op_lun) == 2);
1066 LASSERT (sizeof (((struct ptlbd_op *)0)->op_lun) == 2);
1067 LASSERT (offsetof (struct ptlbd_op, op_niob_cnt) == 4);
1068 LASSERT (sizeof (((struct ptlbd_op *)0)->op_niob_cnt) == 2);
1069 LASSERT (offsetof (struct ptlbd_op, op__padding) == 6);
1070 LASSERT (sizeof (((struct ptlbd_op *)0)->op__padding) == 2);
1071 LASSERT (offsetof (struct ptlbd_op, op_block_cnt) == 8);
1072 LASSERT (sizeof (((struct ptlbd_op *)0)->op_block_cnt) == 4);
1074 /* Checks for struct ptlbd_niob */
1075 LASSERT (sizeof (struct ptlbd_niob) == 24);
1076 LASSERT (offsetof (struct ptlbd_niob, n_xid) == 0);
1077 LASSERT (sizeof (((struct ptlbd_niob *)0)->n_xid) == 8);
1078 LASSERT (offsetof (struct ptlbd_niob, n_block_nr) == 8);
1079 LASSERT (sizeof (((struct ptlbd_niob *)0)->n_block_nr) == 8);
1080 LASSERT (offsetof (struct ptlbd_niob, n_offset) == 16);
1081 LASSERT (sizeof (((struct ptlbd_niob *)0)->n_offset) == 4);
1082 LASSERT (offsetof (struct ptlbd_niob, n_length) == 20);
1083 LASSERT (sizeof (((struct ptlbd_niob *)0)->n_length) == 4);
1085 /* Checks for struct ptlbd_rsp */
1086 LASSERT (sizeof (struct ptlbd_rsp) == 4);
1087 LASSERT (offsetof (struct ptlbd_rsp, r_status) == 0);
1088 LASSERT (sizeof (((struct ptlbd_rsp *)0)->r_status) == 2);
1089 LASSERT (offsetof (struct ptlbd_rsp, r_error_cnt) == 2);
1090 LASSERT (sizeof (((struct ptlbd_rsp *)0)->r_error_cnt) == 2);