aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/raid
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-10-21 13:24:08 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-21 16:35:05 -0400
commit1c05b4bc22cd640d3a534bd2851a8413d5df3709 (patch)
treedceceabea9bdb92213e2a2d318cdd1b152832cbd /include/linux/raid
parentda3ed32fe568148ede256975d40825ffcdac767b (diff)
[PATCH] md: endian annotation for v1 superblock access
Includes a couple of bugfixes found by sparse. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/raid')
-rw-r--r--include/linux/raid/md_p.h56
1 files changed, 28 insertions, 28 deletions
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index b6ebc69bae54..3f2cd98c508b 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -206,52 +206,52 @@ static inline __u64 md_event(mdp_super_t *sb) {
206 */ 206 */
207struct mdp_superblock_1 { 207struct mdp_superblock_1 {
208 /* constant array information - 128 bytes */ 208 /* constant array information - 128 bytes */
209 __u32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ 209 __le32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */
210 __u32 major_version; /* 1 */ 210 __le32 major_version; /* 1 */
211 __u32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */ 211 __le32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */
212 __u32 pad0; /* always set to 0 when writing */ 212 __le32 pad0; /* always set to 0 when writing */
213 213
214 __u8 set_uuid[16]; /* user-space generated. */ 214 __u8 set_uuid[16]; /* user-space generated. */
215 char set_name[32]; /* set and interpreted by user-space */ 215 char set_name[32]; /* set and interpreted by user-space */
216 216
217 __u64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/ 217 __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
218 __u32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */ 218 __le32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */
219 __u32 layout; /* only for raid5 and raid10 currently */ 219 __le32 layout; /* only for raid5 and raid10 currently */
220 __u64 size; /* used size of component devices, in 512byte sectors */ 220 __le64 size; /* used size of component devices, in 512byte sectors */
221 221
222 __u32 chunksize; /* in 512byte sectors */ 222 __le32 chunksize; /* in 512byte sectors */
223 __u32 raid_disks; 223 __le32 raid_disks;
224 __u32 bitmap_offset; /* sectors after start of superblock that bitmap starts 224 __le32 bitmap_offset; /* sectors after start of superblock that bitmap starts
225 * NOTE: signed, so bitmap can be before superblock 225 * NOTE: signed, so bitmap can be before superblock
226 * only meaningful of feature_map[0] is set. 226 * only meaningful of feature_map[0] is set.
227 */ 227 */
228 228
229 /* These are only valid with feature bit '4' */ 229 /* These are only valid with feature bit '4' */
230 __u32 new_level; /* new level we are reshaping to */ 230 __le32 new_level; /* new level we are reshaping to */
231 __u64 reshape_position; /* next address in array-space for reshape */ 231 __le64 reshape_position; /* next address in array-space for reshape */
232 __u32 delta_disks; /* change in number of raid_disks */ 232 __le32 delta_disks; /* change in number of raid_disks */
233 __u32 new_layout; /* new layout */ 233 __le32 new_layout; /* new layout */
234 __u32 new_chunk; /* new chunk size (bytes) */ 234 __le32 new_chunk; /* new chunk size (bytes) */
235 __u8 pad1[128-124]; /* set to 0 when written */ 235 __u8 pad1[128-124]; /* set to 0 when written */
236 236
237 /* constant this-device information - 64 bytes */ 237 /* constant this-device information - 64 bytes */
238 __u64 data_offset; /* sector start of data, often 0 */ 238 __le64 data_offset; /* sector start of data, often 0 */
239 __u64 data_size; /* sectors in this device that can be used for data */ 239 __le64 data_size; /* sectors in this device that can be used for data */
240 __u64 super_offset; /* sector start of this superblock */ 240 __le64 super_offset; /* sector start of this superblock */
241 __u64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */ 241 __le64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
242 __u32 dev_number; /* permanent identifier of this device - not role in raid */ 242 __le32 dev_number; /* permanent identifier of this device - not role in raid */
243 __u32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ 243 __le32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */
244 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ 244 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
245 __u8 devflags; /* per-device flags. Only one defined...*/ 245 __u8 devflags; /* per-device flags. Only one defined...*/
246#define WriteMostly1 1 /* mask for writemostly flag in above */ 246#define WriteMostly1 1 /* mask for writemostly flag in above */
247 __u8 pad2[64-57]; /* set to 0 when writing */ 247 __u8 pad2[64-57]; /* set to 0 when writing */
248 248
249 /* array state information - 64 bytes */ 249 /* array state information - 64 bytes */
250 __u64 utime; /* 40 bits second, 24 btes microseconds */ 250 __le64 utime; /* 40 bits second, 24 btes microseconds */
251 __u64 events; /* incremented when superblock updated */ 251 __le64 events; /* incremented when superblock updated */
252 __u64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ 252 __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */
253 __u32 sb_csum; /* checksum upto devs[max_dev] */ 253 __le32 sb_csum; /* checksum upto devs[max_dev] */
254 __u32 max_dev; /* size of devs[] array to consider */ 254 __le32 max_dev; /* size of devs[] array to consider */
255 __u8 pad3[64-32]; /* set to 0 when writing */ 255 __u8 pad3[64-32]; /* set to 0 when writing */
256 256
257 /* device state information. Indexed by dev_number. 257 /* device state information. Indexed by dev_number.
@@ -260,7 +260,7 @@ struct mdp_superblock_1 {
260 * into the 'roles' value. If a device is spare or faulty, then it doesn't 260 * into the 'roles' value. If a device is spare or faulty, then it doesn't
261 * have a meaningful role. 261 * have a meaningful role.
262 */ 262 */
263 __u16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ 263 __le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
264}; 264};
265 265
266/* feature_map bits */ 266/* feature_map bits */