From eac23cf75a6a6757fa05e79e75b8895f7e2ca725 Mon Sep 17 00:00:00 2001 From: alc Date: Sun, 13 Apr 2003 19:36:18 +0000 Subject: [PATCH] Lock some manipulations of the vm object's flags. --- sys/kern/sysv_shm.c | 4 ++-- sys/vm/vm_meter.c | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index d3fa3230ac56..ec7033746579 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -657,10 +657,10 @@ shmget_allocate_segment(td, uap, mode) shm_handle->shm_object = vm_pager_allocate(OBJT_SWAP, 0, size, VM_PROT_DEFAULT, 0); } - vm_object_lock(shm_handle->shm_object); + VM_OBJECT_LOCK(shm_handle->shm_object); vm_object_clear_flag(shm_handle->shm_object, OBJ_ONEMAPPING); vm_object_set_flag(shm_handle->shm_object, OBJ_NOSPLIT); - vm_object_unlock(shm_handle->shm_object); + VM_OBJECT_UNLOCK(shm_handle->shm_object); shmseg->shm_internal = shm_handle; shmseg->shm_perm.cuid = shmseg->shm_perm.uid = cred->cr_uid; diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index ae7850a54e37..c988ca8bddd6 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -98,9 +98,9 @@ vmtotal(SYSCTL_HANDLER_ARGS) GIANT_REQUIRED; mtx_lock(&vm_object_list_mtx); TAILQ_FOREACH(object, &vm_object_list, object_list) { - vm_object_lock(object); + VM_OBJECT_LOCK(object); vm_object_clear_flag(object, OBJ_ACTIVE); - vm_object_unlock(object); + VM_OBJECT_UNLOCK(object); } mtx_unlock(&vm_object_list_mtx); /* @@ -159,10 +159,10 @@ vmtotal(SYSCTL_HANDLER_ARGS) if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) || (object = entry->object.vm_object) == NULL) continue; - vm_object_lock(object); + VM_OBJECT_LOCK(object); vm_object_set_flag(object, OBJ_ACTIVE); paging |= object->paging_in_progress; - vm_object_unlock(object); + VM_OBJECT_UNLOCK(object); } vm_map_unlock_read(map); if (paging) @@ -174,12 +174,12 @@ vmtotal(SYSCTL_HANDLER_ARGS) */ mtx_lock(&vm_object_list_mtx); TAILQ_FOREACH(object, &vm_object_list, object_list) { - vm_object_lock(object); + VM_OBJECT_LOCK(object); /* * devices, like /dev/mem, will badly skew our totals */ if (object->type == OBJT_DEVICE) { - vm_object_unlock(object); + VM_OBJECT_UNLOCK(object); continue; } totalp->t_vm += object->size; @@ -197,7 +197,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) totalp->t_armshr += object->resident_page_count; } } - vm_object_unlock(object); + VM_OBJECT_UNLOCK(object); } mtx_unlock(&vm_object_list_mtx); totalp->t_free = cnt.v_free_count + cnt.v_cache_count;