Do not truncate available disk space to the closest track boundary.
This commit is contained in:
parent
23a3490034
commit
6fd1e2e013
@ -248,7 +248,6 @@ g_part_pc98_create(struct g_part_table *basetable, struct g_part_parms *gpp)
|
||||
{
|
||||
struct g_provider *pp;
|
||||
struct g_part_pc98_table *table;
|
||||
uint32_t cyl, msize;
|
||||
|
||||
pp = gpp->gpp_provider;
|
||||
if (pp->sectorsize < SECSIZE || pp->mediasize < BOOTSIZE)
|
||||
@ -256,11 +255,8 @@ g_part_pc98_create(struct g_part_table *basetable, struct g_part_parms *gpp)
|
||||
if (pp->sectorsize > SECSIZE)
|
||||
return (ENXIO);
|
||||
|
||||
cyl = basetable->gpt_heads * basetable->gpt_sectors;
|
||||
|
||||
msize = MIN(pp->mediasize / SECSIZE, UINT32_MAX);
|
||||
basetable->gpt_first = cyl;
|
||||
basetable->gpt_last = msize - (msize % cyl) - 1;
|
||||
basetable->gpt_first = basetable->gpt_heads * basetable->gpt_sectors;
|
||||
basetable->gpt_last = MIN(pp->mediasize / SECSIZE, UINT32_MAX) - 1;
|
||||
|
||||
table = (struct g_part_pc98_table *)basetable;
|
||||
le16enc(table->boot + DOSMAGICOFFSET, DOSMAGIC);
|
||||
@ -488,7 +484,7 @@ g_part_pc98_read(struct g_part_table *basetable, struct g_consumer *cp)
|
||||
|
||||
basetable->gpt_entries = NDOSPART;
|
||||
basetable->gpt_first = cyl;
|
||||
basetable->gpt_last = msize - (msize % cyl) - 1;
|
||||
basetable->gpt_last = msize - 1;
|
||||
|
||||
g_free(buf);
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user