summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_swap.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-06-05 21:57:19 +0000
committerphk <phk@FreeBSD.org>2003-06-05 21:57:19 +0000
commit760be5c8cae4dbbdebbf5710ff2278fcecdd114b (patch)
treec4c83d6345c47aac398e7ffca83f9f06f2514047 /sys/vm/vm_swap.c
parent6a770c47d44fec12ad7ebfd0b9904f691ca7dcc1 (diff)
downloadFreeBSD-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.c12
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.
OpenPOWER on IntegriCloud