summaryrefslogtreecommitdiff
path: root/recipes/reiser4progs/files/align.patch
blob: 7d8cfaa3a0fe7d97ff4062289ea2c1f8a7a0b69a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
--- orig/include/reiser4/plugin.h	2005-03-26 16:52:16.913589432 -0800
+++ reiser4progs-1.0.4/include/reiser4/plugin.h	2005-03-26 17:05:13.324557024 -0800
@@ -36,6 +36,28 @@
 #define EXTENT_HOLE_UNIT		(0)
 #define EXTENT_UNALLOC_UNIT		(1)
 
+#if __arm__
+/* Getting this right requires machine dependent knowledge of the
+ * minimum structure packing gcc implements for the architecture, on
+ * ARM it is 4, so we need 'packed' for <4 and must not use 'packed'
+ * for 8! (packed,align(4) is the default.)
+ */
+#define PACKED8  __attribute__ ((packed,aligned(1)))
+#define PACKED16 __attribute__ ((packed,aligned(2)))
+#define PACKED32 __attribute__ ((aligned(4)))
+#define PACKED64 __attribute__ ((aligned(8)))
+#else
+#define PACKED8  __attribute__ ((aligned(1)))
+#define PACKED16 __attribute__ ((aligned(2)))
+#define PACKED32 __attribute__ ((aligned(4)))
+#define PACKED64 __attribute__ ((aligned(8)))
+#endif
+
+#define PACKEDt(t) __attribute__ ((packed,aligned(__alignof__ (t)) ))
+#define PACKEDt2(t1,t2) __attribute__ ((packed,aligned(\
+		__alignof__ (t1) < __alignof__ (t2) ? __alignof__ (t2) : __alignof__ (t1) )))
+#define PACKED __attribute__((packed))
+
 /* Defining the types for disk structures. All types like f32_t are fake ones
    and needed to avoid gcc-2.95.x bug with size of typedefined aligned types. */
 typedef uint8_t  f8_t;  typedef f8_t  d8_t  __attribute__((aligned(1)));
--- orig/include/reiser4/types.h	2005-03-26 16:52:16.915589128 -0800
+++ reiser4progs-1.0.4/include/reiser4/types.h	2005-03-26 17:08:29.143787976 -0800
@@ -33,7 +33,7 @@
 
 	/* Filesystem label in use. */
 	char ms_label[16];
-};
+} PACKED16;
 
 typedef struct reiser4_master_sb reiser4_master_sb_t;
 
@@ -63,7 +63,7 @@
 
 	/* Error message related to saved status and stack trace. */
 	char ss_message[SS_MESSAGE_SIZE];
-};
+} PACKED64;
 
 typedef struct reiser4_status_sb reiser4_status_sb_t;
 
--- orig/plugin/format/format40/format40.h	2005-03-26 16:52:17.022572864 -0800
+++ reiser4progs-1.0.4/plugin/format/format40/format40.h	2005-03-26 17:09:21.068894160 -0800
@@ -36,7 +36,7 @@
 	d64_t sb_flags;
 	
 	char sb_unused[432];
-} __attribute__((packed));
+} PACKED;
 
 typedef struct format40_super format40_super_t;
 
@@ -60,7 +60,7 @@
 	d16_t sb_policy;
 	d64_t sb_flags;
 	d64_t sb_reserved;
-} __attribute__((packed));
+} PACKED;
 
 typedef struct format40_backup format40_backup_t;
 #endif
--- orig/plugin/item/cde40/cde40.h	2005-03-26 16:52:17.041569976 -0800
+++ reiser4progs-1.0.4/plugin/item/cde40/cde40.h	2005-03-26 17:12:11.154037288 -0800
@@ -21,7 +21,7 @@
 
 struct cde40 {
 	d16_t units;
-};
+} PACKED16;
 
 typedef struct cde40 cde40_t;
 
@@ -29,7 +29,7 @@
 struct objid3 {
 	d8_t locality[8];
 	d8_t objectid[8];
-};
+} PACKED8;
 
 typedef struct objid3 objid3_t;
 
@@ -37,21 +37,21 @@
 struct hash3 {
 	d8_t objectid[8];
 	d8_t offset[8];
-};
+} PACKED8;
 
 typedef struct hash3 hash3_t;
 
 struct entry3 {
 	hash3_t hash;
 	d16_t offset;
-};
+} PACKEDt2(hash3_t, d16_t);
 
 typedef struct entry3 entry3_t;
 
 struct cde403 {
 	d16_t units;
 	entry3_t entry[0];
-};
+} PACKEDt2(d16_t, entry3_t);
 
 typedef struct cde403  cde403_t;
 #endif
