summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2019-12-30 13:49:40 +0000
committerbluhm <bluhm@openbsd.org>2019-12-30 13:49:40 +0000
commit7d12ceab82a38eb9753aa6e475f832a084a63852 (patch)
tree33e4fb75475abe004d7df9887d8e667c0eb4a1b5
parentAdd ne(4) support on cbus(4). (diff)
downloadwireguard-openbsd-7d12ceab82a38eb9753aa6e475f832a084a63852.tar.xz
wireguard-openbsd-7d12ceab82a38eb9753aa6e475f832a084a63852.zip
In vcount() a safe loop over vnodes was commited to 4.4BSD in 1994.
This is not necessary as the loop is restarted after vgone(). Switch to SLIST_FOREACH without _SAFE. OK visa@
-rw-r--r--sys/kern/vfs_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 7806935464f..1edf218206f 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.296 2019/12/27 22:17:01 bluhm Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.297 2019/12/30 13:49:40 bluhm Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1214,14 +1214,14 @@ vdevgone(int maj, int minl, int minh, enum vtype type)
int
vcount(struct vnode *vp)
{
- struct vnode *vq, *vnext;
+ struct vnode *vq;
int count;
loop:
if ((vp->v_flag & VALIASED) == 0)
return (vp->v_usecount);
count = 0;
- SLIST_FOREACH_SAFE(vq, vp->v_hashchain, v_specnext, vnext) {
+ SLIST_FOREACH(vq, vp->v_hashchain, v_specnext) {
if (vq->v_rdev != vp->v_rdev || vq->v_type != vp->v_type)
continue;
/*