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