fsys_fat: Fixed calculation of FAT_SUPER->num_clust.
This commit is contained in:
parent
529a2dc5e0
commit
436fb5ce95
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2000-07-25 Jochen Hoenicke <jochen@gnu.org>
|
||||
|
||||
* stage2/fsys_fat.c (fat_mount): Fixed calculation of num_clust.
|
||||
It was off by two, since the two non existing clusters 0 and 1
|
||||
were not taken into account.
|
||||
|
||||
2000-07-25 OKUJI Yoshinori <okuji@gnu.org>
|
||||
|
||||
* stage2/asm.S [!STAGE1_5] (linux_text_len): New variable.
|
||||
|
|
|
@ -106,7 +106,8 @@ fat_mount (void)
|
|||
FAT_SUPER->root_offset
|
||||
+ ((FAT_SUPER->root_max - 1) >> FAT_SUPER->sectsize_bits) + 1;
|
||||
FAT_SUPER->num_clust =
|
||||
(FAT_SUPER->num_sectors - FAT_SUPER->data_offset) / bpb.sects_per_clust;
|
||||
2 + ((FAT_SUPER->num_sectors - FAT_SUPER->data_offset)
|
||||
/ bpb.sects_per_clust);
|
||||
FAT_SUPER->sects_per_clust = bpb.sects_per_clust;
|
||||
|
||||
if (!bpb.fat_length)
|
||||
|
@ -136,7 +137,7 @@ fat_mount (void)
|
|||
|| FAT_CVT_U16(bpb.bytes_per_sect) != SECTOR_SIZE
|
||||
|| bpb.sects_per_clust != (1 << (FAT_SUPER->clustsize_bits
|
||||
- FAT_SUPER->sectsize_bits))
|
||||
|| FAT_SUPER->num_clust <= 0
|
||||
|| FAT_SUPER->num_clust <= 2
|
||||
|| (FAT_SUPER->fat_size * FAT_SUPER->num_clust / (2 * SECTOR_SIZE)
|
||||
> FAT_SUPER->fat_length))
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue