diff options
author | phk <phk@FreeBSD.org> | 2003-06-05 21:57:19 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-06-05 21:57:19 +0000 |
commit | 760be5c8cae4dbbdebbf5710ff2278fcecdd114b (patch) | |
tree | c4c83d6345c47aac398e7ffca83f9f06f2514047 /sys/vm/vm_swap.c | |
parent | 6a770c47d44fec12ad7ebfd0b9904f691ca7dcc1 (diff) | |
download | FreeBSD-src-760be5c8cae4dbbdebbf5710ff2278fcecdd114b.zip FreeBSD-src-760be5c8cae4dbbdebbf5710ff2278fcecdd114b.tar.gz |
Fix NFS file swapping, I broke it 3 months ago it seems.
Diffstat (limited to 'sys/vm/vm_swap.c')
-rw-r--r-- | sys/vm/vm_swap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 057a85d..4d9e783 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -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. |