git: 7079449b0b56 - main - sys/vm: remove several other uses of OBJT_SWAP_TMPFS
Konstantin Belousov
kib at FreeBSD.org
Thu May 13 17:14:17 UTC 2021
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=7079449b0b56d13b4ae7b4039ac8eb7c45c03fb5
commit 7079449b0b56d13b4ae7b4039ac8eb7c45c03fb5
Author: Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-05-07 18:21:22 +0000
Commit: Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-05-13 17:10:35 +0000
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
---
sys/vm/vm_object.c | 5 +++--
sys/vm/vm_pageout.c | 10 ++--------
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 1aa05093f93a..8cb4c0006c59 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -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));
/*
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 521fc4ce95f2..216e76359631 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -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);
}
More information about the dev-commits-src-main
mailing list