Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/miscfs/fifofs Use sel{record,remove}_knote().



details:   https://anonhg.NetBSD.org/src/rev/39bb5b78661c
branches:  trunk
changeset: 947901:39bb5b78661c
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Dec 19 21:54:42 2020 +0000

description:
Use sel{record,remove}_knote().

diffstat:

 sys/arch/macppc/dev/aed.c              |  11 ++++-------
 sys/arch/macppc/dev/apm.c              |  10 ++++------
 sys/external/bsd/drm2/drm/drm_cdevsw.c |   8 ++++----
 sys/miscfs/fifofs/fifo_vnops.c         |  18 +++++++++---------
 4 files changed, 21 insertions(+), 26 deletions(-)

diffs (191 lines):

diff -r ac761828e3cb -r 39bb5b78661c sys/arch/macppc/dev/aed.c
--- a/sys/arch/macppc/dev/aed.c Sat Dec 19 21:54:00 2020 +0000
+++ b/sys/arch/macppc/dev/aed.c Sat Dec 19 21:54:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aed.c,v 1.30 2017/10/25 08:12:37 maya Exp $    */
+/*     $NetBSD: aed.c,v 1.31 2020/12/19 21:54:42 thorpej Exp $ */
 
 /*
  * Copyright (C) 1994  Bradley A. Grantham
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.30 2017/10/25 08:12:37 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.31 2020/12/19 21:54:42 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -590,7 +590,7 @@
        int s;
 
        s = spladb();
-       SLIST_REMOVE(&aed_sc->sc_selinfo.sel_klist, kn, knote, kn_selnext);
+       selremove_knote(&aed_sc->sc_selinfo, kn);
        splx(s);
 }
 
@@ -619,17 +619,14 @@
 int
 aedkqfilter(dev_t dev, struct knote *kn)
 {
-       struct klist *klist;
        int s;
 
        switch (kn->kn_filter) {
        case EVFILT_READ:
-               klist = &aed_sc->sc_selinfo.sel_klist;
                kn->kn_fop = &aedread_filtops;
                break;
 
        case EVFILT_WRITE:
-               klist = &aed_sc->sc_selinfo.sel_klist;
                kn->kn_fop = &aed_seltrue_filtops;
                break;
 
@@ -640,7 +637,7 @@
        kn->kn_hook = NULL;
 
        s = spladb();
-       SLIST_INSERT_HEAD(klist, kn, kn_selnext);
+       selrecord_knote(&aed_sc->sc_selinfo, kn);
        splx(s);
 
        return (0);
diff -r ac761828e3cb -r 39bb5b78661c sys/arch/macppc/dev/apm.c
--- a/sys/arch/macppc/dev/apm.c Sat Dec 19 21:54:00 2020 +0000
+++ b/sys/arch/macppc/dev/apm.c Sat Dec 19 21:54:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: apm.c,v 1.28 2020/10/30 22:20:38 christos Exp $        */
+/*     $NetBSD: apm.c,v 1.29 2020/12/19 21:54:42 thorpej Exp $ */
 /*     $OpenBSD: apm.c,v 1.5 2002/06/07 07:13:59 miod Exp $    */
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.28 2020/10/30 22:20:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.29 2020/12/19 21:54:42 thorpej Exp $");
 
 #include "apm.h"
 
@@ -418,7 +418,7 @@
        struct apm_softc *sc = (struct apm_softc *)kn->kn_hook;
 
        APM_LOCK(sc);
-       SLIST_REMOVE(&sc->sc_rsel.sel_klist, kn, knote, kn_selnext);
+       selremove_knote(&sc->sc_rsel, kn);
        APM_UNLOCK(sc);
 }
 
