On Mon, Apr 10, 2006 at 10:03:41AM +0000, Pawel Jakub Dawidek wrote: +> pjd 2006-04-10 10:03:41 UTC +> +> FreeBSD src repository +> +> Modified files: +> sys/kern kern_shutdown.c +> sys/vm swap_pager.c swap_pager.h +> Log: +> On shutdown try to turn off all swap devices. This way GEOM providers are +> properly closed on shutdown.
The hard situation to solve is when we have, eg. file-backed md(4)
devices which we use as a swap device. We can also configure swap-backed
md(4) device and create and mount file system on it.
To solve such complex scenario we need to reimplement vfs_unmountall()
and swapoff_all() to return number of unmounted file system (removed
swap devices) and do something like:
vfs_unmountall();
swapoff_all();
for (;;) {
n = vfs_unmountall();
if (n == 0)
break;
n = swapoff_all();
if (n == 0)
break;
}
--
Pawel Jakub Dawidek http://www.wheel.pl
[EMAIL PROTECTED] http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
pgpfE1RLPaubk.pgp
Description: PGP signature
