summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-10-04 23:37:38 +0000
committeralc <alc@FreeBSD.org>2003-10-04 23:37:38 +0000
commit44ee8e221156e7d2f2a088fdea3361cdc9902479 (patch)
treedf18450ad817f3598140d2138264f967410f60ff /sys/fs
parent74f19ddd0e60157ed1517ea26258f4b89b688bea (diff)
downloadFreeBSD-src-44ee8e221156e7d2f2a088fdea3361cdc9902479.zip
FreeBSD-src-44ee8e221156e7d2f2a088fdea3361cdc9902479.tar.gz
Synchronize access to a vm page's valid field using the containing
vm object's lock.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nwfs/nwfs_io.c6
-rw-r--r--sys/fs/smbfs/smbfs_io.c9
2 files changed, 6 insertions, 9 deletions
diff --git a/sys/fs/nwfs/nwfs_io.c b/sys/fs/nwfs/nwfs_io.c
index a64b844..d0ab8e5 100644
--- a/sys/fs/nwfs/nwfs_io.c
+++ b/sys/fs/nwfs/nwfs_io.c
@@ -440,8 +440,7 @@ nwfs_getpages(ap)
relpbuf(bp, &nwfs_pbuf_freecnt);
- if (error)
- VM_OBJECT_LOCK(object);
+ VM_OBJECT_LOCK(object);
if (error && (uio.uio_resid == count)) {
printf("nwfs_getpages: error %d\n",error);
vm_page_lock_queues();
@@ -497,8 +496,7 @@ nwfs_getpages(ap)
}
}
vm_page_unlock_queues();
- if (error)
- VM_OBJECT_UNLOCK(object);
+ VM_OBJECT_UNLOCK(object);
return 0;
#endif /* NWFS_RWCACHE */
}
diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c
index eed3789..99f7c7d 100644
--- a/sys/fs/smbfs/smbfs_io.c
+++ b/sys/fs/smbfs/smbfs_io.c
@@ -453,10 +453,10 @@ smbfs_getpages(ap)
*/
m = pages[reqpage];
+ VM_OBJECT_LOCK(object);
if (m->valid != 0) {
/* handled by vm_fault now */
/* vm_page_zero_invalid(m, TRUE); */
- VM_OBJECT_LOCK(object);
vm_page_lock_queues();
for (i = 0; i < npages; ++i) {
if (i != reqpage)
@@ -466,6 +466,7 @@ smbfs_getpages(ap)
VM_OBJECT_UNLOCK(object);
return 0;
}
+ VM_OBJECT_UNLOCK(object);
smb_makescred(&scred, td, cred);
@@ -491,8 +492,7 @@ smbfs_getpages(ap)
relpbuf(bp, &smbfs_pbuf_freecnt);
- if (error)
- VM_OBJECT_LOCK(object);
+ VM_OBJECT_LOCK(object);
if (error && (uio.uio_resid == count)) {
printf("smbfs_getpages: error %d\n",error);
vm_page_lock_queues();
@@ -563,8 +563,7 @@ smbfs_getpages(ap)
}
}
vm_page_unlock_queues();
- if (error)
- VM_OBJECT_UNLOCK(object);
+ VM_OBJECT_UNLOCK(object);
return 0;
#endif /* SMBFS_RWGENERIC */
}
OpenPOWER on IntegriCloud