From owner-svn-src-head@FreeBSD.ORG Tue May 24 16:49:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8E771065672; Tue, 24 May 2011 16:49:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 996AE8FC0C; Tue, 24 May 2011 16:49:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4OGnY8o077871; Tue, 24 May 2011 16:49:34 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4OGnYSS077869; Tue, 24 May 2011 16:49:34 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105241649.p4OGnYSS077869@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 24 May 2011 16:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222263 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 16:49:34 -0000 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)