Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Jan 2011 15:05:10 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r218094 - user/nwhitehorn/bsdinstall/partedit
Message-ID:  <201101301505.p0UF5AwJ075569@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Sun Jan 30 15:05:10 2011
New Revision: 218094
URL: http://svn.freebsd.org/changeset/base/218094

Log:
  Make size adjustment for boot partitions somewhat cleaner.

Modified:
  user/nwhitehorn/bsdinstall/partedit/gpart_ops.c

Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c
==============================================================================
--- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c	Sun Jan 30 14:22:45 2011	(r218093)
+++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c	Sun Jan 30 15:05:10 2011	(r218094)
@@ -695,18 +695,13 @@ gpart_create(struct gprovider *pp, char 
 	if (geom == NULL)
 		return;
 
-	size = gpart_max_free(geom, &firstfree);
+	maxsize = size = gpart_max_free(geom, &firstfree);
 	if (size <= 0) {
 		dialog_msgbox("Error", "No free space left on device.", 0, 0,
 		    TRUE);
 		return;
 	}
 
-	/* Leave a free megabyte in case we need to write a boot partition */
-	if (size*sector >= (intmax_t)bootpart_size(scheme))
-		size -= bootpart_size(scheme)/sector;
-	maxsize = size;
-
 	humanize_number(sizestr, 7, size*sector, "B", HN_AUTOSCALE,
 	    HN_NOSPACE | HN_DECIMAL);
 	items[1].text = sizestr;
@@ -818,6 +813,7 @@ addpartform:
 
 			/* Now adjust the part we are really adding forward */
 			firstfree += bootpart_size(scheme) / sector;
+			size -= (bootpart_size(scheme) + stripe)/sector;
 			if (stripe > 0 && (firstfree*sector % stripe) != 0) 
 				firstfree += (stripe - ((firstfree*sector) %
 				    stripe)) / sector;



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