aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2026-05-20 00:49:09 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-05-20 13:31:30 +0000
commitd9c31658df8492a5666e799c2b267c425cb8f468 (patch)
tree2f3fef5784fd6f1fa5f10a3db6db171e1912e664
parent9096a8b1c89c7e98df0d5a27cf1a5f4c6e8ddf19 (diff)
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
-rw-r--r--sys/kern/kern_umtx.c17
1 files 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,