diff options
author | dillon <dillon@FreeBSD.org> | 2000-01-25 17:49:12 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2000-01-25 17:49:12 +0000 |
commit | fd8bf791648362bc558306021bb90b3f6b3e970d (patch) | |
tree | d0bd20d5dce285e8e17b663c3d42cb7cf1f396bc /sys/vm/vm_swap.c | |
parent | 3d620c45322c04e6b40ca9fceca88315b20e9b3b (diff) | |
download | FreeBSD-src-fd8bf791648362bc558306021bb90b3f6b3e970d.zip FreeBSD-src-fd8bf791648362bc558306021bb90b3f6b3e970d.tar.gz |
The swapdev_vp changes made to rip out the swap specfs interaction
also broke diskless swapping. Moving the swapdev_vp initialization
to more commonly run code solves the problem.
PR: kern/16165
Additional testing by: David Gilbert <dgilbert@velocet.ca>
Diffstat (limited to 'sys/vm/vm_swap.c')
-rw-r--r-- | sys/vm/vm_swap.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 9577c59..0a38aa3 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -210,14 +210,6 @@ swapon(p, uap) if (error) vrele(vp); - if (!swapdev_vp) { - error = getnewvnode(VT_NON, NULL, swapdev_vnodeop_p, - &swapdev_vp); - if (error) - panic("Cannot get vnode for swapdev"); - swapdev_vp->v_type = VNON; /* Untyped */ - } - return (error); } @@ -246,6 +238,14 @@ swaponvp(p, vp, dev, nblks) swblk_t dvbase; int error; + if (!swapdev_vp) { + error = getnewvnode(VT_NON, NULL, swapdev_vnodeop_p, + &swapdev_vp); + if (error) + panic("Cannot get vnode for swapdev"); + swapdev_vp->v_type = VNON; /* Untyped */ + } + ASSERT_VOP_UNLOCKED(vp, "swaponvp"); for (sp = swdevt, index = 0 ; index < nswdev; index++, sp++) { if (sp->sw_vp == vp) |