Eliminate unnecessary clearing of the page's dirty mask from various
getpages functions. Eliminate a stale comment.
This commit is contained in:
parent
6262c79b70
commit
42eb41087c
@ -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
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user