diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-17 16:41:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-29 23:28:39 -0400 |
commit | 28fe3c1963b0bafa56ec92df1987828090151d87 (patch) | |
tree | 021985387ca7d13dafd1571f1c3e9ad6f3051084 /fs/hpfs | |
parent | 77ee26e44c28823a29bc09091950544566ae7cea (diff) |
hpfs: assorted endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hpfs')
-rw-r--r-- | fs/hpfs/hpfs.h | 108 | ||||
-rw-r--r-- | fs/hpfs/hpfs_fn.h | 4 | ||||
-rw-r--r-- | fs/hpfs/map.c | 6 | ||||
-rw-r--r-- | fs/hpfs/super.c | 2 |
4 files changed, 60 insertions, 60 deletions
diff --git a/fs/hpfs/hpfs.h b/fs/hpfs/hpfs.h index 051ff455b26d..cce025aff1b1 100644 --- a/fs/hpfs/hpfs.h +++ b/fs/hpfs/hpfs.h | |||
@@ -51,11 +51,11 @@ struct hpfs_boot_block | |||
51 | u8 n_rootdir_entries[2]; | 51 | u8 n_rootdir_entries[2]; |
52 | u8 n_sectors_s[2]; | 52 | u8 n_sectors_s[2]; |
53 | u8 media_byte; | 53 | u8 media_byte; |
54 | u16 sectors_per_fat; | 54 | __le16 sectors_per_fat; |
55 | u16 sectors_per_track; | 55 | __le16 sectors_per_track; |
56 | u16 heads_per_cyl; | 56 | __le16 heads_per_cyl; |
57 | u32 n_hidden_sectors; | 57 | __le32 n_hidden_sectors; |
58 | u32 n_sectors_l; /* size of partition */ | 58 | __le32 n_sectors_l; /* size of partition */ |
59 | u8 drive_number; | 59 | u8 drive_number; |
60 | u8 mbz; | 60 | u8 mbz; |
61 | u8 sig_28h; /* 28h */ | 61 | u8 sig_28h; /* 28h */ |
@@ -63,7 +63,7 @@ struct hpfs_boot_block | |||
63 | u8 vol_label[11]; | 63 | u8 vol_label[11]; |
64 | u8 sig_hpfs[8]; /* "HPFS " */ | 64 | u8 sig_hpfs[8]; /* "HPFS " */ |
65 | u8 pad[448]; | 65 | u8 pad[448]; |
66 | u16 magic; /* aa55 */ | 66 | __le16 magic; /* aa55 */ |
67 | }; | 67 | }; |
68 | 68 | ||
69 | 69 | ||
@@ -75,28 +75,28 @@ struct hpfs_boot_block | |||
75 | 75 | ||
76 | struct hpfs_super_block | 76 | struct hpfs_super_block |
77 | { | 77 | { |
78 | u32 magic; /* f995 e849 */ | 78 | __le32 magic; /* f995 e849 */ |
79 | u32 magic1; /* fa53 e9c5, more magic? */ | 79 | __le32 magic1; /* fa53 e9c5, more magic? */ |
80 | u8 version; /* version of a filesystem usually 2 */ | 80 | u8 version; /* version of a filesystem usually 2 */ |
81 | u8 funcversion; /* functional version - oldest version | 81 | u8 funcversion; /* functional version - oldest version |
82 | of filesystem that can understand | 82 | of filesystem that can understand |
83 | this disk */ | 83 | this disk */ |
84 | u16 zero; /* 0 */ | 84 | __le16 zero; /* 0 */ |
85 | fnode_secno root; /* fnode of root directory */ | 85 | __le32 root; /* fnode of root directory */ |
86 | secno n_sectors; /* size of filesystem */ | 86 | __le32 n_sectors; /* size of filesystem */ |
87 | u32 n_badblocks; /* number of bad blocks */ | 87 | __le32 n_badblocks; /* number of bad blocks */ |
88 | secno bitmaps; /* pointers to free space bit maps */ | 88 | __le32 bitmaps; /* pointers to free space bit maps */ |
89 | u32 zero1; /* 0 */ | 89 | __le32 zero1; /* 0 */ |
90 | secno badblocks; /* bad block list */ | 90 | __le32 badblocks; /* bad block list */ |
91 | u32 zero3; /* 0 */ | 91 | __le32 zero3; /* 0 */ |
92 | time32_t last_chkdsk; /* date last checked, 0 if never */ | 92 | __le32 last_chkdsk; /* date last checked, 0 if never */ |
93 | time32_t last_optimize; /* date last optimized, 0 if never */ | 93 | __le32 last_optimize; /* date last optimized, 0 if never */ |
94 | secno n_dir_band; /* number of sectors in dir band */ | 94 | __le32 n_dir_band; /* number of sectors in dir band */ |
95 | secno dir_band_start; /* first sector in dir band */ | 95 | __le32 dir_band_start; /* first sector in dir band */ |
96 | secno dir_band_end; /* last sector in dir band */ | 96 | __le32 dir_band_end; /* last sector in dir band */ |
97 | secno dir_band_bitmap; /* free space map, 1 dnode per bit */ | 97 | __le32 dir_band_bitmap; /* free space map, 1 dnode per bit */ |
98 | u8 volume_name[32]; /* not used */ | 98 | u8 volume_name[32]; /* not used */ |
99 | secno user_id_table; /* 8 preallocated sectors - user id */ | 99 | __le32 user_id_table; /* 8 preallocated sectors - user id */ |
100 | u32 zero6[103]; /* 0 */ | 100 | u32 zero6[103]; /* 0 */ |
101 | }; | 101 | }; |
102 | 102 | ||
@@ -109,8 +109,8 @@ struct hpfs_super_block | |||
109 | 109 | ||
110 | struct hpfs_spare_block | 110 | struct hpfs_spare_block |
111 | { | 111 | { |
112 | u32 magic; /* f991 1849 */ | 112 | __le32 magic; /* f991 1849 */ |
113 | u32 magic1; /* fa52 29c5, more magic? */ | 113 | __le32 magic1; /* fa52 29c5, more magic? */ |
114 | 114 | ||
115 | #ifdef __LITTLE_ENDIAN | 115 | #ifdef __LITTLE_ENDIAN |
116 | u8 dirty: 1; /* 0 clean, 1 "improperly stopped" */ | 116 | u8 dirty: 1; /* 0 clean, 1 "improperly stopped" */ |
@@ -153,21 +153,21 @@ struct hpfs_spare_block | |||
153 | u8 mm_contlgulty; | 153 | u8 mm_contlgulty; |
154 | u8 unused; | 154 | u8 unused; |
155 | 155 | ||
156 | secno hotfix_map; /* info about remapped bad sectors */ | 156 | __le32 hotfix_map; /* info about remapped bad sectors */ |
157 | u32 n_spares_used; /* number of hotfixes */ | 157 | __le32 n_spares_used; /* number of hotfixes */ |
158 | u32 n_spares; /* number of spares in hotfix map */ | 158 | __le32 n_spares; /* number of spares in hotfix map */ |
159 | u32 n_dnode_spares_free; /* spare dnodes unused */ | 159 | __le32 n_dnode_spares_free; /* spare dnodes unused */ |
160 | u32 n_dnode_spares; /* length of spare_dnodes[] list, | 160 | __le32 n_dnode_spares; /* length of spare_dnodes[] list, |
161 | follows in this block*/ | 161 | follows in this block*/ |
162 | secno code_page_dir; /* code page directory block */ | 162 | __le32 code_page_dir; /* code page directory block */ |
163 | u32 n_code_pages; /* number of code pages */ | 163 | __le32 n_code_pages; /* number of code pages */ |
164 | u32 super_crc; /* on HPFS386 and LAN Server this is | 164 | __le32 super_crc; /* on HPFS386 and LAN Server this is |
165 | checksum of superblock, on normal | 165 | checksum of superblock, on normal |
166 | OS/2 unused */ | 166 | OS/2 unused */ |
167 | u32 spare_crc; /* on HPFS386 checksum of spareblock */ | 167 | __le32 spare_crc; /* on HPFS386 checksum of spareblock */ |
168 | u32 zero1[15]; /* unused */ | 168 | __le32 zero1[15]; /* unused */ |
169 | dnode_secno spare_dnodes[100]; /* emergency free dnode list */ | 169 | __le32 spare_dnodes[100]; /* emergency free dnode list */ |
170 | u32 zero2[1]; /* room for more? */ | 170 | __le32 zero2[1]; /* room for more? */ |
171 | }; | 171 | }; |
172 | 172 | ||
173 | /* The bad block list is 4 sectors long. The first word must be zero, | 173 | /* The bad block list is 4 sectors long. The first word must be zero, |
@@ -202,18 +202,18 @@ struct hpfs_spare_block | |||
202 | 202 | ||
203 | struct code_page_directory | 203 | struct code_page_directory |
204 | { | 204 | { |
205 | u32 magic; /* 4945 21f7 */ | 205 | __le32 magic; /* 4945 21f7 */ |
206 | u32 n_code_pages; /* number of pointers following */ | 206 | __le32 n_code_pages; /* number of pointers following */ |
207 | u32 zero1[2]; | 207 | __le32 zero1[2]; |
208 | struct { | 208 | struct { |
209 | u16 ix; /* index */ | 209 | __le16 ix; /* index */ |
210 | u16 code_page_number; /* code page number */ | 210 | __le16 code_page_number; /* code page number */ |
211 | u32 bounds; /* matches corresponding word | 211 | __le32 bounds; /* matches corresponding word |
212 | in data block */ | 212 | in data block */ |
213 | secno code_page_data; /* sector number of a code_page_data | 213 | __le32 code_page_data; /* sector number of a code_page_data |
214 | containing c.p. array */ | 214 | containing c.p. array */ |
215 | u16 index; /* index in c.p. array in that sector*/ | 215 | __le16 index; /* index in c.p. array in that sector*/ |
216 | u16 unknown; /* some unknown value; usually 0; | 216 | __le16 unknown; /* some unknown value; usually 0; |
217 | 2 in Japanese version */ | 217 | 2 in Japanese version */ |
218 | } array[31]; /* unknown length */ | 218 | } array[31]; /* unknown length */ |
219 | }; | 219 | }; |
@@ -224,19 +224,19 @@ struct code_page_directory | |||
224 | 224 | ||
225 | struct code_page_data | 225 | struct code_page_data |
226 | { | 226 | { |
227 | u32 magic; /* 8945 21f7 */ | 227 | __le32 magic; /* 8945 21f7 */ |
228 | u32 n_used; /* # elements used in c_p_data[] */ | 228 | __le32 n_used; /* # elements used in c_p_data[] */ |
229 | u32 bounds[3]; /* looks a bit like | 229 | __le32 bounds[3]; /* looks a bit like |
230 | (beg1,end1), (beg2,end2) | 230 | (beg1,end1), (beg2,end2) |
231 | one byte each */ | 231 | one byte each */ |
232 | u16 offs[3]; /* offsets from start of sector | 232 | __le16 offs[3]; /* offsets from start of sector |
233 | to start of c_p_data[ix] */ | 233 | to start of c_p_data[ix] */ |
234 | struct { | 234 | struct { |
235 | u16 ix; /* index */ | 235 | __le16 ix; /* index */ |
236 | u16 code_page_number; /* code page number */ | 236 | __le16 code_page_number; /* code page number */ |
237 | u16 unknown; /* the same as in cp directory */ | 237 | __le16 unknown; /* the same as in cp directory */ |
238 | u8 map[128]; /* upcase table for chars 80..ff */ | 238 | u8 map[128]; /* upcase table for chars 80..ff */ |
239 | u16 zero2; | 239 | __le16 zero2; |
240 | } code_page[3]; | 240 | } code_page[3]; |
241 | u8 incognita[78]; | 241 | u8 incognita[78]; |
242 | }; | 242 | }; |
diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h index 1acb40f55a3a..8515bbbc9e2e 100644 --- a/fs/hpfs/hpfs_fn.h +++ b/fs/hpfs/hpfs_fn.h | |||
@@ -82,7 +82,7 @@ struct hpfs_sb_info { | |||
82 | unsigned char *sb_cp_table; /* code page tables: */ | 82 | unsigned char *sb_cp_table; /* code page tables: */ |
83 | /* 128 bytes uppercasing table & */ | 83 | /* 128 bytes uppercasing table & */ |
84 | /* 128 bytes lowercasing table */ | 84 | /* 128 bytes lowercasing table */ |
85 | unsigned *sb_bmp_dir; /* main bitmap directory */ | 85 | __le32 *sb_bmp_dir; /* main bitmap directory */ |
86 | unsigned sb_c_bitmap; /* current bitmap */ | 86 | unsigned sb_c_bitmap; /* current bitmap */ |
87 | unsigned sb_max_fwd_alloc; /* max forwad allocation */ | 87 | unsigned sb_max_fwd_alloc; /* max forwad allocation */ |
88 | int sb_timeshift; | 88 | int sb_timeshift; |
@@ -278,7 +278,7 @@ void hpfs_evict_inode(struct inode *); | |||
278 | __le32 *hpfs_map_dnode_bitmap(struct super_block *, struct quad_buffer_head *); | 278 | __le32 *hpfs_map_dnode_bitmap(struct super_block *, struct quad_buffer_head *); |
279 | __le32 *hpfs_map_bitmap(struct super_block *, unsigned, struct quad_buffer_head *, char *); | 279 | __le32 *hpfs_map_bitmap(struct super_block *, unsigned, struct quad_buffer_head *, char *); |
280 | unsigned char *hpfs_load_code_page(struct super_block *, secno); | 280 | unsigned char *hpfs_load_code_page(struct super_block *, secno); |
281 | secno *hpfs_load_bitmap_directory(struct super_block *, secno bmp); | 281 | __le32 *hpfs_load_bitmap_directory(struct super_block *, secno bmp); |
282 | struct fnode *hpfs_map_fnode(struct super_block *s, ino_t, struct buffer_head **); | 282 | struct fnode *hpfs_map_fnode(struct super_block *s, ino_t, struct buffer_head **); |
283 | struct anode *hpfs_map_anode(struct super_block *s, anode_secno, struct buffer_head **); | 283 | struct anode *hpfs_map_anode(struct super_block *s, anode_secno, struct buffer_head **); |
284 | struct dnode *hpfs_map_dnode(struct super_block *s, dnode_secno, struct quad_buffer_head *); | 284 | struct dnode *hpfs_map_dnode(struct super_block *s, dnode_secno, struct quad_buffer_head *); |
diff --git a/fs/hpfs/map.c b/fs/hpfs/map.c index d8bed6da053c..4acb19d78359 100644 --- a/fs/hpfs/map.c +++ b/fs/hpfs/map.c | |||
@@ -89,18 +89,18 @@ unsigned char *hpfs_load_code_page(struct super_block *s, secno cps) | |||
89 | return cp_table; | 89 | return cp_table; |
90 | } | 90 | } |
91 | 91 | ||
92 | secno *hpfs_load_bitmap_directory(struct super_block *s, secno bmp) | 92 | __le32 *hpfs_load_bitmap_directory(struct super_block *s, secno bmp) |
93 | { | 93 | { |
94 | struct buffer_head *bh; | 94 | struct buffer_head *bh; |
95 | int n = (hpfs_sb(s)->sb_fs_size + 0x200000 - 1) >> 21; | 95 | int n = (hpfs_sb(s)->sb_fs_size + 0x200000 - 1) >> 21; |
96 | int i; | 96 | int i; |
97 | secno *b; | 97 | __le32 *b; |
98 | if (!(b = kmalloc(n * 512, GFP_KERNEL))) { | 98 | if (!(b = kmalloc(n * 512, GFP_KERNEL))) { |
99 | printk("HPFS: can't allocate memory for bitmap directory\n"); | 99 | printk("HPFS: can't allocate memory for bitmap directory\n"); |
100 | return NULL; | 100 | return NULL; |
101 | } | 101 | } |
102 | for (i=0;i<n;i++) { | 102 | for (i=0;i<n;i++) { |
103 | secno *d = hpfs_map_sector(s, bmp+i, &bh, n - i - 1); | 103 | __le32 *d = hpfs_map_sector(s, bmp+i, &bh, n - i - 1); |
104 | if (!d) { | 104 | if (!d) { |
105 | kfree(b); | 105 | kfree(b); |
106 | return NULL; | 106 | return NULL; |
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 08e85b019131..706a12c083ea 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c | |||
@@ -572,7 +572,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) | |||
572 | mark_buffer_dirty(bh2); | 572 | mark_buffer_dirty(bh2); |
573 | } | 573 | } |
574 | 574 | ||
575 | if (spareblock->hotfixes_used || le32_to_cpu(spareblock->n_spares_used)) { | 575 | if (spareblock->hotfixes_used || spareblock->n_spares_used) { |
576 | if (errs >= 2) { | 576 | if (errs >= 2) { |
577 | printk("HPFS: Hotfixes not supported here, try chkdsk\n"); | 577 | printk("HPFS: Hotfixes not supported here, try chkdsk\n"); |
578 | mark_dirty(s, 0); | 578 | mark_dirty(s, 0); |