diff options
author | alc <alc@FreeBSD.org> | 2008-02-07 05:55:16 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2008-02-07 05:55:16 +0000 |
commit | 4a600fdd889623042bafdeea59fe56eb787374b7 (patch) | |
tree | da99a524d8a67471561fffcaaca80c05a11bcdd1 /sys/kern/uipc_shm.c | |
parent | 22e608f1ceb21dc3bb9bf5cda8f34642cc6e623f (diff) | |
download | FreeBSD-src-4a600fdd889623042bafdeea59fe56eb787374b7.zip FreeBSD-src-4a600fdd889623042bafdeea59fe56eb787374b7.tar.gz |
Change shm_dotruncate() so that it correctly handles cached pages that span
the end of the object. (This change is analogous to revision 1.237 of
vm/vnode_pager.c.)
Discussed with: jhb
Diffstat (limited to 'sys/kern/uipc_shm.c')
-rw-r--r-- | sys/kern/uipc_shm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index cf7212f..0154a40 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -287,6 +287,10 @@ shm_dotruncate(struct shmfd *shmfd, off_t length) if (m->dirty != 0) m->dirty = VM_PAGE_BITS_ALL; vm_page_unlock_queues(); + } else if ((length & PAGE_MASK) && + __predict_false(object->cache != NULL)) { + vm_page_cache_free(object, OFF_TO_IDX(length), + nobjsize); } } shmfd->shm_size = length; |