From b7762f892ec941fe975a9c62b57a256a59f175fb Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Thu, 28 May 2020 07:17:51 +0000 Subject: File allocation in socket(2) & socketpair(2) no longer need the KERNEL_LOCK(). Bring the two syscalls in sync with recent MP changes in the file layer. Inconsistency pointed by haesbaert@. ok anton@, visa@ --- sys/kern/uipc_syscalls.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index e3661b5f16c..b898bab546e 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_syscalls.c,v 1.184 2020/01/15 13:17:35 mpi Exp $ */ +/* $OpenBSD: uipc_syscalls.c,v 1.185 2020/05/28 07:17:50 mpi Exp $ */ /* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */ /* @@ -97,7 +97,6 @@ sys_socket(struct proc *p, void *v, register_t *retval) if (error) return (error); - KERNEL_LOCK(); fdplock(fdp); error = falloc(p, &fp, &fd); if (error) { @@ -114,7 +113,6 @@ sys_socket(struct proc *p, void *v, register_t *retval) FRELE(fp, p); *retval = fd; } - KERNEL_UNLOCK(); return (error); } @@ -450,7 +448,6 @@ sys_socketpair(struct proc *p, void *v, register_t *retval) if (error != 0) goto free2; } - KERNEL_LOCK(); fdplock(fdp); if ((error = falloc(p, &fp1, &sv[0])) != 0) goto free3; @@ -475,7 +472,6 @@ sys_socketpair(struct proc *p, void *v, register_t *retval) fdpunlock(fdp); FRELE(fp1, p); FRELE(fp2, p); - KERNEL_UNLOCK(); return (0); } fdremove(fdp, sv[1]); @@ -487,7 +483,6 @@ free4: so1 = NULL; free3: fdpunlock(fdp); - KERNEL_UNLOCK(); free2: if (so2 != NULL) (void)soclose(so2, 0); -- cgit v1.2.3