summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_event.c
diff options
context:
space:
mode:
authorambrisko <ambrisko@FreeBSD.org>2005-10-12 17:51:31 +0000
committerambrisko <ambrisko@FreeBSD.org>2005-10-12 17:51:31 +0000
commite3a46811b797130bb11edec29755641528791d6b (patch)
tree75edf3632319de1bc0b81f2f6e11dddc75311bef /sys/kern/kern_event.c
parentcc00d5c930cf41bb127fca3f4ec149a43a597024 (diff)
downloadFreeBSD-src-e3a46811b797130bb11edec29755641528791d6b.zip
FreeBSD-src-e3a46811b797130bb11edec29755641528791d6b.tar.gz
Add in kqueue support to LIO event notification and fix how it handled
notifications when LIO operations completed. These were the problems with LIO event complete notification: - Move all LIO/AIO event notification into one general function so we don't have bugs in different data paths. This unification got rid of several notification bugs one of which if kqueue was used a SIGILL could get sent to the process. - Change the LIO event accounting to count all AIO request that could have been split across the fast path and daemon mode. The prior accounting only kept track of AIO op's in that mode and not the entire list of operations. This could cause a bogus LIO event complete notification to occur when all of the fast path AIO op's completed and not the AIO op's that ended up queued for the daemon. Suggestions from: alc
Diffstat (limited to 'sys/kern/kern_event.c')
-rw-r--r--sys/kern/kern_event.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 3aa4550..3419101 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -247,6 +247,7 @@ static struct {
{ &timer_filtops }, /* EVFILT_TIMER */
{ &file_filtops }, /* EVFILT_NETDEV */
{ &fs_filtops }, /* EVFILT_FS */
+ { &null_filtops }, /* EVFILT_LIO */
};
/*
@@ -633,6 +634,8 @@ kern_kevent(struct thread *td, int fd, int nchanges, int nevents,
changes = keva;
for (i = 0; i < n; i++) {
kevp = &changes[i];
+ if (!kevp->filter)
+ continue;
kevp->flags &= ~EV_SYSFLAGS;
error = kqueue_register(kq, kevp, td, 1);
if (error) {
@@ -1828,7 +1831,7 @@ knote_attach(struct knote *kn, struct kqueue *kq)
}
/*
- * knote must already have been detatched using the f_detach method.
+ * knote must already have been detached using the f_detach method.
* no lock need to be held, it is assumed that the KN_INFLUX flag is set
* to prevent other removal.
*/
@@ -1850,7 +1853,8 @@ knote_drop(struct knote *kn, struct thread *td)
else
list = &kq->kq_knhash[KN_HASH(kn->kn_id, kq->kq_knhashmask)];
- SLIST_REMOVE(list, kn, knote, kn_link);
+ if (!SLIST_EMPTY(list))
+ SLIST_REMOVE(list, kn, knote, kn_link);
if (kn->kn_status & KN_QUEUED)
knote_dequeue(kn);
KQ_UNLOCK_FLUX(kq);
OpenPOWER on IntegriCloud