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:
parent
54aa177193
commit
6e8b65472e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user