summaryrefslogtreecommitdiffstats
path: root/src/hdaccess.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-12-08 09:00:52 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2011-12-08 09:00:52 +0100
commit7943d695f9470e39fd2ff75c83941ec6f47f577d (patch)
tree90cb489b3ff5a00f09addb2b7a54f2e8c54203b5 /src/hdaccess.c
parent01fc5101b70cba8e095f36809488b11e361a8412 (diff)
Remove "Allow partial last cylinder" option
Diffstat (limited to 'src/hdaccess.c')
-rw-r--r--src/hdaccess.c43
1 files changed, 3 insertions, 40 deletions
diff --git a/src/hdaccess.c b/src/hdaccess.c
index 19ef443..d3fd9ba 100644
--- a/src/hdaccess.c
+++ b/src/hdaccess.c
@@ -1594,7 +1594,7 @@ disk_t *file_test_availability(const char *device, const int verbose, const arch
return NULL;
}
-void hd_update_geometry(disk_t *disk, const int allow_partial_last_cylinder, const int verbose)
+void hd_update_geometry(disk_t *disk, const int verbose)
{
if(disk->autodetect!=0)
{
@@ -1609,43 +1609,6 @@ void hd_update_geometry(disk_t *disk, const int allow_partial_last_cylinder, con
}
free(buffer);
}
- if((unsigned int)(disk->geom.cylinders+1)!=0) /* Avoid to wrap */
- {
- uint64_t pos;
- CHS_t pos_CHS;
- pos_CHS.cylinder=disk->geom.cylinders-1+1;
- if(allow_partial_last_cylinder)
- {
- pos_CHS.head=0;
- pos_CHS.sector=1;
- }
- else
- {
- pos_CHS.head=disk->geom.heads_per_cylinder-1;
- pos_CHS.sector=disk->geom.sectors_per_head;
- }
- pos=CHS2offset(disk,&pos_CHS);
-#ifdef DJGPP
- if(disk->description==disk_description)
- {
- struct info_disk_struct*data=disk->data;
- data->geo_phys.cylinders=0;
- }
-#endif
- {
- unsigned char *buffer=(unsigned char *)MALLOC(disk->sector_size);
- if((unsigned)disk->pread(disk, buffer, disk->sector_size, pos) == disk->sector_size)
- {
- disk->geom.cylinders++;
- if(disk->disk_size < (uint64_t)disk->geom.cylinders * disk->geom.heads_per_cylinder * disk->geom.sectors_per_head * disk->sector_size)
- {
- disk->disk_size = (uint64_t)disk->geom.cylinders * disk->geom.heads_per_cylinder * disk->geom.sectors_per_head * disk->sector_size;
- log_info("Computes LBA from CHS for %s\n",disk->description(disk));
- }
- }
- free(buffer);
- }
- }
#ifdef DJGPP
if(disk->description==disk_description)
{
@@ -1655,7 +1618,7 @@ void hd_update_geometry(disk_t *disk, const int allow_partial_last_cylinder, con
#endif
}
-void hd_update_all_geometry(const list_disk_t * list_disk, const int allow_partial_last_cylinder, const int verbose)
+void hd_update_all_geometry(const list_disk_t * list_disk, const int verbose)
{
const list_disk_t *element_disk;
if(verbose>1)
@@ -1663,7 +1626,7 @@ void hd_update_all_geometry(const list_disk_t * list_disk, const int allow_parti
log_trace("hd_update_all_geometry\n");
}
for(element_disk=list_disk;element_disk!=NULL;element_disk=element_disk->next)
- hd_update_geometry(element_disk->disk,allow_partial_last_cylinder,verbose);
+ hd_update_geometry(element_disk->disk, verbose);
}
void init_disk(disk_t *disk)