svn commit: r222263 - head/sbin/geom/class/part
Andrey V. Elsukov
ae at FreeBSD.org
Tue May 24 16:49:34 UTC 2011
Author: ae
Date: Tue May 24 16:49:34 2011
New Revision: 222263
URL: http://svn.freebsd.org/changeset/base/222263
Log:
Fix calculation of alignment for odd values. Also do not change value
when it is already aligned.
Modified:
head/sbin/geom/class/part/geom_part.c
Modified: head/sbin/geom/class/part/geom_part.c
==============================================================================
--- head/sbin/geom/class/part/geom_part.c Tue May 24 16:06:26 2011 (r222262)
+++ head/sbin/geom/class/part/geom_part.c Tue May 24 16:49:34 2011 (r222263)
@@ -295,8 +295,8 @@ fmtattrib(struct gprovider *pp)
return (buf);
}
-#define ALIGNDOWN(d, a) (-(a) & (d))
-#define ALIGNUP(d, a) (-(-(a) & -(d)))
+#define ALIGNDOWN(d, a) ((d) % (a) ? (d) - (d) % (a): (d))
+#define ALIGNUP(d, a) ((d) % (a) ? (d) - (d) % (a) + (a): (d))
static int
gpart_autofill_resize(struct gctl_req *req)
More information about the svn-src-head
mailing list