Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
28fe3c19
Commit
28fe3c19
authored
Apr 17, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hpfs: assorted endianness annotations
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
77ee26e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
60 deletions
+60
-60
fs/hpfs/hpfs.h
fs/hpfs/hpfs.h
+54
-54
fs/hpfs/hpfs_fn.h
fs/hpfs/hpfs_fn.h
+2
-2
fs/hpfs/map.c
fs/hpfs/map.c
+3
-3
fs/hpfs/super.c
fs/hpfs/super.c
+1
-1
No files found.
fs/hpfs/hpfs.h
View file @
28fe3c19
...
...
@@ -51,11 +51,11 @@ struct hpfs_boot_block
u8
n_rootdir_entries
[
2
];
u8
n_sectors_s
[
2
];
u8
media_byte
;
u
16
sectors_per_fat
;
u
16
sectors_per_track
;
u
16
heads_per_cyl
;
u
32
n_hidden_sectors
;
u
32
n_sectors_l
;
/* size of partition */
__le
16
sectors_per_fat
;
__le
16
sectors_per_track
;
__le
16
heads_per_cyl
;
__le
32
n_hidden_sectors
;
__le
32
n_sectors_l
;
/* size of partition */
u8
drive_number
;
u8
mbz
;
u8
sig_28h
;
/* 28h */
...
...
@@ -63,7 +63,7 @@ struct hpfs_boot_block
u8
vol_label
[
11
];
u8
sig_hpfs
[
8
];
/* "HPFS " */
u8
pad
[
448
];
u
16
magic
;
/* aa55 */
__le
16
magic
;
/* aa55 */
};
...
...
@@ -75,28 +75,28 @@ struct hpfs_boot_block
struct
hpfs_super_block
{
u
32
magic
;
/* f995 e849 */
u32
magic1
;
/* fa53 e9c5, more magic? */
__le
32
magic
;
/* f995 e849 */
__le32
magic1
;
/* fa53 e9c5, more magic? */
u8
version
;
/* version of a filesystem usually 2 */
u8
funcversion
;
/* functional version - oldest version
of filesystem that can understand
this disk */
u
16
zero
;
/* 0 */
fnode_secno
root
;
/* fnode of root directory */
secno
n_sectors
;
/* size of filesystem */
u
32
n_badblocks
;
/* number of bad blocks */
secno
bitmaps
;
/* pointers to free space bit maps */
u
32
zero1
;
/* 0 */
secno
badblocks
;
/* bad block list */
u
32
zero3
;
/* 0 */
time32_t
last_chkdsk
;
/* date last checked, 0 if never */
time32_t
last_optimize
;
/* date last optimized, 0 if never */
secno
n_dir_band
;
/* number of sectors in dir band */
secno
dir_band_start
;
/* first sector in dir band */
secno
dir_band_end
;
/* last sector in dir band */
secno
dir_band_bitmap
;
/* free space map, 1 dnode per bit */
__le
16
zero
;
/* 0 */
__le32
root
;
/* fnode of root directory */
__le32
n_sectors
;
/* size of filesystem */
__le
32
n_badblocks
;
/* number of bad blocks */
__le32
bitmaps
;
/* pointers to free space bit maps */
__le
32
zero1
;
/* 0 */
__le32
badblocks
;
/* bad block list */
__le
32
zero3
;
/* 0 */
__le32
last_chkdsk
;
/* date last checked, 0 if never */
__le32
last_optimize
;
/* date last optimized, 0 if never */
__le32
n_dir_band
;
/* number of sectors in dir band */
__le32
dir_band_start
;
/* first sector in dir band */
__le32
dir_band_end
;
/* last sector in dir band */
__le32
dir_band_bitmap
;
/* free space map, 1 dnode per bit */
u8
volume_name
[
32
];
/* not used */
secno
user_id_table
;
/* 8 preallocated sectors - user id */
__le32
user_id_table
;
/* 8 preallocated sectors - user id */
u32
zero6
[
103
];
/* 0 */
};
...
...
@@ -109,8 +109,8 @@ struct hpfs_super_block
struct
hpfs_spare_block
{
u
32
magic
;
/* f991 1849 */
u
32
magic1
;
/* fa52 29c5, more magic? */
__le
32
magic
;
/* f991 1849 */
__le
32
magic1
;
/* fa52 29c5, more magic? */
#ifdef __LITTLE_ENDIAN
u8
dirty
:
1
;
/* 0 clean, 1 "improperly stopped" */
...
...
@@ -153,21 +153,21 @@ struct hpfs_spare_block
u8
mm_contlgulty
;
u8
unused
;
secno
hotfix_map
;
/* info about remapped bad sectors */
u
32
n_spares_used
;
/* number of hotfixes */
u32
n_spares
;
/* number of spares in hotfix map */
u
32
n_dnode_spares_free
;
/* spare dnodes unused */
u32
n_dnode_spares
;
/* length of spare_dnodes[] list,
__le32
hotfix_map
;
/* info about remapped bad sectors */
__le
32
n_spares_used
;
/* number of hotfixes */
__le32
n_spares
;
/* number of spares in hotfix map */
__le
32
n_dnode_spares_free
;
/* spare dnodes unused */
__le32
n_dnode_spares
;
/* length of spare_dnodes[] list,
follows in this block*/
secno
code_page_dir
;
/* code page directory block */
u
32
n_code_pages
;
/* number of code pages */
u
32
super_crc
;
/* on HPFS386 and LAN Server this is
__le32
code_page_dir
;
/* code page directory block */
__le
32
n_code_pages
;
/* number of code pages */
__le
32
super_crc
;
/* on HPFS386 and LAN Server this is
checksum of superblock, on normal
OS/2 unused */
u
32
spare_crc
;
/* on HPFS386 checksum of spareblock */
u
32
zero1
[
15
];
/* unused */
dnode_secno
spare_dnodes
[
100
];
/* emergency free dnode list */
u32
zero2
[
1
];
/* room for more? */
__le
32
spare_crc
;
/* on HPFS386 checksum of spareblock */
__le
32
zero1
[
15
];
/* unused */
__le32
spare_dnodes
[
100
];
/* emergency free dnode list */
__le32
zero2
[
1
];
/* room for more? */
};
/* The bad block list is 4 sectors long. The first word must be zero,
...
...
@@ -202,18 +202,18 @@ struct hpfs_spare_block
struct
code_page_directory
{
u
32
magic
;
/* 4945 21f7 */
u
32
n_code_pages
;
/* number of pointers following */
u
32
zero1
[
2
];
__le
32
magic
;
/* 4945 21f7 */
__le
32
n_code_pages
;
/* number of pointers following */
__le
32
zero1
[
2
];
struct
{
u
16
ix
;
/* index */
u
16
code_page_number
;
/* code page number */
u32
bounds
;
/* matches corresponding word
__le
16
ix
;
/* index */
__le
16
code_page_number
;
/* code page number */
__le32
bounds
;
/* matches corresponding word
in data block */
secno
code_page_data
;
/* sector number of a code_page_data
__le32
code_page_data
;
/* sector number of a code_page_data
containing c.p. array */
u16
index
;
/* index in c.p. array in that sector*/
u
16
unknown
;
/* some unknown value; usually 0;
__le16
index
;
/* index in c.p. array in that sector*/
__le
16
unknown
;
/* some unknown value; usually 0;
2 in Japanese version */
}
array
[
31
];
/* unknown length */
};
...
...
@@ -224,19 +224,19 @@ struct code_page_directory
struct
code_page_data
{
u
32
magic
;
/* 8945 21f7 */
u32
n_used
;
/* # elements used in c_p_data[] */
u
32
bounds
[
3
];
/* looks a bit like
__le
32
magic
;
/* 8945 21f7 */
__le32
n_used
;
/* # elements used in c_p_data[] */
__le
32
bounds
[
3
];
/* looks a bit like
(beg1,end1), (beg2,end2)
one byte each */
u16
offs
[
3
];
/* offsets from start of sector
__le16
offs
[
3
];
/* offsets from start of sector
to start of c_p_data[ix] */
struct
{
u
16
ix
;
/* index */
u
16
code_page_number
;
/* code page number */
u
16
unknown
;
/* the same as in cp directory */
__le
16
ix
;
/* index */
__le
16
code_page_number
;
/* code page number */
__le
16
unknown
;
/* the same as in cp directory */
u8
map
[
128
];
/* upcase table for chars 80..ff */
u
16
zero2
;
__le
16
zero2
;
}
code_page
[
3
];
u8
incognita
[
78
];
};
...
...
fs/hpfs/hpfs_fn.h
View file @
28fe3c19
...
...
@@ -82,7 +82,7 @@ struct hpfs_sb_info {
unsigned
char
*
sb_cp_table
;
/* code page tables: */
/* 128 bytes uppercasing table & */
/* 128 bytes lowercasing table */
unsigned
*
sb_bmp_dir
;
/* main bitmap directory */
__le32
*
sb_bmp_dir
;
/* main bitmap directory */
unsigned
sb_c_bitmap
;
/* current bitmap */
unsigned
sb_max_fwd_alloc
;
/* max forwad allocation */
int
sb_timeshift
;
...
...
@@ -278,7 +278,7 @@ void hpfs_evict_inode(struct inode *);
__le32
*
hpfs_map_dnode_bitmap
(
struct
super_block
*
,
struct
quad_buffer_head
*
);
__le32
*
hpfs_map_bitmap
(
struct
super_block
*
,
unsigned
,
struct
quad_buffer_head
*
,
char
*
);
unsigned
char
*
hpfs_load_code_page
(
struct
super_block
*
,
secno
);
secno
*
hpfs_load_bitmap_directory
(
struct
super_block
*
,
secno
bmp
);
__le32
*
hpfs_load_bitmap_directory
(
struct
super_block
*
,
secno
bmp
);
struct
fnode
*
hpfs_map_fnode
(
struct
super_block
*
s
,
ino_t
,
struct
buffer_head
**
);
struct
anode
*
hpfs_map_anode
(
struct
super_block
*
s
,
anode_secno
,
struct
buffer_head
**
);
struct
dnode
*
hpfs_map_dnode
(
struct
super_block
*
s
,
dnode_secno
,
struct
quad_buffer_head
*
);
...
...
fs/hpfs/map.c
View file @
28fe3c19
...
...
@@ -89,18 +89,18 @@ unsigned char *hpfs_load_code_page(struct super_block *s, secno cps)
return
cp_table
;
}
secno
*
hpfs_load_bitmap_directory
(
struct
super_block
*
s
,
secno
bmp
)
__le32
*
hpfs_load_bitmap_directory
(
struct
super_block
*
s
,
secno
bmp
)
{
struct
buffer_head
*
bh
;
int
n
=
(
hpfs_sb
(
s
)
->
sb_fs_size
+
0x200000
-
1
)
>>
21
;
int
i
;
secno
*
b
;
__le32
*
b
;
if
(
!
(
b
=
kmalloc
(
n
*
512
,
GFP_KERNEL
)))
{
printk
(
"HPFS: can't allocate memory for bitmap directory
\n
"
);
return
NULL
;
}
for
(
i
=
0
;
i
<
n
;
i
++
)
{
secno
*
d
=
hpfs_map_sector
(
s
,
bmp
+
i
,
&
bh
,
n
-
i
-
1
);
__le32
*
d
=
hpfs_map_sector
(
s
,
bmp
+
i
,
&
bh
,
n
-
i
-
1
);
if
(
!
d
)
{
kfree
(
b
);
return
NULL
;
...
...
fs/hpfs/super.c
View file @
28fe3c19
...
...
@@ -572,7 +572,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
mark_buffer_dirty
(
bh2
);
}
if
(
spareblock
->
hotfixes_used
||
le32_to_cpu
(
spareblock
->
n_spares_used
)
)
{
if
(
spareblock
->
hotfixes_used
||
spareblock
->
n_spares_used
)
{
if
(
errs
>=
2
)
{
printk
(
"HPFS: Hotfixes not supported here, try chkdsk
\n
"
);
mark_dirty
(
s
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment