Do not truncate available disk space to the closest track boundary.
This commit is contained in:
parent
67900914ff
commit
db48d4a92e
@ -253,15 +253,14 @@ g_part_mbr_create(struct g_part_table *basetable, struct g_part_parms *gpp)
|
||||
{
|
||||
struct g_provider *pp;
|
||||
struct g_part_mbr_table *table;
|
||||
uint32_t msize;
|
||||
|
||||
pp = gpp->gpp_provider;
|
||||
if (pp->sectorsize < MBRSIZE)
|
||||
return (ENOSPC);
|
||||
|
||||
msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX);
|
||||
basetable->gpt_first = basetable->gpt_sectors;
|
||||
basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1;
|
||||
basetable->gpt_last = MIN(pp->mediasize / pp->sectorsize,
|
||||
UINT32_MAX) - 1;
|
||||
|
||||
table = (struct g_part_mbr_table *)basetable;
|
||||
le16enc(table->mbr + DOSMAGICOFFSET, DOSMAGIC);
|
||||
@ -470,7 +469,7 @@ g_part_mbr_read(struct g_part_table *basetable, struct g_consumer *cp)
|
||||
|
||||
basetable->gpt_entries = NDOSPART;
|
||||
basetable->gpt_first = basetable->gpt_sectors;
|
||||
basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1;
|
||||
basetable->gpt_last = msize - 1;
|
||||
|
||||
g_free(buf);
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user