summaryrefslogtreecommitdiffstats
path: root/sys/sys/vnode.h
diff options
context:
space:
mode:
authorssouhlal <ssouhlal@FreeBSD.org>2005-07-01 16:28:32 +0000
committerssouhlal <ssouhlal@FreeBSD.org>2005-07-01 16:28:32 +0000
commitefe31cd3da51660534ea5ec76bd1566fe89689d2 (patch)
treec6d52b2fecc4fcf947f2ca3718ee85b3a7aaeff0 /sys/sys/vnode.h
parent02c2d90f46ccecd39658689921e212d8dd15f796 (diff)
downloadFreeBSD-src-efe31cd3da51660534ea5ec76bd1566fe89689d2.zip
FreeBSD-src-efe31cd3da51660534ea5ec76bd1566fe89689d2.tar.gz
Fix the recent panics/LORs/hangs created by my kqueue commit by:
- Introducing the possibility of using locks different than mutexes for the knlist locking. In order to do this, we add three arguments to knlist_init() to specify the functions to use to lock, unlock and check if the lock is owned. If these arguments are NULL, we assume mtx_lock, mtx_unlock and mtx_owned, respectively. - Using the vnode lock for the knlist locking, when doing kqueue operations on a vnode. This way, we don't have to lock the vnode while holding a mutex, in filt_vfsread. Reviewed by: jmg Approved by: re (scottl), scottl (mentor override) Pointyhat to: ssouhlal Will be happy: everyone
Diffstat (limited to 'sys/sys/vnode.h')
-rw-r--r--sys/sys/vnode.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index b201f6d..2c9fd30 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -231,8 +231,8 @@ struct xvnode {
if (!VN_KNLIST_EMPTY(vp)) \
KNOTE(&vp->v_pollinfo->vpi_selinfo.si_note, (b), (a)); \
} while (0)
-#define VN_KNOTE_LOCKED(vp, b) VN_KNOTE(vp, b, 1)
-#define VN_KNOTE_UNLOCKED(vp, b) VN_KNOTE(vp, b, 0)
+#define VN_KNOTE_UNLOCKED(vp, b) VN_KNOTE(vp, b, 0)
+#define VN_KNOTE_UNLOCKED(vp, b) VN_KNOTE(vp, b, 0)
/*
* Vnode flags.
@@ -702,7 +702,7 @@ void vop_unlock_pre(void *a);
#define VOP_WRITE_POST(ap, ret) \
noffset = (ap)->a_uio->uio_offset; \
if (noffset > ooffset && !VN_KNLIST_EMPTY((ap)->a_vp)) { \
- VFS_SEND_KNOTE((ap)->a_vp, NOTE_WRITE \
+ VFS_KNOTE_LOCKED((ap)->a_vp, NOTE_WRITE \
| (noffset > osize ? NOTE_EXTEND : 0)); \
}
OpenPOWER on IntegriCloud