@@ -442,11 +442,9 @@
 apmkqfilter(dev_t dev, struct knote *kn)
 {
        struct apm_softc *sc = device_lookup_private(&apm_cd,APMUNIT(dev));
-       struct klist *klist;
 
        switch (kn->kn_filter) {
        case EVFILT_READ:
-               klist = &sc->sc_rsel.sel_klist;
                kn->kn_fop = &apmread_filtops;
                break;
        default:
@@ -456,7 +454,7 @@
        kn->kn_hook = sc;
 
        APM_LOCK(sc);
-       SLIST_INSERT_HEAD(klist, kn, kn_selnext);
+       selrecord_knote(&sc->sc_rsel, kn);
        APM_UNLOCK(sc);
 
        return (0);
diff -r ac761828e3cb -r 39bb5b78661c sys/external/bsd/drm2/drm/drm_cdevsw.c
--- a/sys/external/bsd/drm2/drm/drm_cdevsw.c    Sat Dec 19 21:54:00 2020 +0000
+++ b/sys/external/bsd/drm2/drm/drm_cdevsw.c    Sat Dec 19 21:54:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drm_cdevsw.c,v 1.14 2019/04/16 10:00:04 mrg Exp $      */
+/*     $NetBSD: drm_cdevsw.c,v 1.15 2020/12/19 22:09:15 thorpej Exp $  */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_cdevsw.c,v 1.14 2019/04/16 10:00:04 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_cdevsw.c,v 1.15 2020/12/19 22:09:15 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -404,7 +404,7 @@
                kn->kn_fop = &drm_filtops;
                kn->kn_hook = file;
                spin_lock_irqsave(&dev->event_lock, irqflags);
-               SLIST_INSERT_HEAD(&file->event_selq.sel_klist, kn, kn_selnext);
+               selrecord_knote(&file->event_selq, kn);
                spin_unlock_irqrestore(&dev->event_lock, irqflags);
                return 0;
        case EVFILT_WRITE:
@@ -421,7 +421,7 @@
        unsigned long irqflags;
 
        spin_lock_irqsave(&dev->event_lock, irqflags);
-       SLIST_REMOVE(&file->event_selq.sel_klist, kn, knote, kn_selnext);
+       selremove_knote(&file->event_selq, kn);
        spin_unlock_irqrestore(&dev->event_lock, irqflags);
 }
 
diff -r ac761828e3cb -r 39bb5b78661c sys/miscfs/fifofs/fifo_vnops.c
--- a/sys/miscfs/fifofs/fifo_vnops.c    Sat Dec 19 21:54:00 2020 +0000
+++ b/sys/miscfs/fifofs/fifo_vnops.c    Sat Dec 19 21:54:42 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fifo_vnops.c,v 1.81 2020/06/27 17:29:19 christos Exp $ */
+/*     $NetBSD: fifo_vnops.c,v 1.82 2020/12/19 22:09:15 thorpej Exp $  */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fifo_vnops.c,v 1.81 2020/06/27 17:29:19 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fifo_vnops.c,v 1.82 2020/12/19 22:09:15 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -516,9 +516,9 @@
 
        so = (struct socket *)kn->kn_hook;
        solock(so);
-       SLIST_REMOVE(&so->so_rcv.sb_sel.sel_klist, kn, knote, kn_selnext);
-       if (SLIST_EMPTY(&so->so_rcv.sb_sel.sel_klist))
-               so->so_rcv.sb_flags &= ~SB_KNOTE;
+       selremove_knote(&so->so_rcv.sb_sel, kn);
+       if (SLIST_EMPTY(&so->so_rcv.sb_sel.sel_klist))  /* XXX select/kqueue */
+               so->so_rcv.sb_flags &= ~SB_KNOTE;       /* XXX internals */
        sounlock(so);
 }
 
@@ -551,9 +551,9 @@
 
        so = (struct socket *)kn->kn_hook;
        solock(so);
-       SLIST_REMOVE(&so->so_snd.sb_sel.sel_klist, kn, knote, kn_selnext);
-       if (SLIST_EMPTY(&so->so_snd.sb_sel.sel_klist))
-               so->so_snd.sb_flags &= ~SB_KNOTE;
+       selremove_knote(&so->so_snd.sb_sel, kn);
+       if (SLIST_EMPTY(&so->so_snd.sb_sel.sel_klist))  /* XXX select/kqueue */
+               so->so_snd.sb_flags &= ~SB_KNOTE;       /* XXX internals */
        sounlock(so);
 }
 
@@ -621,7 +621,7 @@
        ap->a_kn->kn_hook = so;
 
        solock(so);
-       SLIST_INSERT_HEAD(&sb->sb_sel.sel_klist, ap->a_kn, kn_selnext);
+       selrecord_knote(&sb->sb_sel, ap->a_kn);
        sb->sb_flags |= SB_KNOTE;
        sounlock(so);
 



Home | Main Index | Thread Index | Old Index