]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux/nslu2-kernel/2.6.11-mm/reiser4.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux / nslu2-kernel / 2.6.11-mm / reiser4.patch
1 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/disk_format/disk_format40.c      2005-03-27 21:36:10.656270448 -0800
2 +++ linux-2.6.11/fs/reiser4/plugin/disk_format/disk_format40.c  2005-03-27 23:39:18.967076480 -0800
3 @@ -467,19 +467,15 @@
4         return 0;
5  }
6  
7 -#define FORMAT40_ROOT_LOCALITY 41
8 -#define FORMAT40_ROOT_OBJECTID 42
9 +#define FORMAT40_ROOT_LOCALITY 41ull
10 +#define FORMAT40_ROOT_OBJECTID 42ull
11  
12  /* plugin->u.format.root_dir_key */
13  reiser4_internal const reiser4_key *
14  root_dir_key_format40(const struct super_block *super UNUSED_ARG)
15  {
16         static const reiser4_key FORMAT40_ROOT_DIR_KEY = {
17 -               .el = {{(FORMAT40_ROOT_LOCALITY << 4) | KEY_SD_MINOR},
18 -#if REISER4_LARGE_KEY
19 -                      {0ull},
20 -#endif
21 -                      {FORMAT40_ROOT_OBJECTID}, {0ull}}
22 +               .el = { KEY_INIT(KEY_SD_MINOR,FORMAT40_ROOT_LOCALITY,0ull,0,FORMAT40_ROOT_OBJECTID,0ull) }
23         };
24  
25         return &FORMAT40_ROOT_DIR_KEY;
26 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/disk_format/disk_format40.h      2005-03-27 21:24:00.618253096 -0800
27 +++ linux-2.6.11/fs/reiser4/plugin/disk_format/disk_format40.h  2005-03-27 21:24:02.747929336 -0800
28 @@ -49,7 +49,7 @@
29         /*  70 */ d16 formatting_policy;
30         /*  72 */ d64 flags;
31         /*  72 */ char not_used[432];
32 -} format40_disk_super_block;
33 +} PACKED64 format40_disk_super_block;
34  
35  /* format 40 specific part of reiser4_super_info_data */
36  typedef struct format40_super_info {
37 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/file/invert.c    2005-03-27 21:24:00.625252032 -0800
38 +++ linux-2.6.11/fs/reiser4/plugin/file/invert.c        2005-03-27 21:24:02.747929336 -0800
39 @@ -240,14 +240,14 @@
40  typedef struct flow_header {
41         d32 fl_magic;
42         d16 fl_nr;              /* number of subfiles in the flow */
43 -};
44 +} PACKED32;
45  
46  typedef struct subfile_header {
47         d32 sh_magic;           /* subfile magic */
48         d16 sh_type;            /* type of subfile: light-weight, ordinary, invert */
49         d16 sh_arg_len;         /* lenght of lookup argument (filename, key) */
50         d32 sh_body_len;        /* lenght of subfile body */
51 -};
52 +} PACKED32;
53  
54  /* functions to get/set fields of flow header */
55  
56 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/item/static_stat.c       2005-03-27 21:24:00.648248536 -0800
57 +++ linux-2.6.11/fs/reiser4/plugin/item/static_stat.c   2005-03-27 21:34:27.331978128 -0800
58 @@ -19,6 +19,38 @@
59  
60  /* see static_stat.h for explanation */
61  
62 +/* compile time verify of the data structure sizes and alignments */
63 +static inline void
64 +r4static_stat_verify(void)
65 +{
66 +       /* All these structures are PACKED, so the __alignof__ should
67 +        * be 1.  The sizes need to be correct as they map to disk
68 +        * structures.
69 +        */
70 +       cassert(sizeof (reiser4_stat_data_base) == 2);
71 +       /* cassert(sizeof (reiser4_light_weight_stat) == 16);
72 +        * 14 bytes, comments in code do not take into account PACKED!
73 +        */
74 +       cassert(sizeof (reiser4_light_weight_stat) == 14);
75 +       cassert(sizeof (reiser4_unix_stat) == 28);
76 +       cassert(sizeof (reiser4_symlink_stat) == 0);
77 +       cassert(sizeof (reiser4_plugin_slot) == 4);
78 +       cassert(sizeof (reiser4_plugin_stat) == 2);
79 +       cassert(sizeof (reiser4_flags_stat) == 4);
80 +       /* cassert(sizeof (reiser4_capabilities_stat) == 16);
81 +        * comments in the file look wrong - capabilities are 2 x d32
82 +        * not 2 x d64 in the declaration.
83 +        */
84 +       cassert(sizeof (reiser4_capabilities_stat) == 8);
85 +       cassert(sizeof (reiser4_cluster_stat) == 1);
86 +       cassert(sizeof (reiser4_crypto_stat) == 2);
87 +       /* cassert(sizeof (reiser4_large_times_stat) == 24);
88 +        * should be 12 bytes - 3 x d32, probably a bug in the def in
89 +        * the header file (meant to be 3 x d64?)
90 +        */
91 +       cassert(sizeof (reiser4_large_times_stat) == 12);
92 +}
93 +
94  /* helper function used while we are dumping/loading inode/plugin state
95      to/from the stat-data. */
96  
97 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/item/acl.h       2005-03-27 21:24:00.629251424 -0800
98 +++ linux-2.6.11/fs/reiser4/plugin/item/acl.h   2005-03-27 21:24:02.749929032 -0800
99 @@ -26,7 +26,7 @@
100         obj_key_id id;
101         /* file name. Null terminated string. */
102         d8 name[0];
103 -} directory_entry_format;
104 +} PACKEDt(obj_key_id) directory_entry_format;
105  
106  void print_de(const char *prefix, coord_t * coord);
107  int extract_key_de(const coord_t * coord, reiser4_key * key);
108 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/item/cde.h       2005-03-27 21:24:00.632250968 -0800
109 +++ linux-2.6.11/fs/reiser4/plugin/item/cde.h   2005-03-27 21:24:02.750928880 -0800
110 @@ -15,12 +15,12 @@
111  typedef struct cde_unit_header {
112         de_id hash;
113         d16 offset;
114 -} cde_unit_header;
115 +} PACKEDt2(de_id,d16) cde_unit_header;
116  
117  typedef struct cde_item_format {
118         d16 num_of_entries;
119         cde_unit_header entry[0];
120 -} cde_item_format;
121 +} PACKEDt2(d16,cde_unit_header) cde_item_format;
122  
123  typedef struct cde_entry {
124         const struct inode *dir;
125 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/item/extent.h    2005-03-27 21:32:13.758284416 -0800
126 +++ linux-2.6.11/fs/reiser4/plugin/item/extent.h        2005-03-27 21:32:30.786695704 -0800
127 @@ -7,7 +7,7 @@
128  typedef struct {
129         reiser4_dblock_nr start;
130         reiser4_dblock_nr width;
131 -} reiser4_extent;
132 +} PACKED64 reiser4_extent;
133  
134  typedef struct extent_stat {
135         int unallocated_units;
136 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/item/internal.h  2005-03-27 21:33:08.971890672 -0800
137 +++ linux-2.6.11/fs/reiser4/plugin/item/internal.h      2005-03-27 22:15:43.290575208 -0800
138 @@ -13,7 +13,7 @@
139  typedef struct internal_item_layout {
140         /*  0 */ reiser4_dblock_nr pointer;
141         /*  4 */
142 -} internal_item_layout;
143 +} PACKED64 internal_item_layout;
144  
145  struct cut_list;
146  
147 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/item/sde.h       2005-03-27 21:24:00.646248840 -0800
148 +++ linux-2.6.11/fs/reiser4/plugin/item/sde.h   2005-03-27 21:24:02.750928880 -0800
149 @@ -26,7 +26,7 @@
150         obj_key_id id;
151         /* file name. Null terminated string. */
152         d8 name[0];
153 -} directory_entry_format;
154 +} PACKEDt(obj_key_id) directory_entry_format;
155  
156  void print_de(const char *prefix, coord_t * coord);
157  int extract_key_de(const coord_t * coord, reiser4_key * key);
158 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/node/node40.c    2005-03-27 21:24:00.654247624 -0800
159 +++ linux-2.6.11/fs/reiser4/plugin/node/node40.c        2005-03-27 21:35:08.677692624 -0800
160 @@ -32,6 +32,22 @@
161     magic (32)
162     flush_time (32)
163  */
164 +/* compile time verify of the data structure sizes and alignments */
165 +static inline void
166 +r4node40_stat_verify(void)
167 +{
168 +       /* The alignment of these structures is intended to be '1', but
169 +        * it doesn't matter so long as the size is right.
170 +        */
171 +       cassert(sizeof (common_node_header) == 2);
172 +       cassert(sizeof (node40_header) ==  28);
173 +#if REISER4_LARGE_KEY
174 +       cassert(sizeof (item_header40) == 38);
175 +#else
176 +       cassert(sizeof (item_header40) == 30);
177 +#endif
178 +}
179 +
180  /* NIKITA-FIXME-HANS: I told you guys not less than 10 times to not call it r4fs.  Change to "ReIs". */
181  /* magic number that is stored in ->magic field of node header */
182  static const __u32 REISER4_NODE_MAGIC = 0x52344653;    /* (*(__u32 *)"R4FS"); */
183 --- linux-2.6.11/.pc/reiser4/fs/reiser4/plugin/node/node.h      2005-03-27 21:24:00.656247320 -0800
184 +++ linux-2.6.11/fs/reiser4/plugin/node/node.h  2005-03-27 21:24:02.753928424 -0800
185 @@ -250,7 +250,7 @@
186         /* identifier of node plugin. Must be located at the very beginning
187            of a node. */
188         d16 plugin_id;
189 -} common_node_header;
190 +} PACKED16 common_node_header;
191  
192  /* __REISER4_NODE_H__ */
193  #endif
194 --- linux-2.6.11/.pc/reiser4/fs/reiser4/debug.c 2005-03-27 21:24:00.563261456 -0800
195 +++ linux-2.6.11/fs/reiser4/debug.c     2005-03-27 23:27:58.569512632 -0800
196 @@ -75,6 +75,72 @@
197         va_list args;
198  
199         /*
200 +        * this is here to make sure that we don't compile code which we
201 +        * know a-priori will panic, or fail without panicing, since this
202 +        * compiles first if you find a duplicate case label error then
203 +        * you need to rewrite this code to match your compiler.
204 +        */
205 +       cassert(sizeof (d8) == 1);
206 +       cassert(__alignof__ (d8) == 1);
207 +       {
208 +               struct {
209 +                       __u8 pad;
210 +                       d8 data;
211 +               } PACKED8 test;
212 +               cassert(sizeof test == 2);
213 +               cassert(sizeof test.data == 1);
214 +               cassert(__alignof__ test.data == 1);
215 +               cassert(__alignof__ test == 1);
216 +       }
217 +       cassert(sizeof (d16) == 2);
218 +       cassert(__alignof__ (d16) == 2);
219 +       {
220 +               struct {
221 +                       __u8 pad;
222 +                       d16 data;
223 +               } PACKED16 test;
224 +               cassert(sizeof test == 4);
225 +               cassert(sizeof test.data == 2);
226 +#if !__arm__
227 +               cassert(__alignof__ test.data == 2);
228 +#endif
229 +               cassert(__alignof__ test == 2);
230 +#if !__arm__
231 +               cassert(test.data.datum - &test.pad == 2);
232 +#endif
233 +       }
234 +       cassert(sizeof (d32) == 4);
235 +       cassert(__alignof__ (d32) == 4);
236 +       {
237 +               struct {
238 +                       __u8 pad;
239 +                       d32 data;
240 +               } PACKED32 test;
241 +               cassert(sizeof test == 8);
242 +               cassert(sizeof test.data == 4);
243 +               cassert(__alignof__ test.data == 4);
244 +               cassert(__alignof__ test == 4);
245 +               cassert(test.data.datum - &test.pad == 4);
246 +       }
247 +       cassert(sizeof (d64) == 8);
248 +       cassert(__alignof__ (d64) == 8);
249 +       {
250 +               struct {
251 +                       __u8 pad;
252 +                       d64 data;
253 +               } PACKED64 test;
254 +               cassert(sizeof test == 16);
255 +               cassert(sizeof test.data == 8);
256 +               cassert(__alignof__ test.data == 8);
257 +               cassert(__alignof__ test == 8);
258 +               cassert(test.data.datum - &test.pad == 8);
259 +       }
260 +
261 +       /* This is just a test of a struct with a single d64 element. */
262 +       cassert(sizeof (reiser4_dblock_nr) == 8);
263 +       cassert(__alignof__(reiser4_dblock_nr) == 8);
264 +
265 +       /*
266          * check for recursive panic.
267          */
268         if (in_panic == 0) {
269 --- linux-2.6.11/.pc/reiser4/fs/reiser4/flush_queue.c   2005-03-27 21:24:00.577259328 -0800
270 +++ linux-2.6.11/fs/reiser4/flush_queue.c       2005-03-27 21:24:02.755928120 -0800
271 @@ -447,7 +447,7 @@
272  
273                 /* If all write requests registered in this "fq" are done we up
274                  * the semaphore. */
275 -               if (atomic_sub_and_test(bio->bi_vcnt, &fq->nr_submitted))
276 +               if (atomic_sub_return(bio->bi_vcnt, &fq->nr_submitted) == 0)
277                         up(&fq->io_sem);
278         }
279  
280 --- linux-2.6.11/.pc/reiser4/fs/reiser4/key.c   2005-03-27 22:42:43.481268784 -0800
281 +++ linux-2.6.11/fs/reiser4/key.c       2005-03-27 23:42:53.958392832 -0800
282 @@ -13,10 +13,10 @@
283     independent of key scheme. */
284  static const reiser4_key MINIMAL_KEY = {
285         .el = {
286 -               {0ull},
287 -               ON_LARGE_KEY({0ull},)
288 -               {0ull},
289 -               {0ull}
290 +               {{0,0,0,0,0,0,0,0}},
291 +               ON_LARGE_KEY({{0,0,0,0,0,0,0,0}},)
292 +               {{0,0,0,0,0,0,0,0}},
293 +               {{0,0,0,0,0,0,0,0}}
294         }
295  };
296  
297 @@ -24,10 +24,10 @@
298     independent of key scheme. */
299  static const reiser4_key MAXIMAL_KEY = {
300         .el = {
301 -               {~0ull},
302 -               ON_LARGE_KEY({~0ull},)
303 -               {~0ull},
304 -               {~0ull}
305 +               {{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}},
306 +               ON_LARGE_KEY({{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}},)
307 +               {{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}},
308 +               {{0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff}}
309         }
310  };
311  
312 --- linux-2.6.11/.pc/reiser4/fs/reiser4/safe_link.c     2005-03-27 21:24:00.677244128 -0800
313 +++ linux-2.6.11/fs/reiser4/safe_link.c 2005-03-27 21:24:02.756927968 -0800
314 @@ -61,7 +61,7 @@
315         reiser4_key sdkey; /* key of stat-data for the file safe-link is
316                             * for */
317         d64 size;          /* size to which file should be truncated */
318 -} safelink_t;
319 +} PACKEDt2(reiser4_key, d64) safelink_t;
320  
321  /*
322   * locality where safe-link items are stored. Next to the objectid of root
323 --- linux-2.6.11/.pc/reiser4/fs/reiser4/status_flags.c  2005-03-27 21:24:00.682243368 -0800
324 +++ linux-2.6.11/fs/reiser4/status_flags.c      2005-03-27 21:24:02.756927968 -0800
325 @@ -153,6 +153,7 @@
326                  &statuspage->stacktrace[no])
327  
328         GETFRAME(0);
329 +#ifndef __arm__
330         GETFRAME(1);
331         GETFRAME(2);
332         GETFRAME(3);
333 @@ -162,6 +163,7 @@
334         GETFRAME(7);
335         GETFRAME(8);
336         GETFRAME(9);
337 +#endif
338  
339  #undef GETFRAME
340  #endif
341 --- linux-2.6.11/.pc/reiser4/fs/reiser4/dformat.h       2005-03-27 21:24:00.564261304 -0800
342 +++ linux-2.6.11/fs/reiser4/dformat.h   2005-03-27 23:29:03.223683704 -0800
343 @@ -28,43 +28,84 @@
344  
345  /* code on-disk data-types as structs with a single field
346     to rely on compiler type-checking. Like include/asm-i386/page.h */
347 +/* This code did not work on the arm with gcc 3.4.3 because the
348 + * arm has a minimum structure size of 4 - packed is necessary to
349 + * allow these types to be smaller than 4 - and because this version
350 + * of gcc 'loses' the alignment if the structure contains just one
351 + * element of alignment 8 (or probably any value greater than 4).
352 + * To fix this and to make the code much more portable all the basic
353 + * types are now just done as arrays of bytes - __u8.
354 + *
355 + * This is highly tricky, however the check code in debug.c should
356 + * fire a compile time assert if it goes wrong.
357 + */
358 +#if __arm__
359 +#define PACKED8  __attribute__ ((packed,aligned(1)))
360 +/* Warning: the presence of the packed attribute here means that any
361 + * d16 in a structure so marked will lose its alignment.  That doesn't
362 + * seem to matter because there don't seem to be any d16's with odd
363 + * structure offsets, but it might.
364 + */
365 +#define PACKED16 __attribute__ ((packed,aligned(2)))
366 +#define PACKED32 __attribute__ ((aligned(4)))
367 +#define PACKED64 __attribute__ ((aligned(8)))
368 +#else
369 +#define PACKED8  __attribute__ ((aligned(1)))
370 +#define PACKED16 __attribute__ ((aligned(2)))
371 +#define PACKED32 __attribute__ ((aligned(4)))
372 +#define PACKED64 __attribute__ ((aligned(8)))
373 +#endif
374  typedef struct d8 {
375 -       __u8 datum;
376 -} d8 __attribute__ ((aligned(1)));
377 +       __u8 datum[1];
378 +} PACKED8 d8;
379  typedef struct d16 {
380 -       __u16 datum;
381 -} d16 __attribute__ ((aligned(2)));
382 +       __u8 datum[2];
383 +} PACKED16 d16;
384  typedef struct d32 {
385 -       __u32 datum;
386 -} d32 __attribute__ ((aligned(4)));
387 +       __u8 datum[4];
388 +} PACKED32 d32;
389  typedef struct d64 {
390 -       __u64 datum;
391 -} d64 __attribute__ ((aligned(8)));
392 +       __u8 datum[8];
393 +} PACKED64 d64;
394  
395 +#define PACKEDt(t) __attribute__ ((packed,aligned(__alignof__ (t)) ))
396 +#define PACKEDt2(t1,t2) __attribute__ ((packed,aligned(\
397 +               __alignof__ (t1) < __alignof__ (t2) ? __alignof__ (t2) : __alignof__ (t1) )))
398  #define PACKED __attribute__((packed))
399  
400  static inline __u8
401  d8tocpu(const d8 * ondisk /* on-disk value to convert */ )
402  {
403 -       return ondisk->datum;
404 +       return ondisk->datum[0];
405  }
406  
407  static inline __u16
408  d16tocpu(const d16 * ondisk /* on-disk value to convert */ )
409  {
410 -       return __le16_to_cpu(get_unaligned(&ondisk->datum));
411 +       return ondisk->datum[0] + (ondisk->datum[1] << 8);
412  }
413  
414  static inline __u32
415  d32tocpu(const d32 * ondisk /* on-disk value to convert */ )
416  {
417 -       return __le32_to_cpu(get_unaligned(&ondisk->datum));
418 +       return ondisk->datum[0] +
419 +               (ondisk->datum[1] << 8) +
420 +               (ondisk->datum[2] << 16) +
421 +               (ondisk->datum[3] << 24);
422  }
423  
424  static inline __u64
425  d64tocpu(const d64 * ondisk /* on-disk value to convert */ )
426  {
427 -       return __le64_to_cpu(get_unaligned(&ondisk->datum));
428 +       __u32 low = ondisk->datum[0] +
429 +               (ondisk->datum[1] << 8) +
430 +               (ondisk->datum[2] << 16) +
431 +               (ondisk->datum[3] << 24);
432 +       __u64 high = ondisk->datum[4] +
433 +               (ondisk->datum[5] << 8) +
434 +               (ondisk->datum[6] << 16) +
435 +               (ondisk->datum[7] << 24);
436 +       return low + (high << 32);
437  }
438  
439  static inline d8 *
440 @@ -72,7 +113,7 @@
441         d8 * ondisk /* result */ )
442  {
443         assert("nikita-1264", oncpu < 0x100);
444 -       put_unaligned(oncpu, &ondisk->datum);
445 +       ondisk->datum[0] = oncpu;
446         return ondisk;
447  }
448  
449 @@ -81,7 +122,8 @@
450          d16 * ondisk /* result */ )
451  {
452         assert("nikita-1265", oncpu < 0x10000);
453 -       put_unaligned(__cpu_to_le16(oncpu), &ondisk->datum);
454 +       ondisk->datum[0] = oncpu;
455 +       ondisk->datum[1] = oncpu >> 8;
456         return ondisk;
457  }
458  
459 @@ -89,15 +131,27 @@
460  cputod32(__u32 oncpu /* CPU value to convert */ ,
461          d32 * ondisk /* result */ )
462  {
463 -       put_unaligned(__cpu_to_le32(oncpu), &ondisk->datum);
464 +       ondisk->datum[0] = oncpu; oncpu >>= 8;
465 +       ondisk->datum[1] = oncpu; oncpu >>= 8;
466 +       ondisk->datum[2] = oncpu; oncpu >>= 8;
467 +       ondisk->datum[3] = oncpu;
468         return ondisk;
469  }
470  
471  static inline d64 *
472 -cputod64(__u64 oncpu /* CPU value to convert */ ,
473 +cputod64(__u64 oncpuIn /* CPU value to convert */ ,
474          d64 * ondisk /* result */ )
475  {
476 -       put_unaligned(__cpu_to_le64(oncpu), &ondisk->datum);
477 +       __u32 oncpu = oncpuIn;
478 +       ondisk->datum[0] = oncpu; oncpu >>= 8;
479 +       ondisk->datum[1] = oncpu; oncpu >>= 8;
480 +       ondisk->datum[2] = oncpu; oncpu >>= 8;
481 +       ondisk->datum[3] = oncpu;
482 +       oncpu = oncpuIn >> 32;
483 +       ondisk->datum[4] = oncpu; oncpu >>= 8;
484 +       ondisk->datum[5] = oncpu; oncpu >>= 8;
485 +       ondisk->datum[6] = oncpu; oncpu >>= 8;
486 +       ondisk->datum[7] = oncpu;
487         return ondisk;
488  }
489  
490 @@ -111,7 +165,7 @@
491  /* data-type for block number on disk, disk format */
492  union reiser4_dblock_nr {
493         d64 blk;
494 -};
495 +} PACKED64;
496  
497  static inline reiser4_block_nr
498  dblock_to_cpu(const reiser4_dblock_nr * dblock)
499 @@ -148,7 +202,7 @@
500         char uuid[16];          /* unique id */
501         char label[16];         /* filesystem label */
502         d64 diskmap;            /* location of the diskmap. 0 if not present */
503 -} reiser4_master_sb;
504 +} PACKED64 reiser4_master_sb;
505  
506  /* __FS_REISER4_DFORMAT_H__ */
507  #endif
508 --- linux-2.6.11/.pc/reiser4/fs/reiser4/kassign.h       2005-03-27 21:24:00.588257656 -0800
509 +++ linux-2.6.11/fs/reiser4/kassign.h   2005-03-27 21:24:02.757927816 -0800
510 @@ -46,7 +46,7 @@
511         d8 locality[sizeof (__u64)];
512         ON_LARGE_KEY(d8 ordering[sizeof (__u64)];)
513         d8 objectid[sizeof (__u64)];
514 -} obj_key_id;
515 +} PACKED8 obj_key_id;
516  
517  /* Information sufficient to uniquely identify directory entry within
518     compressed directory item.
519 @@ -57,7 +57,7 @@
520         ON_LARGE_KEY(d8 ordering[sizeof (__u64)];)
521         d8 objectid[sizeof (__u64)];
522         d8 offset[sizeof (__u64)];
523 -} de_id;
524 +} PACKED8 de_id;
525  
526  extern int inode_onwire_size(const struct inode *obj);
527  extern char *build_inode_onwire(const struct inode *obj, char *area);
528 --- linux-2.6.11/.pc/reiser4/fs/reiser4/key.h   2005-03-27 21:24:00.591257200 -0800
529 +++ linux-2.6.11/fs/reiser4/key.h       2005-03-27 23:41:07.744539792 -0800
530 @@ -106,7 +106,7 @@
531  union reiser4_key {
532         d64 el[KEY_LAST_INDEX];
533         int pad;
534 -};
535 +} PACKED64;
536  
537  /* bitmasks showing where within reiser4_key particular key is
538      stored. */
539 @@ -138,6 +138,20 @@
540         KEY_ORDERING_SHIFT = 0,
541  } reiser4_key_field_shift;
542  
543 +/* initialise a key, this is a compile time constant initialiser expressed as
544 + * three or four (as appropriate) 8 byte initialisers, there are braces around
545 + * each 8 byte quantity but not around the whole initializer.
546 + */
547 +#define KEY_INIT(type,loc,order,band,oid,off)\
548 +{{ (0xf&(type))+(0xf0&((loc) << 4)), 0xff&((loc) >> 4), 0xff&((loc) >> 12), 0xff&((loc) >> 20),\
549 +       0xff&((loc) >> 28), 0xff&((loc) >> 36), 0xff&((loc) >> 44), 0xff&((loc) >> 52) }},\
550 +ON_LARGE_KEY({{ 0xff&(order), 0xff&((order)>>8), 0xff&((order)>>16), 0xff&((order)>>24),\
551 +       0xff&((order)>>32), 0xff&((order)>>40), 0xff&((order)>>48), 0xff&((order)>>56) }},)\
552 +{{ 0xff&(oid), 0xff&((oid)>>8), 0xff&((oid)>>16), 0xff&((oid)>>24),\
553 +       0xff&((oid)>>32), 0xff&((oid)>>40), 0xff&((oid)>>48), (0xf&((oid)>>56))+(0xf0&((band)<<4))}},\
554 +{{ 0xff&(off), 0xff&((off)>>8), 0xff&((off)>>16), 0xff&((off)>>24),\
555 +       0xff&((off)>>32), 0xff&((off)>>40), 0xff&((off)>>48), 0xff&((off)>>56) }}
556 +
557  static inline __u64
558  get_key_el(const reiser4_key * key, reiser4_key_field_index off)
559  {
560 --- linux-2.6.11/.pc/reiser4/fs/reiser4/status_flags.h  2005-03-27 21:24:00.682243368 -0800
561 +++ linux-2.6.11/fs/reiser4/status_flags.h      2005-03-27 21:24:02.758927664 -0800
562 @@ -33,7 +33,7 @@
563                                 last sector where io error happened if status is "io error encountered" */
564         d64 stacktrace[10];  /* Last ten functional calls made (addresses)*/
565         char texterror[REISER4_TEXTERROR_LEN]; /* Any error message if appropriate, otherwise filled with zeroes */
566 -};
567 +} PACKED64;
568  
569  int reiser4_status_init(reiser4_block_nr block);
570  int reiser4_status_query(u64 *status, u64 *extended);
571 --- linux-2.6.11/.pc/reiser4/fs/reiser4/wander.h        2005-03-27 21:24:00.709239264 -0800
572 +++ linux-2.6.11/fs/reiser4/wander.h    2005-03-27 22:14:59.663207576 -0800
573 @@ -19,7 +19,7 @@
574  struct journal_header {
575         /* last written transaction head location */
576         d64 last_committed_tx;
577 -};
578 +} PACKED64;
579  
580  typedef struct journal_location {
581         reiser4_block_nr footer;
582 @@ -46,7 +46,7 @@
583            super block */
584         d64 nr_files;
585         d64 next_oid;
586 -};
587 +} PACKED64;
588  
589  /* Each wander record (except the first one) has unified format with wander
590     record header followed by an array of log entries */
591 @@ -66,7 +66,7 @@
592  
593         /* number of previous block in commit */
594         d64 next_block;
595 -};
596 +} PACKED64;
597  
598  /* The first wander record (transaction head) of written transaction has the
599     special format */
600 @@ -98,7 +98,7 @@
601            separately from super block */
602         d64 nr_files;
603         d64 next_oid;
604 -};
605 +} PACKED64;
606  
607  /* A transaction gets written to disk as a set of wander records (each wander
608     record size is fs block) */
609 @@ -108,7 +108,7 @@
610  struct wander_entry {
611         d64 original;           /* block original location */
612         d64 wandered;           /* block wandered location */
613 -};
614 +} PACKED64;
615  
616  /* REISER4 JOURNAL WRITER FUNCTIONS   */
617