From 9d52823bf1dfac237e58b5208299aaa5e2df42e9 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sun, 6 Oct 2024 13:07:31 +0000 Subject: [PATCH] vm_object: Widen the flags field Take advantage of a nearby 2-byte hole to avoid growing the struct. This way, only the offsets of "flags" and "pg_color" change. Bump __FreeBSD_version since some out-of-tree kernel modules may access these fields, though I haven't found any examples so far. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D35905 --- sys/sys/param.h | 2 +- sys/vm/vm_object.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index 3d772d551ff..8af2f9594bc 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -73,7 +73,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500024 +#define __FreeBSD_version 1500025 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index 9155d9cd6d6..3274f59f958 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -108,8 +108,8 @@ struct vm_object { int shadow_count; /* how many objects that this is a shadow for */ vm_memattr_t memattr; /* default memory attribute for pages */ objtype_t type; /* type of pager */ - u_short flags; /* see below */ u_short pg_color; /* (c) color of first page in obj */ + u_int flags; /* see below */ blockcount_t paging_in_progress; /* (a) Paging (in or out) so don't collapse or destroy */ blockcount_t busy; /* (a) object is busy, disallow page busy. */ int resident_page_count; /* number of resident pages */