]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
swap_pager.c reserves 2 blocks for a bsd label. Change that 2 to the
authordougm <dougm@FreeBSD.org>
Thu, 15 Aug 2019 02:30:44 +0000 (02:30 +0000)
committerdougm <dougm@FreeBSD.org>
Thu, 15 Aug 2019 02:30:44 +0000 (02:30 +0000)
commit5a521a24c04ea3a6b6b18862dd9df5cf74b75571
treeef0fd6520ad538c1af1babe38bbd58113f5bcb8f
parent0abf45637f0c121d44e6a5f0b7b04886d2baace0
swap_pager.c reserves 2 blocks for a bsd label.  Change that 2 to the
expression howmany(BBSIZE, PAGE_SIZE), where BBSIZE is the size of the
boot block area.  That can be less than 2 if PAGE_SIZE is big.

swapon(8) has an option to trim (delete) all the blocks of a device at
startup.  However, if the first of those blocks is a bsd label, then
trimming those blocks is destructive.  Change swapon to leave the
first BBSIZE bytes untrimmed.

Update manual pages to reflect changes in how swapon and how it may be
used, espeically in association with savecore.

Reviewed by: alc
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D21191
sbin/swapon/swapon.8
sbin/swapon/swapon.c
share/man/man5/fstab.5
sys/vm/swap_pager.c