Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 May 2011 09:45:13 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r222281 - head/sys/geom/part
Message-ID:  <201105250945.p4P9jDXe008655@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Wed May 25 09:45:13 2011
New Revision: 222281
URL: http://svn.freebsd.org/changeset/base/222281

Log:
  Do not truncate available disk space to the closest track boundary.

Modified:
  head/sys/geom/part/g_part_pc98.c

Modified: head/sys/geom/part/g_part_pc98.c
==============================================================================
--- head/sys/geom/part/g_part_pc98.c	Wed May 25 09:38:12 2011	(r222280)
+++ head/sys/geom/part/g_part_pc98.c	Wed May 25 09:45:13 2011	(r222281)
@@ -248,7 +248,6 @@ g_part_pc98_create(struct g_part_table *
 {
 	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 *
 	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 *ba
 
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105250945.p4P9jDXe008655>