@@ -61,7 +61,7 @@
 	d8_t locality[8];
 	d8_t ordering[8];
 	d8_t objectid[8];
-};
+} PACKED8;
 
 typedef struct objid4 objid4_t;
 
@@ -69,21 +69,21 @@
 	d8_t ordering[8];
 	d8_t objectid[8];
 	d8_t offset[8];
-};
+} PACKED8;
 
 typedef struct hash4 hash4_t;
 
 struct entry4 {
 	hash4_t hash;
 	d16_t offset;
-};
+} PACKEDt2(hash4_t, d16_t);
 
 typedef struct entry4 entry4_t;
 
 struct cde404 {
 	d16_t units;
 	entry4_t entry[0];
-};
+} PACKEDt2(d16_t, entry4_t);
 
 typedef struct cde404  cde404_t;
 #endif
--- orig/plugin/item/ctail40/ctail40.h	2005-03-26 16:52:17.050568608 -0800
+++ reiser4progs-1.0.4/plugin/item/ctail40/ctail40.h	2005-03-26 17:12:25.634835872 -0800
@@ -15,7 +15,7 @@
 	/* Cluster size is block size shifted to this field. */
 	d8_t shift;
 	d8_t body[0];
-};
+} PACKED8;
 
 typedef struct ctail40 ctail40_t;
 
--- orig/plugin/item/extent40/extent40.h	2005-03-26 16:52:17.056567696 -0800
+++ reiser4progs-1.0.4/plugin/item/extent40/extent40.h	2005-03-26 17:12:43.461125864 -0800
@@ -24,7 +24,7 @@
 struct extent40 {
 	d64_t start;
 	d64_t width;
-};
+} PACKED64;
 
 typedef struct extent40 extent40_t;
 
--- orig/plugin/item/nodeptr40/nodeptr40.h	2005-03-26 16:52:17.057567544 -0800
+++ reiser4progs-1.0.4/plugin/item/nodeptr40/nodeptr40.h	2005-03-26 17:12:56.313172056 -0800
@@ -11,7 +11,7 @@
 
 struct nodeptr40 {
 	d64_t ptr;
-};
+} PACKED64;
 
 extern reiser4_core_t *nodeptr40_core;
 typedef struct nodeptr40 nodeptr40_t;
--- orig/plugin/item/stat40/stat40.h	2005-03-26 16:52:17.061566936 -0800
+++ reiser4progs-1.0.4/plugin/item/stat40/stat40.h	2005-03-26 17:13:13.492560392 -0800
@@ -22,7 +22,7 @@
 
 struct stat40 {
 	d16_t extmask;
-};
+} PACKED16;
 
 typedef struct stat40 stat40_t;
 extern reiser4_core_t *stat40_core;
--- orig/plugin/journal/journal40/journal40.h	2005-03-26 16:52:17.071565416 -0800
+++ reiser4progs-1.0.4/plugin/journal/journal40/journal40.h	2005-03-26 17:15:34.993049048 -0800
@@ -53,7 +53,7 @@
 
 struct journal40_header {
 	d64_t jh_last_commited;
-};
+} PACKED64;
 
 typedef struct journal40_header journal40_header_t;
 
@@ -66,7 +66,7 @@
 	d64_t jf_free_blocks;
 	d64_t jf_used_oids;
 	d64_t jf_next_oid;
-};
+} PACKED64;
 
 typedef struct journal40_footer journal40_footer_t;
 
@@ -100,7 +100,7 @@
 	d64_t th_free_blocks;
 	d64_t th_used_oids;
 	d64_t th_next_oid;
-};
+} PACKED64;
 
 typedef struct journal40_tx_header journal40_tx_header_t;
 
@@ -131,7 +131,7 @@
 	d32_t lh_total;
 	d32_t lh_serial;
 	d64_t lh_next_block;
-};
+} PACKED64;
 
 typedef struct journal40_lr_header journal40_lr_header_t;
 
@@ -150,7 +150,7 @@
 struct journal40_lr_entry {
 	d64_t le_original;
 	d64_t le_wandered;
-};
+} PACKED64;
 
 typedef struct journal40_lr_entry journal40_lr_entry_t;
 
--- orig/plugin/key/key_large/key_large.h	2005-03-26 16:52:17.073565112 -0800
+++ reiser4progs-1.0.4/plugin/key/key_large/key_large.h	2005-03-26 17:15:59.982250112 -0800
@@ -39,7 +39,7 @@
 union key_large {
 	d64_t el[KEY_LARGE_LAST_INDEX];
 	int pad;
-};
+} PACKED64;
 
 typedef union key_large key_large_t;
 
