diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2019-12-07 13:11:05 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2019-12-07 13:11:05 +0000 |
commit | 160dc4c7cfdebacb584efa4204e64363666ecd5d (patch) | |
tree | cdb91d641ab20f896e7b965976b6f6abb217300a /sys/kern/kern_event.c | |
parent | 74ba0c2905f081474614f171f0dea8c9fa605352 (diff) |
Combine macro KNOTE_ACTIVATE() with function knote_activate()
to make the code clearer.
OK claudio@ mpi@
Diffstat (limited to 'sys/kern/kern_event.c')
-rw-r--r-- | sys/kern/kern_event.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 62fca7f9e98..9a2251c10e3 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.106 2019/07/03 14:32:02 visa Exp $ */ +/* $OpenBSD: kern_event.c,v 1.107 2019/12/07 13:11:04 visa Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -111,12 +111,6 @@ struct pool kqueue_pool; int kq_ntimeouts = 0; int kq_timeoutmax = (4 * 1024); -#define KNOTE_ACTIVATE(kn) do { \ - kn->kn_status |= KN_ACTIVE; \ - if ((kn->kn_status & (KN_QUEUED | KN_DISABLED)) == 0) \ - knote_enqueue(kn); \ -} while(0) - #define KN_HASH(val, mask) (((val) ^ (val >> 8)) & (mask)) extern struct filterops sig_filtops; @@ -346,7 +340,7 @@ filt_timerexpire(void *knx) struct knote *kn = knx; kn->kn_data++; - KNOTE_ACTIVATE(kn); + knote_activate(kn); if ((kn->kn_flags & EV_ONESHOT) == 0) filt_timer_timeout_add(kn); @@ -662,7 +656,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, struct proc *p) s = splhigh(); if (kn->kn_fop->f_event(kn, 0)) - KNOTE_ACTIVATE(kn); + knote_activate(kn); splx(s); } else if (kev->flags & EV_DELETE) { @@ -924,7 +918,9 @@ kqueue_wakeup(struct kqueue *kq) void knote_activate(struct knote *kn) { - KNOTE_ACTIVATE(kn); + kn->kn_status |= KN_ACTIVE; + if ((kn->kn_status & (KN_QUEUED | KN_DISABLED)) == 0) + knote_enqueue(kn); } /* @@ -937,7 +933,7 @@ knote(struct klist *list, long hint) SLIST_FOREACH_SAFE(kn, list, kn_selnext, kn0) if (kn->kn_fop->f_event(kn, hint)) - KNOTE_ACTIVATE(kn); + knote_activate(kn); } /* |