Module Name: src Committed By: thorpej Date: Fri Dec 18 02:55:32 UTC 2020
Modified Files: src/sys/dev/pci: oboe.c vio9p.c Log Message: Use sel{record,remove}_knote(). To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/dev/pci/oboe.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/vio9p.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/oboe.c diff -u src/sys/dev/pci/oboe.c:1.46 src/sys/dev/pci/oboe.c:1.47 --- src/sys/dev/pci/oboe.c:1.46 Sun Dec 9 11:14:02 2018 +++ src/sys/dev/pci/oboe.c Fri Dec 18 02:55:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: oboe.c,v 1.46 2018/12/09 11:14:02 jdolecek Exp $ */ +/* $NetBSD: oboe.c,v 1.47 2020/12/18 02:55:32 thorpej Exp $ */ /* XXXXFVDL THIS DRIVER IS BROKEN FOR NON-i386 -- vtophys() usage */ @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.46 2018/12/09 11:14:02 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: oboe.c,v 1.47 2020/12/18 02:55:32 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -470,7 +470,7 @@ filt_oboerdetach(struct knote *kn) int s; s = splir(); - SLIST_REMOVE(&sc->sc_rsel.sel_klist, kn, knote, kn_selnext); + selremove_knote(&sc->sc_rsel, kn); splx(s); } @@ -490,7 +490,7 @@ filt_oboewdetach(struct knote *kn) int s; s = splir(); - SLIST_REMOVE(&sc->sc_wsel.sel_klist, kn, knote, kn_selnext); + selremove_knote(&sc->sc_wsel, kn); splx(s); } @@ -512,16 +512,16 @@ static int oboe_kqfilter(void *h, struct knote *kn) { struct oboe_softc *sc = h; - struct klist *klist; + struct selinfo *sip; int s; switch (kn->kn_filter) { case EVFILT_READ: - klist = &sc->sc_rsel.sel_klist; + sip = &sc->sc_rsel; kn->kn_fop = &oboeread_filtops; break; case EVFILT_WRITE: - klist = &sc->sc_wsel.sel_klist; + sip = &sc->sc_wsel; kn->kn_fop = &oboewrite_filtops; break; default: @@ -531,7 +531,7 @@ oboe_kqfilter(void *h, struct knote *kn) kn->kn_hook = sc; s = splir(); - SLIST_INSERT_HEAD(klist, kn, kn_selnext); + selrecord_knote(sip, kn); splx(s); return (0); Index: src/sys/dev/pci/vio9p.c diff -u src/sys/dev/pci/vio9p.c:1.1 src/sys/dev/pci/vio9p.c:1.2 --- src/sys/dev/pci/vio9p.c:1.1 Mon Oct 28 02:56:40 2019 +++ src/sys/dev/pci/vio9p.c Fri Dec 18 02:55:32 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vio9p.c,v 1.1 2019/10/28 02:56:40 ozaki-r Exp $ */ +/* $NetBSD: vio9p.c,v 1.2 2020/12/18 02:55:32 thorpej Exp $ */ /* * Copyright (c) 2019 Internet Initiative Japan, Inc. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vio9p.c,v 1.1 2019/10/28 02:56:40 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vio9p.c,v 1.2 2020/12/18 02:55:32 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -390,7 +390,7 @@ filt_vio9p_detach(struct knote *kn) struct vio9p_softc *sc = kn->kn_hook; mutex_enter(&sc->sc_lock); - SLIST_REMOVE(&sc->sc_sel.sel_klist, kn, knote, kn_selnext); + selremove_knote(&sc->sc_sel, kn); mutex_exit(&sc->sc_lock); } @@ -434,29 +434,25 @@ static int vio9p_kqfilter(struct file *fp, struct knote *kn) { struct vio9p_softc *sc = fp->f_data; - struct klist *klist; - mutex_enter(&sc->sc_lock); switch (kn->kn_filter) { case EVFILT_READ: - klist = &sc->sc_sel.sel_klist; kn->kn_fop = &vio9p_read_filtops; break; case EVFILT_WRITE: - klist = &sc->sc_sel.sel_klist; kn->kn_fop = &vio9p_write_filtops; break; default: - mutex_exit(&sc->sc_lock); log(LOG_ERR, "%s: kn_filter=%u\n", __func__, kn->kn_filter); return EINVAL; } kn->kn_hook = sc; - SLIST_INSERT_HEAD(klist, kn, kn_selnext); + mutex_enter(&sc->sc_lock); + selrecord_knote(&sc->sc_sel, kn); mutex_exit(&sc->sc_lock); return 0;