git: d9c31658df84 - main - kern_umtx.c: remove dead code
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 20 May 2026 13:31:38 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=d9c31658df8492a5666e799c2b267c425cb8f468
commit d9c31658df8492a5666e799c2b267c425cb8f468
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-05-20 00:49:09 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-05-20 13:31:30 +0000
kern_umtx.c: remove dead code
It was a placeholder for the access control for process-shared umtx
memory, which is not needed.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D57122
---
sys/kern/kern_umtx.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index 905ebd4f98ac..d9798fb2adb6 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -4624,17 +4624,12 @@ umtx_shm(struct thread *td, void *addr, u_int flags)
if ((flags & UMTX_SHM_DESTROY) != 0) {
umtx_shm_unref_reg(reg, true);
} else {
-#if 0
-#ifdef MAC
- error = mac_posixshm_check_open(td->td_ucred,
- reg->ushm_obj, FFLAGS(O_RDWR));
- if (error == 0)
-#endif
- error = shm_access(reg->ushm_obj, td->td_ucred,
- FFLAGS(O_RDWR));
- if (error == 0)
-#endif
- error = falloc_caps(td, &fp, &fd, O_CLOEXEC, NULL);
+ /*
+ * The current vmspace has the mapping, so it can be
+ * converted into shm filedescriptor for current
+ * thread.
+ */
+ error = falloc_caps(td, &fp, &fd, O_CLOEXEC, NULL);
if (error == 0) {
shm_hold(reg->ushm_obj);
finit(fp, FFLAGS(O_RDWR), DTYPE_SHM, reg->ushm_obj,