From e384d8a89bd16982dbaf6f736f7a720c50fb9158 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 13 Apr 2008 21:08:34 +0000 Subject: [PATCH] Initialize the vm object's flags to include OBJ_NOSPLIT, just like the vm objects that are used by System V shared memory segments. --- sys/kern/uipc_shm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/kern/uipc_shm.c b/sys/kern/uipc_shm.c index 0154a407618..899896b27e3 100644 --- a/sys/kern/uipc_shm.c +++ b/sys/kern/uipc_shm.c @@ -319,6 +319,10 @@ shm_alloc(struct ucred *ucred, mode_t mode) shmfd->shm_object = vm_pager_allocate(OBJT_DEFAULT, NULL, shmfd->shm_size, VM_PROT_DEFAULT, 0); KASSERT(shmfd->shm_object != NULL, ("shm_create: vm_pager_allocate")); + VM_OBJECT_LOCK(shmfd->shm_object); + vm_object_clear_flag(shmfd->shm_object, OBJ_ONEMAPPING); + vm_object_set_flag(shmfd->shm_object, OBJ_NOSPLIT); + VM_OBJECT_UNLOCK(shmfd->shm_object); vfs_timestamp(&shmfd->shm_birthtime); shmfd->shm_atime = shmfd->shm_mtime = shmfd->shm_ctime = shmfd->shm_birthtime;