sys/vm: remove several other uses of OBJT_SWAP_TMPFS

Mostly in cases where OBJ_SWAP flag works as well, or by reversing the
condition so that object types can be listed.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D30168
This commit is contained in:
Konstantin Belousov 2021-05-07 21:21:22 +03:00
parent 3e7a11ca21
commit 7079449b0b
2 changed files with 5 additions and 10 deletions

View File

@ -669,7 +669,8 @@ vm_object_deallocate(vm_object_t object)
umtx_shm_object_terminated(object);
temp = object->backing_object;
if (temp != NULL) {
KASSERT(object->type != OBJT_SWAP_TMPFS,
KASSERT(object->type == OBJT_DEFAULT ||
object->type == OBJT_SWAP,
("shadowed tmpfs v_object 2 %p", object));
vm_object_backing_remove(object);
}
@ -950,7 +951,7 @@ vm_object_terminate(vm_object_t object)
#endif
KASSERT(object->cred == NULL || object->type == OBJT_DEFAULT ||
object->type == OBJT_SWAP || object->type == OBJT_SWAP_TMPFS,
(object->flags & OBJ_SWAP) != 0,
("%s: non-swap obj %p has cred", __func__, object));
/*

View File

@ -1887,15 +1887,9 @@ vm_pageout_oom_pagecount(struct vmspace *vmspace)
if ((entry->eflags & MAP_ENTRY_NEEDS_COPY) != 0 &&
obj->ref_count != 1)
continue;
switch (obj->type) {
case OBJT_DEFAULT:
case OBJT_SWAP:
case OBJT_SWAP_TMPFS:
case OBJT_PHYS:
case OBJT_VNODE:
if (obj->type == OBJT_DEFAULT || obj->type == OBJT_PHYS ||
obj->type == OBJT_VNODE || (obj->flags & OBJ_SWAP) != 0)
res += obj->resident_page_count;
break;
}
}
return (res);
}