git: c9e7aae6e6f9 - stable/13 - vm_pager_allocate(): override resulting object type
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Jan 2023 03:23:32 UTC
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=c9e7aae6e6f90f700516f0a67fc5cf264daaf610
commit c9e7aae6e6f90f700516f0a67fc5cf264daaf610
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-12-04 00:37:28 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-01-20 03:19:41 +0000
vm_pager_allocate(): override resulting object type
Tested by: pho
(cherry picked from commit cd086696c2cb6d23bac3bc749836d36a9280ae98)
---
sys/vm/vm_pager.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c
index ea5ce36f1963..cff8f5f9bdc3 100644
--- a/sys/vm/vm_pager.c
+++ b/sys/vm/vm_pager.c
@@ -250,9 +250,14 @@ vm_object_t
vm_pager_allocate(objtype_t type, void *handle, vm_ooffset_t size,
vm_prot_t prot, vm_ooffset_t off, struct ucred *cred)
{
+ vm_object_t object;
+
MPASS(type < nitems(pagertab));
- return ((*pagertab[type]->pgo_alloc)(handle, size, prot, off, cred));
+ object = (*pagertab[type]->pgo_alloc)(handle, size, prot, off, cred);
+ if (object != NULL)
+ object->type = type;
+ return (object);
}
/*