mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-28 20:55:21 +00:00
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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=56599
|
@ -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 a new issue