Page MenuHomeFreeBSD

D61608.1794912487.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61608.1794912487.diff

diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -3142,15 +3142,26 @@
KQ_UNLOCK(kq1);
}
+enum klist_which {
+ KLIST_FD,
+ KLIST_HASH,
+};
+
+static struct klist *
+kqueue_list(struct kqueue *kq, enum klist_which which, int i)
+{
+ return (which == KLIST_FD ? &kq->kq_knlist[i] : &kq->kq_knhash[i]);
+}
+
static void
-kqueue_fork_copy_list(struct klist *knlist, struct knote *marker,
+kqueue_fork_copy_list(enum klist_which which, int i, struct knote *marker,
struct kqueue *kq, struct kqueue *kq1, struct proc *p1,
struct filedesc *fdp)
{
struct knote *kn;
KQ_OWNED(kq);
- kn = SLIST_FIRST(knlist);
+ kn = SLIST_FIRST(kqueue_list(kq, which, i));
while (kn != NULL) {
MPASS(kn->kn_kq == kq);
if ((kn->kn_status & (KN_DETACHED | KN_MARKER)) != 0 ||
@@ -3166,7 +3177,7 @@
kn_leave_flux(kn);
kn = SLIST_NEXT(marker, kn_link);
/* XXXKIB switch kn_link to LIST? */
- SLIST_REMOVE(knlist, marker, knote, kn_link);
+ SLIST_REMOVE(kqueue_list(kq, which, i), marker, knote, kn_link);
}
}
@@ -3190,13 +3201,12 @@
KQ_LOCK(kq);
for (i = 0; i < kq->kq_knlistsize; i++) {
- kqueue_fork_copy_list(&kq->kq_knlist[i], &marker, kq, kq1,
- p1, fdp);
+ kqueue_fork_copy_list(KLIST_FD, i, &marker, kq, kq1, p1, fdp);
}
if (kq->kq_knhashmask != 0) {
for (i = 0; i <= kq->kq_knhashmask; i++) {
- kqueue_fork_copy_list(&kq->kq_knhash[i], &marker, kq,
- kq1, p1, fdp);
+ kqueue_fork_copy_list(KLIST_HASH, i, &marker, kq, kq1,
+ p1, fdp);
}
}
kqueue_release(kq, 1);

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 17, 10:48 AM (5 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41791464
Default Alt Text
D61608.1794912487.diff (1 KB)

Event Timeline