From 324237c481626d95750116fca66da280cd6ac002 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Mon, 11 May 2009 23:15:43 +0000 Subject: Make sure last, catch-all, auto-allocated partition ends on a cylinder boundary if SUN_CYLCHECK is defined. Don't bother rounding any partition size to cylinder boundary if SUN_CYLCHECK is not defined. Should fix warning message on sparc64 noticed by dlg@. ok deraadt@ --- sbin/disklabel/editor.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'sbin') diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index d5bdf5acbad..9d532f80156 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.205 2009/05/11 23:09:44 deraadt Exp $ */ +/* $OpenBSD: editor.c,v 1.206 2009/05/11 23:15:42 krw Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller @@ -17,7 +17,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.205 2009/05/11 23:09:44 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.206 2009/05/11 23:15:42 krw Exp $"; #endif /* not lint */ #include @@ -582,18 +582,26 @@ again: secs = ap->maxsz; else secs = totsecs; +#ifdef SUN_CYLCHECK + goto cylinderalign; +#endif } else { secs = ap->minsz; if (xtrasecs > 0) secs += (xtrasecs / 100) * ap->rate; if (secs > ap->maxsz) secs = ap->maxsz; +#ifdef SUN_CYLCHECK +cylinderalign: secs = ((secs + cylsecs - 1) / cylsecs) * cylsecs; +#endif totsecs -= secs; +#ifdef SUN_CYLCHECK while (totsecs < 0) { secs -= cylsecs; totsecs += cylsecs; } +#endif } /* Find largest chunk of free space. */ -- cgit v1.2.3