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