diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2012-07-13 16:06:43 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2012-07-13 16:06:43 +0000 |
commit | 819989efbe8ffde4cc6e3ab1afe11029ea586c6a (patch) | |
tree | 4e964c7113ade51aff9048239346b3d751eb8fcb /sbin/disklabel/editor.c | |
parent | d8297e78ffe2a6b9dc0f7ccf007949d4ed95c957 (diff) |
Replace a '512' with DEV_BSIZE. Calculate physmem size in blocks and
not sectors, since the values being tested/manipulated in the auto_alloc
tables are blocks at that point. Use MEG(256) instead of hand
expanding it when testing physmem.
Diffstat (limited to 'sbin/disklabel/editor.c')
-rw-r--r-- | sbin/disklabel/editor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 7ba9b2ae8c8..ebdef6f692a 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.268 2012/03/18 03:24:01 krw Exp $ */ +/* $OpenBSD: editor.c,v 1.269 2012/07/13 16:06:42 krw Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -553,7 +553,7 @@ editor_allocspace(struct disklabel *lp_org) } } - physmem = getphysmem() / lp_org->d_secsize; + physmem = getphysmem() / DEV_BSIZE; /* Blocks not sectors here! */ cylsecs = lp_org->d_secpercyl; again: @@ -573,7 +573,7 @@ again: /* bump max swap based on phys mem, little physmem gets 2x swap */ if (index == 0) { - if (physmem < 256LL * 1024 * 1024 / lp->d_secsize) + if (physmem < MEG(256)) alloc[1].maxsz = 2 * physmem; else alloc[1].maxsz += physmem; |