Date: Tue, 7 Jun 2011 11:11:11 +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: r222819 - head/sbin/geom/class/part Message-ID: <201106071111.p57BBBH6081294@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Tue Jun 7 11:11:11 2011 New Revision: 222819 URL: http://svn.freebsd.org/changeset/base/222819 Log: Do not use LCM from stripesize and user specified alignment value. When user wants have specific alignment - do what user wants. Use stripesize as alignment value in case, when some of gpart's arguments are ommitted for automatic calculation. Suggested by: mav 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 Jun 7 09:37:08 2011 (r222818) +++ head/sbin/geom/class/part/geom_part.c Tue Jun 7 11:11:11 2011 (r222819) @@ -341,9 +341,10 @@ gpart_autofill_resize(struct gctl_req *r errc(EXIT_FAILURE, error, "Invalid alignment param"); if (alignment == 0) errx(EXIT_FAILURE, "Invalid alignment param"); + } else { lba = pp->lg_stripesize / pp->lg_sectorsize; if (lba > 0) - alignment = g_lcm(lba, alignment); + alignment = lba; } error = gctl_delete_param(req, "alignment"); if (error) @@ -491,13 +492,9 @@ gpart_autofill(struct gctl_req *req) if (has_size && has_start && !has_alignment) goto done; - /* - * If stripesize is not zero, then recalculate alignment value. - * Use LCM from stripesize and user specified alignment. - */ len = pp->lg_stripesize / pp->lg_sectorsize; - if (len > 0 ) - alignment = g_lcm(len, alignment); + if (len > 0 && !has_alignment) + alignment = len; /* Adjust parameters to stripeoffset */ offset = pp->lg_stripeoffset / pp->lg_sectorsize;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106071111.p57BBBH6081294>