git: 1ef669ae413e - stable/14 - vm_object: add OBJ_SYSVSHM flag to indicate SysV shm backing object
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 15 Oct 2024 15:05:22 UTC
The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1ef669ae413eaf5517e9cbdd53ff2fe20bb3044c commit 1ef669ae413eaf5517e9cbdd53ff2fe20bb3044c Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2024-10-05 09:08:51 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-10-15 14:50:16 +0000 vm_object: add OBJ_SYSVSHM flag to indicate SysV shm backing object (cherry picked from commit f186252e0d6ef970a23c6af12ec34003df56055d) --- sys/kern/sysv_shm.c | 4 ++++ sys/vm/vm_object.h | 1 + 2 files changed, 5 insertions(+) diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index 90b95c7db8e7..4dbe77f19b07 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -742,6 +742,10 @@ shmget_allocate_segment(struct thread *td, key_t key, size_t size, int mode) return (ENOMEM); } + VM_OBJECT_WLOCK(shm_object); + vm_object_set_flag(shm_object, OBJ_SYSVSHM); + VM_OBJECT_WUNLOCK(shm_object); + shmseg->object = shm_object; shmseg->u.shm_perm.cuid = shmseg->u.shm_perm.uid = cred->cr_uid; shmseg->u.shm_perm.cgid = shmseg->u.shm_perm.gid = cred->cr_gid; diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index 0a6b8de6574c..c63a52260baf 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -203,6 +203,7 @@ struct vm_object { mapping flag */ #define OBJ_PAGERPRIV1 0x00004000 /* Pager private */ #define OBJ_PAGERPRIV2 0x00008000 /* Pager private */ +#define OBJ_SYSVSHM 0x00010000 /* SysV SHM */ /* * Helpers to perform conversion between vm_object page indexes and offsets.