Fix NFS file swapping, I broke it 3 months ago it seems.

This commit is contained in:
phk 2003-06-05 21:57:19 +00:00
parent ba616ce294
commit f32aeb42b9

View File

@ -314,12 +314,12 @@ swaponvp(td, vp, dev, nblks)
if (error)
return (error);
error = VOP_IOCTL(vp, DIOCGMEDIASIZE, (caddr_t)&mediasize,
FREAD, td->td_ucred, td);
if (error == 0)
nblks = mediasize / DEV_BSIZE;
else
nblks = 0;
if (nblks == 0) {
error = VOP_IOCTL(vp, DIOCGMEDIASIZE, (caddr_t)&mediasize,
FREAD, td->td_ucred, td);
if (error == 0)
nblks = mediasize / DEV_BSIZE;
}
/*
* XXX: We should also check that the sectorsize makes sense
* XXX: it should be a power of two, no larger than the page size.