From nobody Mon Oct 07 08:25:00 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XMXJY28kkz5XWbM; Mon, 07 Oct 2024 08:25:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XMXJX4kHnz4sNC; Mon, 7 Oct 2024 08:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728289500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xmh5N9BIPhj+sp2cUIH0muiOUkLMuwyj/aWagZIDK9E=; b=v4KFJxm6e+gDttRTsjJukJtqxmmtwIoHn3xGwNoNTFIzU3uNow41OlopdNnNwZiWayXtqL NgsHUci3Qdrfg2onK/+AfmLF4hTOTu7+1lGPTw8DswaHzkitELGfpqwiPQz+WkFWHsqZm2 HcEWa1DEsowkVP0l/0JiQSPcg1KNHWET61Nhz6ghWP2OLK+nBq51eUYeauBiTZr7KcbQKK Gw7FBPvJXRZG27UrpXiBIngvLPnPjnSjG328312bSIJy0cqKDg0tSl0sfx4gNF4qBaZCjZ ubl6WtVfxQACHiA+k0FwMHx3+cNVVcPBoZLgSCi8gZ057mK6A8EAeXaFt1GAEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728289500; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Xmh5N9BIPhj+sp2cUIH0muiOUkLMuwyj/aWagZIDK9E=; b=XwHdwWzqfhIu7MYo5ZjY87oec6nSf3i1PPnpQZpGqLDG6SoFN9Ktf2l9ub28wfPAPD7hYc NQZIy7RDcHHg3p3TK5dMix6/XiOlQThA1HcY1r5jVTmgRR4812WogrlfcoIHfVnAgJIouB mtYcJ0ChUMU3zKZtGrwzR0eLlbQok1/ALuTuufEgAhtt6vMBVF8V+ieTsQDkObic8ntxoy BFcNMYSewRfki2eG2xGx09FisD6o591+7D3yd00LyL5WJ5Azp0v69U5TGKY9F/qv/33shj TSf+WOIVwNKjSGsCZbq9JrgNYnT0fogh/OVDSY3kpRMg10ITJ9MUosiTmMoaPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728289500; a=rsa-sha256; cv=none; b=bN7pw8wxZw6aWEfpwfvLeDZk/TZVZGYPJThcuER8xbTZ0IsyoTu8hajDduPX33ueoUYODi Yq7sBtTnzlFoWd6IeJ2CVlq65+MpC3jM8Z39iXAg7w2a17JxYPAZOu7stgOvYq2QVzsvNb evvlIf5+Sr7qcenFzDmTbtbye3CYaOoHrNBORSyHDRF5dC5Ku4LTSylcP3AdcwOtShg2OU 40g06K7A6oAtEnVWvVpS8WuDrFuR2l0It9AkRQE9QBSUZeM2rWIT3A49FwECPlASkIwOgb PpcPP6U/mQ4RwymP0bh2GFHACML7ESE135tNZelJD3J8e1RXc6O4Sp27bWBmZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XMXJX2sSxzdmd; Mon, 7 Oct 2024 08:25:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4978P0np011838; Mon, 7 Oct 2024 08:25:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4978P0CO011835; Mon, 7 Oct 2024 08:25:00 GMT (envelope-from git) Date: Mon, 7 Oct 2024 08:25:00 GMT Message-Id: <202410070825.4978P0CO011835@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f186252e0d6e - main - vm_object: add OBJ_SYSVSHM flag to indicate SysV shm backing object List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f186252e0d6ef970a23c6af12ec34003df56055d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f186252e0d6ef970a23c6af12ec34003df56055d commit f186252e0d6ef970a23c6af12ec34003df56055d Author: Konstantin Belousov AuthorDate: 2024-10-05 09:08:51 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-07 08:22:12 +0000 vm_object: add OBJ_SYSVSHM flag to indicate SysV shm backing object Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46959 --- 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 3eaab1282fa6..73284fddd2a6 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -201,6 +201,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.