diff options
author | dg <dg@FreeBSD.org> | 1995-05-19 03:27:08 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-05-19 03:27:08 +0000 |
commit | 240701b33f6e29d9a8af5865149a9c3471f2f342 (patch) | |
tree | 97034757da4a025cf749a7136a8b5b466b4664a3 /sys/vm | |
parent | 3474ee3930b2020ff8e8b697f5b838faac802549 (diff) | |
download | FreeBSD-src-240701b33f6e29d9a8af5865149a9c3471f2f342.zip FreeBSD-src-240701b33f6e29d9a8af5865149a9c3471f2f342.tar.gz |
NFS diskless operation was broken because swapdev_vp wasn't initialized.
These changes solve the problem in a general way by moving the
initialization out of the individual fs_mountroot's and into swaponvp().
Submitted by: Poul-Henning Kamp
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_swap.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index d66fb01..2191a73 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 - * $Id: vm_swap.c,v 1.17 1995/05/14 03:00:10 davidg Exp $ + * $Id: vm_swap.c,v 1.18 1995/05/18 05:09:54 davidg Exp $ */ #include <sys/param.h> @@ -58,6 +58,7 @@ #endif static struct swdevt should_be_malloced[NSWAPDEV]; struct swdevt *swdevt = should_be_malloced; +struct vnode *swapdev_vp; int nswap; /* first block after the interleaved devs */ int nswdev = NSWAPDEV; int vm_swap_size; @@ -249,5 +250,9 @@ swaponvp(p, vp, dev, nblks) rlist_free(&swaplist, vsbase, vsbase + blk - 1); vm_swap_size += blk; } + + if (!swapdev_vp && bdevvp(swapdev, &swapdev_vp)) + panic("Cannot get vnode for swapdev"); + return (0); } |