summaryrefslogtreecommitdiff
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2018-05-08 08:53:42 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2018-05-08 08:53:42 +0000
commitb1791167b5ee74c8d0c677267cc654141043b98e (patch)
treeea7e544444a36606c19021d74cd774a4baf31146 /sys/kern/kern_descrip.c
parentaa4de8ef02d6ac2bafdac9c2030aebd8acd0bc9b (diff)
Protect per-file counters and document which lock is used to protect
the other fields. Once we no longer have any [k] (kernel lock) protections, we'll be able to unlock almost all network related syscalls. Inputs from and ok bluhm@, visa@
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index c868f0aae4f..fc971435284 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_descrip.c,v 1.156 2018/05/02 02:24:56 visa Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.157 2018/05/08 08:53:41 mpi Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
@@ -957,6 +957,7 @@ restart:
*/
numfiles++;
fp = pool_get(&file_pool, PR_WAITOK|PR_ZERO);
+ mtx_init(&fp->f_mtx, IPL_NONE);
fp->f_iflags = FIF_LARVAL;
if ((fq = p->p_fd->fd_ofiles[0]) != NULL) {
LIST_INSERT_AFTER(fq, fp, f_list);