From 801555ec138f7e8ee6b92513b49b8d185acf0954 Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Mon, 7 May 2018 15:51:54 +0000 Subject: Grab the KERNEL_LOCK() for unix/routing/pfkey sockets in solock()... ...and release it in sounlock(). This will allows us to progressively remove the KERNEL_LOCK() in syscalls. ok visa@ some time ago --- sys/kern/uipc_socket2.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sys/kern/uipc_socket2.c') diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index ec2b099cace..8bb11fd97a1 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.92 2018/04/08 18:57:39 guenther Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.93 2018/05/07 15:51:53 mpi Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -281,8 +281,10 @@ solock(struct socket *so) (so->so_proto->pr_domain->dom_family != PF_ROUTE) && (so->so_proto->pr_domain->dom_family != PF_KEY)) NET_LOCK(); - else + else { + KERNEL_LOCK(); s = -42; + } return (s); } @@ -292,6 +294,9 @@ sounlock(int s) { if (s != -42) NET_UNLOCK(); + else { + KERNEL_UNLOCK(); + } } void -- cgit v1.2.3