* add a knote to a knlist */
| 2299 | * add a knote to a knlist |
| 2300 | */ |
| 2301 | void |
| 2302 | knlist_add(struct knlist *knl, struct knote *kn, int islocked) |
| 2303 | { |
| 2304 | |
| 2305 | KNL_ASSERT_LOCK(knl, islocked); |
| 2306 | KQ_NOTOWNED(kn->kn_kq); |
| 2307 | KASSERT(kn_in_flux(kn), ("knote %p not in flux", kn)); |
| 2308 | KASSERT((kn->kn_status & KN_DETACHED) != 0, |
| 2309 | ("knote %p was not detached", kn)); |
| 2310 | if (!islocked) |
| 2311 | knl->kl_lock(knl->kl_lockarg); |
| 2312 | SLIST_INSERT_HEAD(&knl->kl_list, kn, kn_selnext); |
| 2313 | if (!islocked) |
| 2314 | knl->kl_unlock(knl->kl_lockarg); |
| 2315 | KQ_LOCK(kn->kn_kq); |
| 2316 | kn->kn_knlist = knl; |
| 2317 | kn->kn_status &= ~KN_DETACHED; |
| 2318 | KQ_UNLOCK(kn->kn_kq); |
| 2319 | } |
| 2320 | |
| 2321 | static void |
| 2322 | knlist_remove_kq(struct knlist *knl, struct knote *kn, int knlislocked, |
no test coverage detected