Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/swap_pager.c
Show First 20 Lines • Show All 2,460 Lines • ▼ Show 20 Lines | sys_swapon(struct thread *td, struct swapon_args *uap) | ||||
NDFREE_PNBUF(&nd); | NDFREE_PNBUF(&nd); | ||||
vp = nd.ni_vp; | vp = nd.ni_vp; | ||||
if (vn_isdisk_error(vp, &error)) { | if (vn_isdisk_error(vp, &error)) { | ||||
error = swapongeom(vp); | error = swapongeom(vp); | ||||
} else if (vp->v_type == VREG && | } else if (vp->v_type == VREG && | ||||
(vp->v_mount->mnt_vfc->vfc_flags & VFCF_NETWORK) != 0 && | (vp->v_mount->mnt_vfc->vfc_flags & VFCF_NETWORK) != 0 && | ||||
(error = VOP_GETATTR(vp, &attr, td->td_ucred)) == 0) { | (error = VOP_GETATTR(vp, 0, &attr, td->td_ucred)) == 0) { | ||||
/* | /* | ||||
* Allow direct swapping to NFS regular files in the same | * Allow direct swapping to NFS regular files in the same | ||||
* way that nfs_mountroot() sets up diskless swapping. | * way that nfs_mountroot() sets up diskless swapping. | ||||
*/ | */ | ||||
error = swaponvp(td, vp, attr.va_size / DEV_BSIZE); | error = swaponvp(td, vp, attr.va_size / DEV_BSIZE); | ||||
} | } | ||||
if (error != 0) | if (error != 0) | ||||
▲ Show 20 Lines • Show All 788 Lines • Show Last 20 Lines |