diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-05-11 23:15:43 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-05-11 23:15:43 +0000 |
commit | 324237c481626d95750116fca66da280cd6ac002 (patch) | |
tree | aa52a0ffab1c407419e10febaa6b5c5a3aa5d61a /sbin | |
parent | 78da0e39d32d87b14c18561078d364a478fb27bd (diff) |
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@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/disklabel/editor.c | 12 |
1 files changed, 10 insertions, 2 deletions
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 <Todd.Miller@courtesan.com> @@ -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 <sys/types.h> @@ -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. */ |