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>
This commit is contained in:
Matthew Dillon 2000-01-25 17:49:12 +00:00
parent 54aa177193
commit 6e8b65472e

View File

@ -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)