3 #include <linux/lustre_lib.h>
4 #include <linux/lustre_idl.h>
7 #define LASSERT(cond) if (!(cond)) { printf("failed " #cond "\n"); ret = 1; }
11 void lustre_assert_wire_constants(void);
15 lustre_assert_wire_constants();
19 void lustre_assert_wire_constants(void)
21 /* Wire protocol assertions generated by 'wirecheck' */
24 LASSERT(PTLRPC_MSG_MAGIC == 0x0BD00BD0);
25 LASSERT(PTLRPC_MSG_VERSION == 0x00000003);
26 LASSERT(PTL_RPC_MSG_REQUEST == 4711);
27 LASSERT(PTL_RPC_MSG_ERR == 4712);
28 LASSERT(PTL_RPC_MSG_REPLY == 4713);
29 LASSERT(MSG_LAST_REPLAY == 1);
30 LASSERT(MSG_RESENT == 2);
31 LASSERT(MSG_CONNECT_RECOVERING == 1);
32 LASSERT(MSG_CONNECT_RECONNECT == 2);
33 LASSERT(MSG_CONNECT_REPLAYABLE == 4);
34 LASSERT(OST_REPLY == 0);
35 LASSERT(OST_GETATTR == 1);
36 LASSERT(OST_SETATTR == 2);
37 LASSERT(OST_READ == 3);
38 LASSERT(OST_WRITE == 4);
39 LASSERT(OST_CREATE == 5);
40 LASSERT(OST_DESTROY == 6);
41 LASSERT(OST_GET_INFO == 7);
42 LASSERT(OST_CONNECT == 8);
43 LASSERT(OST_DISCONNECT == 9);
44 LASSERT(OST_PUNCH == 10);
45 LASSERT(OST_OPEN == 11);
46 LASSERT(OST_CLOSE == 12);
47 LASSERT(OST_STATFS == 13);
48 LASSERT(OST_SAN_READ == 14);
49 LASSERT(OST_SAN_WRITE == 15);
50 LASSERT(OST_SYNC == 16);
51 LASSERT(OST_LAST_OPC == 18);
52 LASSERT(OBD_OBJECT_EOF == 0xffffffffffffffffULL);
53 LASSERT(OST_REQ_HAS_OA1 == 1);
54 LASSERT(MDS_GETATTR == 33);
55 LASSERT(MDS_GETATTR_NAME == 34);
56 LASSERT(MDS_CLOSE == 35);
57 LASSERT(MDS_REINT == 36);
58 LASSERT(MDS_READPAGE == 37);
59 LASSERT(MDS_CONNECT == 38);
60 LASSERT(MDS_DISCONNECT == 39);
61 LASSERT(MDS_GETSTATUS == 40);
62 LASSERT(MDS_STATFS == 41);
63 LASSERT(MDS_PIN == 42);
64 LASSERT(MDS_UNPIN == 43);
65 LASSERT(MDS_SYNC == 44);
66 LASSERT(MDS_DONE_WRITING == 45);
67 LASSERT(MDS_LAST_OPC == 46);
68 LASSERT(REINT_SETATTR == 1);
69 LASSERT(REINT_CREATE == 2);
70 LASSERT(REINT_LINK == 3);
71 LASSERT(REINT_UNLINK == 4);
72 LASSERT(REINT_RENAME == 5);
73 LASSERT(REINT_OPEN == 6);
74 LASSERT(REINT_MAX == 6);
75 LASSERT(DISP_IT_EXECD == 1);
76 LASSERT(DISP_LOOKUP_EXECD == 2);
77 LASSERT(DISP_LOOKUP_NEG == 4);
78 LASSERT(DISP_LOOKUP_POS == 8);
79 LASSERT(DISP_OPEN_CREATE == 16);
80 LASSERT(DISP_OPEN_OPEN == 32);
81 LASSERT(MDS_STATUS_CONN == 1);
82 LASSERT(MDS_STATUS_LOV == 2);
83 LASSERT(MDS_OPEN_HAS_EA == 1073741824);
84 LASSERT(LDLM_ENQUEUE == 101);
85 LASSERT(LDLM_CONVERT == 102);
86 LASSERT(LDLM_CANCEL == 103);
87 LASSERT(LDLM_BL_CALLBACK == 104);
88 LASSERT(LDLM_CP_CALLBACK == 105);
89 LASSERT(LDLM_LAST_OPC == 106);
96 LASSERT(PTLBD_QUERY == 200);
97 LASSERT(PTLBD_READ == 201);
98 LASSERT(PTLBD_WRITE == 202);
99 LASSERT(PTLBD_FLUSH == 203);
100 LASSERT(PTLBD_CONNECT == 204);
101 LASSERT(PTLBD_DISCONNECT == 205);
102 LASSERT(PTLBD_LAST_OPC == 206);
103 LASSERT(MGMT_CONNECT == 250);
104 LASSERT(MGMT_DISCONNECT == 251);
105 LASSERT(MGMT_EXCEPTION == 252);
106 LASSERT(OBD_PING == 400);
107 LASSERT(OBD_LOG_CANCEL == 401);
108 LASSERT(OBD_LAST_OPC == 402);
109 /* Sizes and Offsets */
112 /* Checks for struct lustre_handle */
113 LASSERT((int)sizeof(struct lustre_handle) == 8);
114 LASSERT(offsetof(struct lustre_handle, cookie) == 0);
115 LASSERT((int)sizeof(((struct lustre_handle *)0)->cookie) == 8);
117 /* Checks for struct lustre_msg */
118 LASSERT((int)sizeof(struct lustre_msg) == 64);
119 LASSERT(offsetof(struct lustre_msg, handle) == 0);
120 LASSERT((int)sizeof(((struct lustre_msg *)0)->handle) == 8);
121 LASSERT(offsetof(struct lustre_msg, magic) == 8);
122 LASSERT((int)sizeof(((struct lustre_msg *)0)->magic) == 4);
123 LASSERT(offsetof(struct lustre_msg, type) == 12);
124 LASSERT((int)sizeof(((struct lustre_msg *)0)->type) == 4);
125 LASSERT(offsetof(struct lustre_msg, version) == 16);
126 LASSERT((int)sizeof(((struct lustre_msg *)0)->version) == 4);
127 LASSERT(offsetof(struct lustre_msg, opc) == 20);
128 LASSERT((int)sizeof(((struct lustre_msg *)0)->opc) == 4);
129 LASSERT(offsetof(struct lustre_msg, last_xid) == 24);
130 LASSERT((int)sizeof(((struct lustre_msg *)0)->last_xid) == 8);
131 LASSERT(offsetof(struct lustre_msg, last_committed) == 32);
132 LASSERT((int)sizeof(((struct lustre_msg *)0)->last_committed) == 8);
133 LASSERT(offsetof(struct lustre_msg, transno) == 40);
134 LASSERT((int)sizeof(((struct lustre_msg *)0)->transno) == 8);
135 LASSERT(offsetof(struct lustre_msg, status) == 48);
136 LASSERT((int)sizeof(((struct lustre_msg *)0)->status) == 4);
137 LASSERT(offsetof(struct lustre_msg, flags) == 52);
138 LASSERT((int)sizeof(((struct lustre_msg *)0)->flags) == 4);
139 LASSERT(offsetof(struct lustre_msg, bufcount) == 60);
140 LASSERT((int)sizeof(((struct lustre_msg *)0)->bufcount) == 4);
141 LASSERT(offsetof(struct lustre_msg, buflens[7]) == 92);
142 LASSERT((int)sizeof(((struct lustre_msg *)0)->buflens[7]) == 4);
144 /* Checks for struct obdo */
145 LASSERT((int)sizeof(struct obdo) == 168);
146 LASSERT(offsetof(struct obdo, o_id) == 0);
147 LASSERT((int)sizeof(((struct obdo *)0)->o_id) == 8);
148 LASSERT(offsetof(struct obdo, o_gr) == 8);
149 LASSERT((int)sizeof(((struct obdo *)0)->o_gr) == 8);
150 LASSERT(offsetof(struct obdo, o_atime) == 16);
151 LASSERT((int)sizeof(((struct obdo *)0)->o_atime) == 8);
152 LASSERT(offsetof(struct obdo, o_mtime) == 24);
153 LASSERT((int)sizeof(((struct obdo *)0)->o_mtime) == 8);
154 LASSERT(offsetof(struct obdo, o_ctime) == 32);
155 LASSERT((int)sizeof(((struct obdo *)0)->o_ctime) == 8);
156 LASSERT(offsetof(struct obdo, o_size) == 40);
157 LASSERT((int)sizeof(((struct obdo *)0)->o_size) == 8);
158 LASSERT(offsetof(struct obdo, o_blocks) == 48);
159 LASSERT((int)sizeof(((struct obdo *)0)->o_blocks) == 8);
160 LASSERT(offsetof(struct obdo, o_rdev) == 56);
161 LASSERT((int)sizeof(((struct obdo *)0)->o_rdev) == 8);
162 LASSERT(offsetof(struct obdo, o_blksize) == 64);
163 LASSERT((int)sizeof(((struct obdo *)0)->o_blksize) == 4);
164 LASSERT(offsetof(struct obdo, o_mode) == 68);
165 LASSERT((int)sizeof(((struct obdo *)0)->o_mode) == 4);
166 LASSERT(offsetof(struct obdo, o_uid) == 72);
167 LASSERT((int)sizeof(((struct obdo *)0)->o_uid) == 4);
168 LASSERT(offsetof(struct obdo, o_gid) == 76);
169 LASSERT((int)sizeof(((struct obdo *)0)->o_gid) == 4);
170 LASSERT(offsetof(struct obdo, o_flags) == 80);
171 LASSERT((int)sizeof(((struct obdo *)0)->o_flags) == 4);
172 LASSERT(offsetof(struct obdo, o_nlink) == 84);
173 LASSERT((int)sizeof(((struct obdo *)0)->o_nlink) == 4);
174 LASSERT(offsetof(struct obdo, o_generation) == 88);
175 LASSERT((int)sizeof(((struct obdo *)0)->o_generation) == 4);
176 LASSERT(offsetof(struct obdo, o_valid) == 92);
177 LASSERT((int)sizeof(((struct obdo *)0)->o_valid) == 4);
178 LASSERT(offsetof(struct obdo, o_obdflags) == 96);
179 LASSERT((int)sizeof(((struct obdo *)0)->o_obdflags) == 4);
180 LASSERT(offsetof(struct obdo, o_easize) == 100);
181 LASSERT((int)sizeof(((struct obdo *)0)->o_easize) == 4);
182 LASSERT(offsetof(struct obdo, o_inline) == 104);
183 LASSERT((int)sizeof(((struct obdo *)0)->o_inline) == 64);
184 LASSERT(OBD_MD_FLID == 1);
185 LASSERT(OBD_MD_FLATIME == 2);
186 LASSERT(OBD_MD_FLMTIME == 4);
187 LASSERT(OBD_MD_FLCTIME == 8);
188 LASSERT(OBD_MD_FLSIZE == 16);
189 LASSERT(OBD_MD_FLBLOCKS == 32);
190 LASSERT(OBD_MD_FLBLKSZ == 64);
191 LASSERT(OBD_MD_FLMODE == 128);
192 LASSERT(OBD_MD_FLTYPE == 256);
193 LASSERT(OBD_MD_FLUID == 512);
194 LASSERT(OBD_MD_FLGID == 1024);
195 LASSERT(OBD_MD_FLFLAGS == 2048);
196 LASSERT(OBD_MD_FLOBDFLG == 4096);
197 LASSERT(OBD_MD_FLNLINK == 8192);
198 LASSERT(OBD_MD_FLGENER == 16384);
199 LASSERT(OBD_MD_FLINLINE == 32768);
200 LASSERT(OBD_MD_FLRDEV == 65536);
201 LASSERT(OBD_MD_FLEASIZE == 131072);
202 LASSERT(OBD_MD_LINKNAME == 262144);
203 LASSERT(OBD_MD_FLHANDLE == 524288);
204 LASSERT(OBD_MD_FLCKSUM == 1048576);
205 LASSERT(OBD_MD_FLQOS == 2097152);
206 LASSERT(OBD_MD_FLOSCOPQ == 4194304);
207 LASSERT(OBD_MD_FLCOOKIE == 8388608);
208 LASSERT(OBD_MD_FLGROUP == 16777216);
209 LASSERT(OBD_FL_INLINEDATA == 1);
210 LASSERT(OBD_FL_OBDMDEXISTS == 2);
211 LASSERT(OBD_FL_DELORPHAN == 4);
212 LASSERT(OBD_FL_NORPC == 8);
213 LASSERT(OBD_FL_IDONLY == 16);
215 /* Checks for struct lov_mds_md_v1 */
216 LASSERT((int)sizeof(struct lov_mds_md_v1) == 32);
217 LASSERT(offsetof(struct lov_mds_md_v1, lmm_magic) == 0);
218 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_magic) == 4);
219 LASSERT(offsetof(struct lov_mds_md_v1, lmm_pattern) == 4);
220 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_pattern) == 4);
221 LASSERT(offsetof(struct lov_mds_md_v1, lmm_object_id) == 8);
222 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_id) == 8);
223 LASSERT(offsetof(struct lov_mds_md_v1, lmm_object_gr) == 16);
224 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_object_gr) == 8);
225 LASSERT(offsetof(struct lov_mds_md_v1, lmm_stripe_size) == 24);
226 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_size) == 4);
227 LASSERT(offsetof(struct lov_mds_md_v1, lmm_stripe_count) == 28);
228 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_stripe_count) == 4);
229 LASSERT(offsetof(struct lov_mds_md_v1, lmm_objects) == 32);
230 LASSERT((int)sizeof(((struct lov_mds_md_v1 *)0)->lmm_objects) == 0);
232 /* Checks for struct lov_ost_data_v1 */
233 LASSERT((int)sizeof(struct lov_ost_data_v1) == 24);
234 LASSERT(offsetof(struct lov_ost_data_v1, l_object_id) == 0);
235 LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_id) == 8);
236 LASSERT(offsetof(struct lov_ost_data_v1, l_object_gr) == 8);
237 LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_object_gr) == 8);
238 LASSERT(offsetof(struct lov_ost_data_v1, l_ost_gen) == 16);
239 LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_gen) == 4);
240 LASSERT(offsetof(struct lov_ost_data_v1, l_ost_idx) == 20);
241 LASSERT((int)sizeof(((struct lov_ost_data_v1 *)0)->l_ost_idx) == 4);
242 LASSERT(LOV_MAGIC_V0 == 198183888);
243 LASSERT(LOV_MAGIC_V1 == 198249424);
244 LASSERT(LOV_PATTERN_RAID0 == 1);
245 LASSERT(LOV_PATTERN_RAID1 == 2);
247 /* Checks for struct obd_statfs */
248 LASSERT((int)sizeof(struct obd_statfs) == 144);
249 LASSERT(offsetof(struct obd_statfs, os_type) == 0);
250 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_type) == 8);
251 LASSERT(offsetof(struct obd_statfs, os_blocks) == 8);
252 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_blocks) == 8);
253 LASSERT(offsetof(struct obd_statfs, os_bfree) == 16);
254 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_bfree) == 8);
255 LASSERT(offsetof(struct obd_statfs, os_bavail) == 24);
256 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_bavail) == 8);
257 LASSERT(offsetof(struct obd_statfs, os_ffree) == 40);
258 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_ffree) == 8);
259 LASSERT(offsetof(struct obd_statfs, os_fsid) == 48);
260 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_fsid) == 40);
261 LASSERT(offsetof(struct obd_statfs, os_bsize) == 88);
262 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_bsize) == 4);
263 LASSERT(offsetof(struct obd_statfs, os_namelen) == 92);
264 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_namelen) == 4);
265 LASSERT(offsetof(struct obd_statfs, os_spare) == 104);
266 LASSERT((int)sizeof(((struct obd_statfs *)0)->os_spare) == 40);
268 /* Checks for struct obd_ioobj */
269 LASSERT((int)sizeof(struct obd_ioobj) == 24);
270 LASSERT(offsetof(struct obd_ioobj, ioo_id) == 0);
271 LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_id) == 8);
272 LASSERT(offsetof(struct obd_ioobj, ioo_gr) == 8);
273 LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_gr) == 8);
274 LASSERT(offsetof(struct obd_ioobj, ioo_type) == 16);
275 LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_type) == 4);
276 LASSERT(offsetof(struct obd_ioobj, ioo_bufcnt) == 20);
277 LASSERT((int)sizeof(((struct obd_ioobj *)0)->ioo_bufcnt) == 4);
279 /* Checks for struct niobuf_remote */
280 LASSERT((int)sizeof(struct niobuf_remote) == 16);
281 LASSERT(offsetof(struct niobuf_remote, offset) == 0);
282 LASSERT((int)sizeof(((struct niobuf_remote *)0)->offset) == 8);
283 LASSERT(offsetof(struct niobuf_remote, len) == 8);
284 LASSERT((int)sizeof(((struct niobuf_remote *)0)->len) == 4);
285 LASSERT(offsetof(struct niobuf_remote, flags) == 12);
286 LASSERT((int)sizeof(((struct niobuf_remote *)0)->flags) == 4);
287 LASSERT(OBD_BRW_READ == 1);
288 LASSERT(OBD_BRW_WRITE == 2);
289 LASSERT(OBD_BRW_CREATE == 4);
290 LASSERT(OBD_BRW_SYNC == 8);
291 LASSERT(OBD_BRW_FROM_GRANT == 32);
293 /* Checks for struct ost_body */
294 LASSERT((int)sizeof(struct ost_body) == 168);
295 LASSERT(offsetof(struct ost_body, oa) == 0);
296 LASSERT((int)sizeof(((struct ost_body *)0)->oa) == 168);
298 /* Checks for struct ll_fid */
299 LASSERT((int)sizeof(struct ll_fid) == 16);
300 LASSERT(offsetof(struct ll_fid, id) == 0);
301 LASSERT((int)sizeof(((struct ll_fid *)0)->id) == 8);
302 LASSERT(offsetof(struct ll_fid, generation) == 8);
303 LASSERT((int)sizeof(((struct ll_fid *)0)->generation) == 4);
304 LASSERT(offsetof(struct ll_fid, f_type) == 12);
305 LASSERT((int)sizeof(((struct ll_fid *)0)->f_type) == 4);
307 /* Checks for struct mds_status_req */
308 LASSERT((int)sizeof(struct mds_status_req) == 8);
309 LASSERT(offsetof(struct mds_status_req, flags) == 0);
310 LASSERT((int)sizeof(((struct mds_status_req *)0)->flags) == 4);
311 LASSERT(offsetof(struct mds_status_req, repbuf) == 4);
312 LASSERT((int)sizeof(((struct mds_status_req *)0)->repbuf) == 4);
314 /* Checks for struct mds_body */
315 LASSERT((int)sizeof(struct mds_body) == 136);
316 LASSERT(offsetof(struct mds_body, fid1) == 0);
317 LASSERT((int)sizeof(((struct mds_body *)0)->fid1) == 16);
318 LASSERT(offsetof(struct mds_body, fid2) == 16);
319 LASSERT((int)sizeof(((struct mds_body *)0)->fid2) == 16);
320 LASSERT(offsetof(struct mds_body, handle) == 32);
321 LASSERT((int)sizeof(((struct mds_body *)0)->handle) == 8);
322 LASSERT(offsetof(struct mds_body, size) == 40);
323 LASSERT((int)sizeof(((struct mds_body *)0)->size) == 8);
324 LASSERT(offsetof(struct mds_body, blocks) == 48);
325 LASSERT((int)sizeof(((struct mds_body *)0)->blocks) == 8);
326 LASSERT(offsetof(struct mds_body, io_epoch) == 56);
327 LASSERT((int)sizeof(((struct mds_body *)0)->io_epoch) == 8);
328 LASSERT(offsetof(struct mds_body, ino) == 64);
329 LASSERT((int)sizeof(((struct mds_body *)0)->ino) == 4);
330 LASSERT(offsetof(struct mds_body, valid) == 68);
331 LASSERT((int)sizeof(((struct mds_body *)0)->valid) == 4);
332 LASSERT(offsetof(struct mds_body, fsuid) == 72);
333 LASSERT((int)sizeof(((struct mds_body *)0)->fsuid) == 4);
334 LASSERT(offsetof(struct mds_body, fsgid) == 76);
335 LASSERT((int)sizeof(((struct mds_body *)0)->fsgid) == 4);
336 LASSERT(offsetof(struct mds_body, capability) == 80);
337 LASSERT((int)sizeof(((struct mds_body *)0)->capability) == 4);
338 LASSERT(offsetof(struct mds_body, mode) == 84);
339 LASSERT((int)sizeof(((struct mds_body *)0)->mode) == 4);
340 LASSERT(offsetof(struct mds_body, uid) == 88);
341 LASSERT((int)sizeof(((struct mds_body *)0)->uid) == 4);
342 LASSERT(offsetof(struct mds_body, gid) == 92);
343 LASSERT((int)sizeof(((struct mds_body *)0)->gid) == 4);
344 LASSERT(offsetof(struct mds_body, mtime) == 96);
345 LASSERT((int)sizeof(((struct mds_body *)0)->mtime) == 4);
346 LASSERT(offsetof(struct mds_body, ctime) == 100);
347 LASSERT((int)sizeof(((struct mds_body *)0)->ctime) == 4);
348 LASSERT(offsetof(struct mds_body, atime) == 104);
349 LASSERT((int)sizeof(((struct mds_body *)0)->atime) == 4);
350 LASSERT(offsetof(struct mds_body, flags) == 108);
351 LASSERT((int)sizeof(((struct mds_body *)0)->flags) == 4);
352 LASSERT(offsetof(struct mds_body, rdev) == 112);
353 LASSERT((int)sizeof(((struct mds_body *)0)->rdev) == 4);
354 LASSERT(offsetof(struct mds_body, nlink) == 116);
355 LASSERT((int)sizeof(((struct mds_body *)0)->nlink) == 4);
356 LASSERT(offsetof(struct mds_body, generation) == 120);
357 LASSERT((int)sizeof(((struct mds_body *)0)->generation) == 4);
358 LASSERT(offsetof(struct mds_body, suppgid) == 124);
359 LASSERT((int)sizeof(((struct mds_body *)0)->suppgid) == 4);
360 LASSERT(offsetof(struct mds_body, eadatasize) == 128);
361 LASSERT((int)sizeof(((struct mds_body *)0)->eadatasize) == 4);
362 LASSERT(FMODE_READ == 1);
363 LASSERT(FMODE_WRITE == 2);
364 LASSERT(FMODE_EXEC == 4);
365 LASSERT(MDS_OPEN_CREAT == 64);
366 LASSERT(MDS_OPEN_EXCL == 128);
367 LASSERT(MDS_OPEN_TRUNC == 512);
368 LASSERT(MDS_OPEN_APPEND == 1024);
369 LASSERT(MDS_OPEN_SYNC == 4096);
370 LASSERT(MDS_OPEN_DIRECTORY == 65536);
371 LASSERT(MDS_OPEN_DELAY_CREATE == 16777216);
372 LASSERT(MDS_OPEN_HAS_EA == 1073741824);
374 /* Checks for struct mds_rec_setattr */
375 LASSERT((int)sizeof(struct mds_rec_setattr) == 88);
376 LASSERT(offsetof(struct mds_rec_setattr, sa_opcode) == 0);
377 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_opcode) == 4);
378 LASSERT(offsetof(struct mds_rec_setattr, sa_fsuid) == 4);
379 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_fsuid) == 4);
380 LASSERT(offsetof(struct mds_rec_setattr, sa_fsgid) == 8);
381 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_fsgid) == 4);
382 LASSERT(offsetof(struct mds_rec_setattr, sa_cap) == 12);
383 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_cap) == 4);
384 LASSERT(offsetof(struct mds_rec_setattr, sa_suppgid) == 16);
385 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_suppgid) == 4);
386 LASSERT(offsetof(struct mds_rec_setattr, sa_valid) == 20);
387 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_valid) == 4);
388 LASSERT(offsetof(struct mds_rec_setattr, sa_fid) == 24);
389 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_fid) == 16);
390 LASSERT(offsetof(struct mds_rec_setattr, sa_mode) == 40);
391 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_mode) == 4);
392 LASSERT(offsetof(struct mds_rec_setattr, sa_uid) == 44);
393 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_uid) == 4);
394 LASSERT(offsetof(struct mds_rec_setattr, sa_gid) == 48);
395 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_gid) == 4);
396 LASSERT(offsetof(struct mds_rec_setattr, sa_attr_flags) == 52);
397 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_attr_flags) == 4);
398 LASSERT(offsetof(struct mds_rec_setattr, sa_size) == 56);
399 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_size) == 8);
400 LASSERT(offsetof(struct mds_rec_setattr, sa_atime) == 64);
401 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_atime) == 8);
402 LASSERT(offsetof(struct mds_rec_setattr, sa_mtime) == 72);
403 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_mtime) == 8);
404 LASSERT(offsetof(struct mds_rec_setattr, sa_ctime) == 80);
405 LASSERT((int)sizeof(((struct mds_rec_setattr *)0)->sa_ctime) == 8);
407 /* Checks for struct mds_rec_create */
408 LASSERT((int)sizeof(struct mds_rec_create) == 80);
409 LASSERT(offsetof(struct mds_rec_create, cr_opcode) == 0);
410 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_opcode) == 4);
411 LASSERT(offsetof(struct mds_rec_create, cr_fsuid) == 4);
412 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_fsuid) == 4);
413 LASSERT(offsetof(struct mds_rec_create, cr_fsgid) == 8);
414 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_fsgid) == 4);
415 LASSERT(offsetof(struct mds_rec_create, cr_cap) == 12);
416 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_cap) == 4);
417 LASSERT(offsetof(struct mds_rec_create, cr_flags) == 16);
418 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_flags) == 4);
419 LASSERT(offsetof(struct mds_rec_create, cr_mode) == 20);
420 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_mode) == 4);
421 LASSERT(offsetof(struct mds_rec_create, cr_fid) == 24);
422 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_fid) == 16);
423 LASSERT(offsetof(struct mds_rec_create, cr_replayfid) == 40);
424 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_replayfid) == 16);
425 LASSERT(offsetof(struct mds_rec_create, cr_time) == 56);
426 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_time) == 8);
427 LASSERT(offsetof(struct mds_rec_create, cr_rdev) == 64);
428 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_rdev) == 8);
429 LASSERT(offsetof(struct mds_rec_create, cr_suppgid) == 72);
430 LASSERT((int)sizeof(((struct mds_rec_create *)0)->cr_suppgid) == 4);
432 /* Checks for struct mds_rec_link */
433 LASSERT((int)sizeof(struct mds_rec_link) == 64);
434 LASSERT(offsetof(struct mds_rec_link, lk_opcode) == 0);
435 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_opcode) == 4);
436 LASSERT(offsetof(struct mds_rec_link, lk_fsuid) == 4);
437 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fsuid) == 4);
438 LASSERT(offsetof(struct mds_rec_link, lk_fsgid) == 8);
439 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fsgid) == 4);
440 LASSERT(offsetof(struct mds_rec_link, lk_cap) == 12);
441 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_cap) == 4);
442 LASSERT(offsetof(struct mds_rec_link, lk_suppgid1) == 16);
443 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_suppgid1) == 4);
444 LASSERT(offsetof(struct mds_rec_link, lk_suppgid2) == 20);
445 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_suppgid2) == 4);
446 LASSERT(offsetof(struct mds_rec_link, lk_fid1) == 24);
447 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fid1) == 16);
448 LASSERT(offsetof(struct mds_rec_link, lk_fid2) == 40);
449 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_fid2) == 16);
450 LASSERT(offsetof(struct mds_rec_link, lk_time) == 56);
451 LASSERT((int)sizeof(((struct mds_rec_link *)0)->lk_time) == 8);
453 /* Checks for struct mds_rec_unlink */
454 LASSERT((int)sizeof(struct mds_rec_unlink) == 64);
455 LASSERT(offsetof(struct mds_rec_unlink, ul_opcode) == 0);
456 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_opcode) == 4);
457 LASSERT(offsetof(struct mds_rec_unlink, ul_fsuid) == 4);
458 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fsuid) == 4);
459 LASSERT(offsetof(struct mds_rec_unlink, ul_fsgid) == 8);
460 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fsgid) == 4);
461 LASSERT(offsetof(struct mds_rec_unlink, ul_cap) == 12);
462 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_cap) == 4);
463 LASSERT(offsetof(struct mds_rec_unlink, ul_suppgid) == 16);
464 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_suppgid) == 4);
465 LASSERT(offsetof(struct mds_rec_unlink, ul_mode) == 20);
466 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_mode) == 4);
467 LASSERT(offsetof(struct mds_rec_unlink, ul_fid1) == 24);
468 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fid1) == 16);
469 LASSERT(offsetof(struct mds_rec_unlink, ul_fid2) == 40);
470 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_fid2) == 16);
471 LASSERT(offsetof(struct mds_rec_unlink, ul_time) == 56);
472 LASSERT((int)sizeof(((struct mds_rec_unlink *)0)->ul_time) == 8);
474 /* Checks for struct mds_rec_rename */
475 LASSERT((int)sizeof(struct mds_rec_rename) == 64);
476 LASSERT(offsetof(struct mds_rec_rename, rn_opcode) == 0);
477 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_opcode) == 4);
478 LASSERT(offsetof(struct mds_rec_rename, rn_fsuid) == 4);
479 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fsuid) == 4);
480 LASSERT(offsetof(struct mds_rec_rename, rn_fsgid) == 8);
481 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fsgid) == 4);
482 LASSERT(offsetof(struct mds_rec_rename, rn_cap) == 12);
483 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_cap) == 4);
484 LASSERT(offsetof(struct mds_rec_rename, rn_suppgid1) == 16);
485 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_suppgid1) == 4);
486 LASSERT(offsetof(struct mds_rec_rename, rn_suppgid2) == 20);
487 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_suppgid2) == 4);
488 LASSERT(offsetof(struct mds_rec_rename, rn_fid1) == 24);
489 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fid1) == 16);
490 LASSERT(offsetof(struct mds_rec_rename, rn_fid2) == 40);
491 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_fid2) == 16);
492 LASSERT(offsetof(struct mds_rec_rename, rn_time) == 56);
493 LASSERT((int)sizeof(((struct mds_rec_rename *)0)->rn_time) == 8);
495 /* Checks for struct lov_desc */
496 LASSERT((int)sizeof(struct lov_desc) == 72);
497 LASSERT(offsetof(struct lov_desc, ld_tgt_count) == 0);
498 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_tgt_count) == 4);
499 LASSERT(offsetof(struct lov_desc, ld_active_tgt_count) == 4);
500 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_active_tgt_count) == 4);
501 LASSERT(offsetof(struct lov_desc, ld_default_stripe_count) == 8);
502 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_count) == 4);
503 LASSERT(offsetof(struct lov_desc, ld_pattern) == 12);
504 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_pattern) == 4);
505 LASSERT(offsetof(struct lov_desc, ld_default_stripe_size) == 16);
506 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_size) == 8);
507 LASSERT(offsetof(struct lov_desc, ld_default_stripe_offset) == 24);
508 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_default_stripe_offset) == 8);
509 LASSERT(offsetof(struct lov_desc, ld_uuid) == 32);
510 LASSERT((int)sizeof(((struct lov_desc *)0)->ld_uuid) == 40);
512 /* Checks for struct ldlm_res_id */
513 LASSERT((int)sizeof(struct ldlm_res_id) == 32);
514 LASSERT(offsetof(struct ldlm_res_id, name[4]) == 32);
515 LASSERT((int)sizeof(((struct ldlm_res_id *)0)->name[4]) == 8);
517 /* Checks for struct ldlm_extent */
518 LASSERT((int)sizeof(struct ldlm_extent) == 16);
519 LASSERT(offsetof(struct ldlm_extent, start) == 0);
520 LASSERT((int)sizeof(((struct ldlm_extent *)0)->start) == 8);
521 LASSERT(offsetof(struct ldlm_extent, end) == 8);
522 LASSERT((int)sizeof(((struct ldlm_extent *)0)->end) == 8);
524 /* Checks for struct ldlm_flock */
525 LASSERT((int)sizeof(struct ldlm_flock) == 32);
526 LASSERT(offsetof(struct ldlm_flock, start) == 0);
527 LASSERT((int)sizeof(((struct ldlm_flock *)0)->start) == 8);
528 LASSERT(offsetof(struct ldlm_flock, end) == 8);
529 LASSERT((int)sizeof(((struct ldlm_flock *)0)->end) == 8);
530 LASSERT(offsetof(struct ldlm_flock, blocking_export) == 16);
531 LASSERT((int)sizeof(((struct ldlm_flock *)0)->blocking_export) == 8);
532 LASSERT(offsetof(struct ldlm_flock, blocking_pid) == 24);
533 LASSERT((int)sizeof(((struct ldlm_flock *)0)->blocking_pid) == 4);
534 LASSERT(offsetof(struct ldlm_flock, pid) == 28);
535 LASSERT((int)sizeof(((struct ldlm_flock *)0)->pid) == 4);
537 /* Checks for struct ldlm_intent */
538 LASSERT((int)sizeof(struct ldlm_intent) == 8);
539 LASSERT(offsetof(struct ldlm_intent, opc) == 0);
540 LASSERT((int)sizeof(((struct ldlm_intent *)0)->opc) == 8);
542 /* Checks for struct ldlm_resource_desc */
543 LASSERT((int)sizeof(struct ldlm_resource_desc) == 52);
544 LASSERT(offsetof(struct ldlm_resource_desc, lr_type) == 0);
545 LASSERT((int)sizeof(((struct ldlm_resource_desc *)0)->lr_type) == 4);
546 LASSERT(offsetof(struct ldlm_resource_desc, lr_name) == 4);
547 LASSERT((int)sizeof(((struct ldlm_resource_desc *)0)->lr_name) == 32);
548 LASSERT(offsetof(struct ldlm_resource_desc, lr_version[4]) == 52);
549 LASSERT((int)sizeof(((struct ldlm_resource_desc *)0)->lr_version[4]) == 4);
551 /* Checks for struct ldlm_lock_desc */
552 LASSERT((int)sizeof(struct ldlm_lock_desc) == 108);
553 LASSERT(offsetof(struct ldlm_lock_desc, l_resource) == 0);
554 LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_resource) == 52);
555 LASSERT(offsetof(struct ldlm_lock_desc, l_req_mode) == 52);
556 LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_req_mode) == 4);
557 LASSERT(offsetof(struct ldlm_lock_desc, l_granted_mode) == 56);
558 LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_granted_mode) == 4);
559 LASSERT(offsetof(struct ldlm_lock_desc, l_policy_data) == 60);
560 LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_policy_data) == 32);
561 LASSERT(offsetof(struct ldlm_lock_desc, l_version[4]) == 108);
562 LASSERT((int)sizeof(((struct ldlm_lock_desc *)0)->l_version[4]) == 4);
564 /* Checks for struct ldlm_request */
565 LASSERT((int)sizeof(struct ldlm_request) == 128);
566 LASSERT(offsetof(struct ldlm_request, lock_flags) == 0);
567 LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_flags) == 4);
568 LASSERT(offsetof(struct ldlm_request, lock_desc) == 4);
569 LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_desc) == 108);
570 LASSERT(offsetof(struct ldlm_request, lock_handle1) == 112);
571 LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_handle1) == 8);
572 LASSERT(offsetof(struct ldlm_request, lock_handle2) == 120);
573 LASSERT((int)sizeof(((struct ldlm_request *)0)->lock_handle2) == 8);
575 /* Checks for struct ldlm_reply */
576 LASSERT((int)sizeof(struct ldlm_reply) == 96);
577 LASSERT(offsetof(struct ldlm_reply, lock_flags) == 0);
578 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_flags) == 4);
579 LASSERT(offsetof(struct ldlm_reply, lock_mode) == 4);
580 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_mode) == 4);
581 LASSERT(offsetof(struct ldlm_reply, lock_resource_name) == 8);
582 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_resource_name) == 32);
583 LASSERT(offsetof(struct ldlm_reply, lock_handle) == 40);
584 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_handle) == 8);
585 LASSERT(offsetof(struct ldlm_reply, lock_policy_data) == 48);
586 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_policy_data) == 32);
587 LASSERT(offsetof(struct ldlm_reply, lock_policy_res1) == 80);
588 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res1) == 8);
589 LASSERT(offsetof(struct ldlm_reply, lock_policy_res2) == 88);
590 LASSERT((int)sizeof(((struct ldlm_reply *)0)->lock_policy_res2) == 8);
592 /* Checks for struct ptlbd_op */
593 LASSERT((int)sizeof(struct ptlbd_op) == 12);
594 LASSERT(offsetof(struct ptlbd_op, op_cmd) == 0);
595 LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_cmd) == 2);
596 LASSERT(offsetof(struct ptlbd_op, op_lun) == 2);
597 LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_lun) == 2);
598 LASSERT(offsetof(struct ptlbd_op, op_niob_cnt) == 4);
599 LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_niob_cnt) == 2);
600 LASSERT(offsetof(struct ptlbd_op, op__padding) == 6);
601 LASSERT((int)sizeof(((struct ptlbd_op *)0)->op__padding) == 2);
602 LASSERT(offsetof(struct ptlbd_op, op_block_cnt) == 8);
603 LASSERT((int)sizeof(((struct ptlbd_op *)0)->op_block_cnt) == 4);
605 /* Checks for struct ptlbd_niob */
606 LASSERT((int)sizeof(struct ptlbd_niob) == 24);
607 LASSERT(offsetof(struct ptlbd_niob, n_xid) == 0);
608 LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_xid) == 8);
609 LASSERT(offsetof(struct ptlbd_niob, n_block_nr) == 8);
610 LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_block_nr) == 8);
611 LASSERT(offsetof(struct ptlbd_niob, n_offset) == 16);
612 LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_offset) == 4);
613 LASSERT(offsetof(struct ptlbd_niob, n_length) == 20);
614 LASSERT((int)sizeof(((struct ptlbd_niob *)0)->n_length) == 4);
616 /* Checks for struct ptlbd_rsp */
617 LASSERT((int)sizeof(struct ptlbd_rsp) == 4);
618 LASSERT(offsetof(struct ptlbd_rsp, r_status) == 0);
619 LASSERT((int)sizeof(((struct ptlbd_rsp *)0)->r_status) == 2);
620 LASSERT(offsetof(struct ptlbd_rsp, r_error_cnt) == 2);
621 LASSERT((int)sizeof(((struct ptlbd_rsp *)0)->r_error_cnt) == 2);
623 /* Checks for struct llog_logid */
624 LASSERT((int)sizeof(struct llog_logid) == 20);
625 LASSERT(offsetof(struct llog_logid, lgl_oid) == 0);
626 LASSERT((int)sizeof(((struct llog_logid *)0)->lgl_oid) == 8);
627 LASSERT(offsetof(struct llog_logid, lgl_ogr) == 8);
628 LASSERT((int)sizeof(((struct llog_logid *)0)->lgl_ogr) == 8);
629 LASSERT(offsetof(struct llog_logid, lgl_ogen) == 16);
630 LASSERT((int)sizeof(((struct llog_logid *)0)->lgl_ogen) == 4);
631 LASSERT(OST_SZ_REC == 274730752);
632 LASSERT(OST_RAID1_REC == 274731008);
633 LASSERT(MDS_UNLINK_REC == 274801668);
634 LASSERT(OBD_CFG_REC == 274857984);
635 LASSERT(PTL_CFG_REC == 274923520);
636 LASSERT(LLOG_GEN_REC == 274989056);
637 LASSERT(LLOG_HDR_MAGIC == 275010873);
638 LASSERT(LLOG_LOGID_MAGIC == 275010874);
640 /* Checks for struct llog_rec_hdr */
641 LASSERT((int)sizeof(struct llog_rec_hdr) == 16);
642 LASSERT(offsetof(struct llog_rec_hdr, lrh_len) == 0);
643 LASSERT((int)sizeof(((struct llog_rec_hdr *)0)->lrh_len) == 4);
644 LASSERT(offsetof(struct llog_rec_hdr, lrh_index) == 4);
645 LASSERT((int)sizeof(((struct llog_rec_hdr *)0)->lrh_index) == 4);
646 LASSERT(offsetof(struct llog_rec_hdr, lrh_type) == 8);
647 LASSERT((int)sizeof(((struct llog_rec_hdr *)0)->lrh_type) == 4);
649 /* Checks for struct llog_rec_tail */
650 LASSERT((int)sizeof(struct llog_rec_tail) == 8);
651 LASSERT(offsetof(struct llog_rec_tail, lrt_len) == 0);
652 LASSERT((int)sizeof(((struct llog_rec_tail *)0)->lrt_len) == 4);
653 LASSERT(offsetof(struct llog_rec_tail, lrt_index) == 4);
654 LASSERT((int)sizeof(((struct llog_rec_tail *)0)->lrt_index) == 4);
656 /* Checks for struct llog_log_hdr */
657 LASSERT((int)sizeof(struct llog_log_hdr) == 4096);
658 LASSERT(offsetof(struct llog_log_hdr, llh_hdr) == 0);
659 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_hdr) == 16);
660 LASSERT(offsetof(struct llog_log_hdr, llh_timestamp) == 16);
661 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_timestamp) == 8);
662 LASSERT(offsetof(struct llog_log_hdr, llh_count) == 24);
663 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_count) == 4);
664 LASSERT(offsetof(struct llog_log_hdr, llh_bitmap_offset) == 28);
665 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap_offset) == 4);
666 LASSERT(offsetof(struct llog_log_hdr, llh_size) == 32);
667 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_size) == 4);
668 LASSERT(offsetof(struct llog_log_hdr, llh_flags) == 36);
669 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_flags) == 4);
670 LASSERT(offsetof(struct llog_log_hdr, llh_cat_idx) == 40);
671 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_cat_idx) == 4);
672 LASSERT(offsetof(struct llog_log_hdr, llh_tgtuuid) == 44);
673 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_tgtuuid) == 40);
674 LASSERT(offsetof(struct llog_log_hdr, llh_reserved) == 84);
675 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_reserved) == 4);
676 LASSERT(offsetof(struct llog_log_hdr, llh_bitmap) == 88);
677 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_bitmap) == 4000);
678 LASSERT(offsetof(struct llog_log_hdr, llh_tail) == 4088);
679 LASSERT((int)sizeof(((struct llog_log_hdr *)0)->llh_tail) == 8);
681 /* Checks for struct llog_cookie */
682 LASSERT((int)sizeof(struct llog_cookie) == 32);
683 LASSERT(offsetof(struct llog_cookie, lgc_lgl) == 0);
684 LASSERT((int)sizeof(((struct llog_cookie *)0)->lgc_lgl) == 20);
685 LASSERT(offsetof(struct llog_cookie, lgc_subsys) == 20);
686 LASSERT((int)sizeof(((struct llog_cookie *)0)->lgc_subsys) == 4);
687 LASSERT(offsetof(struct llog_cookie, lgc_index) == 24);
688 LASSERT((int)sizeof(((struct llog_cookie *)0)->lgc_index) == 4);
690 /* Checks for struct llogd_body */
691 LASSERT((int)sizeof(struct llogd_body) == 48);
692 LASSERT(offsetof(struct llogd_body, lgd_logid) == 0);
693 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_logid) == 20);
694 LASSERT(offsetof(struct llogd_body, lgd_ctxt_idx) == 20);
695 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_ctxt_idx) == 4);
696 LASSERT(offsetof(struct llogd_body, lgd_llh_flags) == 24);
697 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_llh_flags) == 4);
698 LASSERT(offsetof(struct llogd_body, lgd_index) == 28);
699 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_index) == 4);
700 LASSERT(offsetof(struct llogd_body, lgd_saved_index) == 32);
701 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_saved_index) == 4);
702 LASSERT(offsetof(struct llogd_body, lgd_len) == 36);
703 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_len) == 4);
704 LASSERT(offsetof(struct llogd_body, lgd_cur_offset) == 40);
705 LASSERT((int)sizeof(((struct llogd_body *)0)->lgd_cur_offset) == 8);
706 LASSERT(LLOG_ORIGIN_HANDLE_CREATE == 501);
707 LASSERT(LLOG_ORIGIN_HANDLE_NEXT_BLOCK == 502);
708 LASSERT(LLOG_ORIGIN_HANDLE_READ_HEADER == 503);
709 LASSERT(LLOG_ORIGIN_HANDLE_WRITE_REC == 504);
710 LASSERT(LLOG_ORIGIN_HANDLE_CLOSE == 505);
711 LASSERT(LLOG_ORIGIN_CONNECT == 506);
712 LASSERT(LLOG_CATINFO == 507);
714 /* Checks for struct llogd_conn_body */
715 LASSERT((int)sizeof(struct llogd_conn_body) == 40);
716 LASSERT(offsetof(struct llogd_conn_body, lgdc_gen) == 0);
717 LASSERT((int)sizeof(((struct llogd_conn_body *)0)->lgdc_gen) == 16);
718 LASSERT(offsetof(struct llogd_conn_body, lgdc_logid) == 16);
719 LASSERT((int)sizeof(((struct llogd_conn_body *)0)->lgdc_logid) == 20);
720 LASSERT(offsetof(struct llogd_conn_body, lgdc_ctxt_idx) == 36);
721 LASSERT((int)sizeof(((struct llogd_conn_body *)0)->lgdc_ctxt_idx) == 4);