summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-06-10 20:59:32 +0000
committerkib <kib@FreeBSD.org>2009-06-10 20:59:32 +0000
commite1cb2941d4424de90eb68716d6c4d95f4c0af0ba (patch)
tree9c12d3a92805f512ad054e2b8fa5618e0bd9cc71 /sys/kern/vfs_aio.c
parenta9806592196870f6605860715c0edac4deb6a55d (diff)
downloadFreeBSD-src-e1cb2941d4424de90eb68716d6c4d95f4c0af0ba.zip
FreeBSD-src-e1cb2941d4424de90eb68716d6c4d95f4c0af0ba.tar.gz
Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use
vnode interlock to protect the knote fields [1]. The locking assumes that shared vnode lock is held, thus we get exclusive access to knote either by exclusive vnode lock protection, or by shared vnode lock + vnode interlock. Do not use kl_locked() method to assert either lock ownership or the fact that curthread does not own the lock. For shared locks, ownership is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared lock not owned by curthread, causing false positives in kqueue subsystem assertions about knlist lock. Remove kl_locked method from knlist lock vector, and add two separate assertion methods kl_assert_locked and kl_assert_unlocked, that are supposed to use proper asserts. Change knlist_init accordingly. Add convenience function knlist_init_mtx to reduce number of arguments for typical knlist initialization. Submitted by: jhb [1] Noted by: jhb [2] Reviewed by: jhb Tested by: rnoland
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r--sys/kern/vfs_aio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index f22dea7..3f7596b 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -1485,7 +1485,7 @@ aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lj,
aiocbe = uma_zalloc(aiocb_zone, M_WAITOK | M_ZERO);
aiocbe->inputcharge = 0;
aiocbe->outputcharge = 0;
- knlist_init(&aiocbe->klist, AIO_MTX(ki), NULL, NULL, NULL);
+ knlist_init_mtx(&aiocbe->klist, AIO_MTX(ki));
error = ops->copyin(job, &aiocbe->uaiocb);
if (error) {
@@ -2107,7 +2107,7 @@ kern_lio_listio(struct thread *td, int mode, struct aiocb * const *uacb_list,
lj->lioj_flags = 0;
lj->lioj_count = 0;
lj->lioj_finished_count = 0;
- knlist_init(&lj->klist, AIO_MTX(ki), NULL, NULL, NULL);
+ knlist_init_mtx(&lj->klist, AIO_MTX(ki));
ksiginfo_init(&lj->lioj_ksi);
/*
OpenPOWER on IntegriCloud