summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_kq.c
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2020-12-25 12:59:54 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2020-12-25 12:59:54 +0000
commit0ddae2e43bde351e699797b713fdfd0c4d71688b (patch)
tree5c305222f703a8c48618339303894fe5bf0e271e /sys/nfs/nfs_kq.c
parentd5d6ba970dd241df83e52a3f686a5b3c47e2b215 (diff)
Refactor klist insertion and removal
Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
Diffstat (limited to 'sys/nfs/nfs_kq.c')
-rw-r--r--sys/nfs/nfs_kq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/nfs/nfs_kq.c b/sys/nfs/nfs_kq.c
index 487048a4c56..fcd826a9889 100644
--- a/sys/nfs/nfs_kq.c
+++ b/sys/nfs/nfs_kq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_kq.c,v 1.32 2020/06/11 09:18:43 mpi Exp $ */
+/* $OpenBSD: nfs_kq.c,v 1.33 2020/12/25 12:59:53 visa Exp $ */
/* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */
/*-
@@ -186,7 +186,7 @@ filt_nfsdetach(struct knote *kn)
{
struct vnode *vp = (struct vnode *)kn->kn_hook;
- klist_remove(&vp->v_selectinfo.si_note, kn);
+ klist_remove_locked(&vp->v_selectinfo.si_note, kn);
/* Remove the vnode from watch list */
if ((kn->kn_flags & __EV_POLL) == 0)
@@ -343,7 +343,7 @@ nfs_kqfilter(void *v)
return (error);
}
- klist_insert(&vp->v_selectinfo.si_note, kn);
+ klist_insert_locked(&vp->v_selectinfo.si_note, kn);
return (0);
}