From 44956c9863dc03344b03bdf6a83acf4e743f8e50 Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Tue, 21 Jan 2003 08:56:16 +0000 Subject: Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. --- sys/vm/device_pager.c | 2 +- sys/vm/swap_pager.c | 2 +- sys/vm/uma.h | 2 +- sys/vm/uma_core.c | 12 ++++++------ sys/vm/vm_map.c | 6 +++--- sys/vm/vm_object.c | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) (limited to 'sys/vm') diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index e7acedcdbfb1..a0cf5283fba7 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -266,7 +266,7 @@ dev_pager_getfake(paddr) { vm_page_t m; - m = uma_zalloc(fakepg_zone, M_WAITOK); + m = uma_zalloc(fakepg_zone, 0); m->flags = PG_BUSY | PG_FICTITIOUS; m->valid = VM_PAGE_BITS_ALL; diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 0fb5d2203113..58568a2e0298 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -337,7 +337,7 @@ swap_pager_swap_init() */ for (n = 1; n < n2 / 8; n *= 2) ; - swhash = malloc(sizeof(struct swblock *) * n, M_VMPGDATA, M_WAITOK | M_ZERO); + swhash = malloc(sizeof(struct swblock *) * n, M_VMPGDATA, M_ZERO); swhash_mask = n - 1; } diff --git a/sys/vm/uma.h b/sys/vm/uma.h index 769d81af4d12..988b79f8867a 100644 --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -209,7 +209,7 @@ void uma_zdestroy(uma_zone_t zone); * * Returns: * A non null pointer to an initialized element from the zone is - * garanteed if the wait flag is M_WAITOK, otherwise a null pointer may be + * garanteed if the wait flag is not M_NOWAIT, otherwise null may be * returned if the zone is empty or the ctor failed. */ diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 044112de1768..ef43fc26bb3c 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -354,7 +354,7 @@ hash_alloc(struct uma_hash *hash) } else { alloc = sizeof(hash->uh_slab_hash[0]) * UMA_HASH_SIZE_INIT; hash->uh_slab_hash = uma_zalloc_internal(hashzone, NULL, - M_WAITOK); + 0); hash->uh_hashsize = UMA_HASH_SIZE_INIT; } if (hash->uh_slab_hash) { @@ -1300,7 +1300,7 @@ uma_zcreate(char *name, size_t size, uma_ctor ctor, uma_dtor dtor, args.align = align; args.flags = flags; - return (uma_zalloc_internal(zones, &args, M_WAITOK)); + return (uma_zalloc_internal(zones, &args, 0)); } /* See uma.h */ @@ -1326,7 +1326,7 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags) if (!(flags & M_NOWAIT)) { KASSERT(curthread->td_intr_nesting_level == 0, - ("malloc(M_WAITOK) in interrupt context")); + ("malloc without M_NOWAIT in interrupt context")); WITNESS_SLEEP(1, NULL); } @@ -1609,7 +1609,7 @@ done: * Arguments * zone The zone to alloc for. * udata The data to be passed to the constructor. - * flags M_WAITOK, M_NOWAIT, M_ZERO. + * flags M_NOWAIT, M_ZERO. * * Returns * NULL if there is no memory and M_NOWAIT is set @@ -1964,7 +1964,7 @@ uma_prealloc(uma_zone_t zone, int items) slabs++; while (slabs > 0) { - slab = slab_zalloc(zone, M_WAITOK); + slab = slab_zalloc(zone, 0); LIST_INSERT_HEAD(&zone->uz_free_slab, slab, us_link); slabs--; } @@ -2074,7 +2074,7 @@ sysctl_vm_zone(SYSCTL_HANDLER_ARGS) cnt++; mtx_unlock(&uma_mtx); MALLOC(tmpbuf, char *, (cnt == 0 ? 1 : cnt) * linesize, - M_TEMP, M_WAITOK); + M_TEMP, 0); len = snprintf(tmpbuf, linesize, "\nITEM SIZE LIMIT USED FREE REQUESTS\n\n"); if (cnt == 0) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index f1f5b5154bbe..6d52a80636fd 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -255,7 +255,7 @@ vmspace_alloc(min, max) struct vmspace *vm; GIANT_REQUIRED; - vm = uma_zalloc(vmspace_zone, M_WAITOK); + vm = uma_zalloc(vmspace_zone, 0); CTR1(KTR_VM, "vmspace_alloc: %p", vm); _vm_map_init(&vm->vm_map, min, max); pmap_pinit(vmspace_pmap(vm)); @@ -513,7 +513,7 @@ vm_map_create(pmap_t pmap, vm_offset_t min, vm_offset_t max) { vm_map_t result; - result = uma_zalloc(mapzone, M_WAITOK); + result = uma_zalloc(mapzone, 0); CTR1(KTR_VM, "vm_map_create: %p", result); _vm_map_init(result, min, max); result->pmap = pmap; @@ -572,7 +572,7 @@ vm_map_entry_create(vm_map_t map) if (map->system_map) new_entry = uma_zalloc(kmapentzone, M_NOWAIT); else - new_entry = uma_zalloc(mapentzone, M_WAITOK); + new_entry = uma_zalloc(mapentzone, 0); if (new_entry == NULL) panic("vm_map_entry_create: kernel resources exhausted"); return (new_entry); diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 1959cd3abebe..f00499f54a79 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -353,7 +353,7 @@ vm_object_allocate_wait(objtype_t type, vm_pindex_t size, int flags) vm_object_t vm_object_allocate(objtype_t type, vm_pindex_t size) { - return(vm_object_allocate_wait(type, size, M_WAITOK)); + return(vm_object_allocate_wait(type, size, 0)); } -- cgit v1.2.3