Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/uipc_shm.c
Show First 20 Lines • Show All 534 Lines • ▼ Show 20 Lines | retry: | ||||
KASSERT(vm_page_all_valid(m), | KASSERT(vm_page_all_valid(m), | ||||
("shm_dotruncate: page %p is invalid", m)); | ("shm_dotruncate: page %p is invalid", m)); | ||||
vm_page_set_dirty(m); | vm_page_set_dirty(m); | ||||
vm_page_xunbusy(m); | vm_page_xunbusy(m); | ||||
} | } | ||||
} | } | ||||
delta = IDX_TO_OFF(object->size - nobjsize); | delta = IDX_TO_OFF(object->size - nobjsize); | ||||
/* Toss in memory pages. */ | |||||
if (nobjsize < object->size) | if (nobjsize < object->size) | ||||
vm_object_page_remove(object, nobjsize, object->size, | vm_object_page_remove(object, nobjsize, object->size, | ||||
0); | 0); | ||||
/* Toss pages from swap. */ | |||||
if (object->type == OBJT_SWAP) | |||||
swap_pager_freespace(object, nobjsize, delta); | |||||
/* Free the swap accounted for shm */ | /* Free the swap accounted for shm */ | ||||
swap_release_by_cred(delta, object->cred); | swap_release_by_cred(delta, object->cred); | ||||
object->charge -= delta; | object->charge -= delta; | ||||
} else { | } else { | ||||
if ((shmfd->shm_seals & F_SEAL_GROW) != 0) | if ((shmfd->shm_seals & F_SEAL_GROW) != 0) | ||||
return (EPERM); | return (EPERM); | ||||
▲ Show 20 Lines • Show All 1,004 Lines • Show Last 20 Lines |