--- orig/plugin/key/key_short/key_short.h	2005-03-26 16:52:17.076564656 -0800
+++ reiser4progs-1.0.4/plugin/key/key_short/key_short.h	2005-03-26 17:16:13.687166648 -0800
@@ -38,7 +38,7 @@
 union key_short {
 	d64_t el[KEY_SHORT_LAST_INDEX];
 	int pad;
-};
+} PACKED64;
 
 typedef union key_short key_short_t;
 
--- orig/plugin/node/node40/node40.h	2005-03-26 16:52:17.082563744 -0800
+++ reiser4progs-1.0.4/plugin/node/node40/node40.h	2005-03-26 17:17:08.539827776 -0800
@@ -45,7 +45,7 @@
 	d8_t level;
 	
 	d8_t pad;
-}  __attribute__((packed));
+} PACKED;
 
 typedef struct node40_header node40_header_t;  
 
@@ -166,7 +166,7 @@
 union key3 {
 	d64_t el[3];
 	int pad;
-};
+} PACKED64;
 
 typedef union key3 key3_t;
 
@@ -176,7 +176,7 @@
 	d16_t offset;
 	d16_t flags;
 	d16_t pid;
-} __attribute__((packed));
+} PACKED;
 
 typedef struct item_header3 item_header3_t;
 #endif
@@ -185,7 +185,7 @@
 union key4 {
 	d64_t el[4];
 	int pad;
-};
+} PACKED64;
 
 typedef union key4 key4_t;
 
@@ -195,7 +195,7 @@
 	d16_t offset;
 	d16_t flags;
 	d16_t pid;
-} __attribute__((packed));
+} PACKED;
 
 typedef struct item_header4 item_header4_t;
 #endif
--- orig/plugin/sdext/sdext_flags/sdext_flags.h	2005-03-26 16:52:17.111559336 -0800
+++ reiser4progs-1.0.4/plugin/sdext/sdext_flags/sdext_flags.h	2005-03-26 17:17:36.787533472 -0800
@@ -11,7 +11,7 @@
 
 struct sdext_flags {
 	d32_t flags;
-} __attribute__((packed));
+} PACKED;
 
 typedef struct sdext_flags sdext_flags_t;
 
--- orig/plugin/sdext/sdext_lt/sdext_lt.h	2005-03-26 16:52:17.112559184 -0800
+++ reiser4progs-1.0.4/plugin/sdext/sdext_lt/sdext_lt.h	2005-03-26 17:17:43.199558696 -0800
@@ -13,7 +13,7 @@
 	d32_t atime;
 	d32_t mtime;
 	d32_t ctime;
-} __attribute__((packed));
+} PACKED;
 
 typedef struct sdext_lt sdext_lt_t;
 
--- orig/plugin/sdext/sdext_lw/sdext_lw.h	2005-03-26 16:52:17.117558424 -0800
+++ reiser4progs-1.0.4/plugin/sdext/sdext_lw/sdext_lw.h	2005-03-26 17:17:50.272483448 -0800
@@ -13,7 +13,7 @@
 	d16_t mode;
 	d32_t nlink;
 	d64_t size;
-} __attribute__((packed));
+} PACKED;
 
 typedef struct sdext_lw sdext_lw_t;
 
--- orig/plugin/sdext/sdext_plug/sdext_plug.h	2005-03-26 16:52:17.118558272 -0800
+++ reiser4progs-1.0.4/plugin/sdext/sdext_plug/sdext_plug.h	2005-03-26 17:18:02.400639688 -0800
@@ -14,14 +14,14 @@
 struct sdext_plug_slot {
         d16_t member;
         d16_t plug;
-} __attribute__((packed));
+} PACKED;
 
 typedef struct sdext_plug_slot sdext_plug_slot_t;
 
 struct sdext_plug {
         d16_t count;
         sdext_plug_slot_t slot[0];
-}  __attribute__((packed));
+} PACKED;
 
 typedef struct sdext_plug sdext_plug_t;
 
--- orig/plugin/sdext/sdext_unix/sdext_unix.h	2005-03-26 16:52:17.120557968 -0800
+++ reiser4progs-1.0.4/plugin/sdext/sdext_unix/sdext_unix.h	2005-03-26 17:18:12.969033048 -0800
@@ -20,7 +20,7 @@
 		d64_t rdev;
 		d64_t bytes;
 	} u;
-} __attribute__((packed));
+} PACKED;
 
 typedef struct sdext_unix sdext_unix_t;