summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2009-05-15 04:33:35 +0000
committeralc <alc@FreeBSD.org>2009-05-15 04:33:35 +0000
commit1af8842f56411a768c8a8b8fee2845313dba8223 (patch)
treea86532abfd963fc5ea7bcdfd1df5cd2b4cfd3465 /sys
parent768767541d0c2e71285019bc8fd72c4d77ca9eb6 (diff)
downloadFreeBSD-src-1af8842f56411a768c8a8b8fee2845313dba8223.zip
FreeBSD-src-1af8842f56411a768c8a8b8fee2845313dba8223.tar.gz
Eliminate unnecessary clearing of the page's dirty mask from various
getpages functions. Eliminate a stale comment.
Diffstat (limited to 'sys')
-rw-r--r--sys/fs/smbfs/smbfs_io.c4
-rw-r--r--sys/nfsclient/nfs_bio.c4
-rw-r--r--sys/vm/vnode_pager.c11
3 files changed, 12 insertions, 7 deletions
diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c
index 7890f88..4ea192b 100644
--- a/sys/fs/smbfs/smbfs_io.c
+++ b/sys/fs/smbfs/smbfs_io.c
@@ -524,7 +524,9 @@ smbfs_getpages(ap)
* Read operation filled a partial page.
*/
m->valid = 0;
- vm_page_set_validclean(m, 0, size - toff);
+ vm_page_set_valid(m, 0, size - toff);
+ KASSERT((m->dirty & vm_page_bits(0, size - toff)) == 0,
+ ("smbfs_getpages: page %p is dirty", m));
} else {
/*
* Read operation was short. If no error occured
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index e60a201..6c468fb 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -216,7 +216,9 @@ nfs_getpages(struct vop_getpages_args *ap)
* Read operation filled a partial page.
*/
m->valid = 0;
- vm_page_set_validclean(m, 0, size - toff);
+ vm_page_set_valid(m, 0, size - toff);
+ KASSERT((m->dirty & vm_page_bits(0, size - toff)) == 0,
+ ("nfs_getpages: page %p is dirty", m));
} else {
/*
* Read operation was short. If no error occured
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index cf9dcb1..ed09044 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -939,17 +939,18 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage)
mt));
} else {
/*
- * Read did not fill up entire page. Since this
- * is getpages, the page may be mapped, so we have
- * to zero the invalid portions of the page even
- * though we aren't setting them valid.
+ * Read did not fill up entire page.
*
* Currently we do not set the entire page valid,
* we just try to clear the piece that we couldn't
* read.
*/
- vm_page_set_validclean(mt, 0,
+ vm_page_set_valid(mt, 0,
object->un_pager.vnp.vnp_size - tfoff);
+ KASSERT((mt->dirty & vm_page_bits(0,
+ object->un_pager.vnp.vnp_size - tfoff)) == 0,
+ ("vnode_pager_generic_getpages: page %p is dirty",
+ mt));
}
if (i != reqpage) {
OpenPOWER on IntegriCloud