Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 May 2021 09:46:40 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: bf9b8d2ae09a - stable/13 - sys/vm: remove several other uses of OBJT_SWAP_TMPFS
Message-ID:  <202105220946.14M9ke1m012659@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=bf9b8d2ae09a347a9fc98d3eda6558314ba9f9ec

commit bf9b8d2ae09a347a9fc98d3eda6558314ba9f9ec
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-05-07 18:21:22 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-05-22 09:38:30 +0000

    sys/vm: remove several other uses of OBJT_SWAP_TMPFS
    
    (cherry picked from commit 7079449b0b56d13b4ae7b4039ac8eb7c45c03fb5)
---
 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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105220946.14M9ke1m012659>