diff options
author | ae <ae@FreeBSD.org> | 2011-05-24 16:49:34 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2011-05-24 16:49:34 +0000 |
commit | 0567ac733b1a16f92fcebe9e7030923a9b59efd9 (patch) | |
tree | c53cdf07734527f1d8b5034568304b78f28b3a39 | |
parent | f4e35def4a48178d9be0cf83db88ac8b4dccf463 (diff) | |
download | FreeBSD-src-0567ac733b1a16f92fcebe9e7030923a9b59efd9.zip FreeBSD-src-0567ac733b1a16f92fcebe9e7030923a9b59efd9.tar.gz |
Fix calculation of alignment for odd values. Also do not change value
when it is already aligned.
-rw-r--r-- | sbin/geom/class/part/geom_part.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c index 19d1502..e11edd5 100644 --- a/sbin/geom/class/part/geom_part.c +++ b/sbin/geom/class/part/geom_part.c @@ -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) |