Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi Use seltrue_filtops rather than rolling our o...



details:   https://anonhg.NetBSD.org/src/rev/6b8374b8cd3a
branches:  trunk
changeset: 1023795:6b8374b8cd3a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Sep 26 14:57:19 2021 +0000

description:
Use seltrue_filtops rather than rolling our own with filt_seltrue.

diffstat:

 sys/dev/scsipi/ch.c |  19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diffs (56 lines):

diff -r 380d3d87117d -r 6b8374b8cd3a sys/dev/scsipi/ch.c
--- a/sys/dev/scsipi/ch.c       Sun Sep 26 14:56:36 2021 +0000
+++ b/sys/dev/scsipi/ch.c       Sun Sep 26 14:57:19 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ch.c,v 1.94 2021/09/26 01:16:09 thorpej Exp $  */
+/*     $NetBSD: ch.c,v 1.95 2021/09/26 14:57:19 thorpej Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ch.c,v 1.94 2021/09/26 01:16:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ch.c,v 1.95 2021/09/26 14:57:19 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -494,13 +494,6 @@
        .f_event = filt_chread,
 };
 
-static const struct filterops chwrite_filtops = {
-       .f_flags = FILTEROP_ISFD,
-       .f_attach = NULL,
-       .f_detach = filt_chdetach,
-       .f_event = filt_seltrue,
-};
-
 static int
 chkqfilter(dev_t dev, struct knote *kn)
 {
@@ -509,20 +502,18 @@
        switch (kn->kn_filter) {
        case EVFILT_READ:
                kn->kn_fop = &chread_filtops;
+               kn->kn_hook = sc;
+               selrecord_knote(&sc->sc_selq, kn);
                break;
 
        case EVFILT_WRITE:
-               kn->kn_fop = &chwrite_filtops;
+               kn->kn_fop = &seltrue_filtops;
                break;
 
        default:
                return (EINVAL);
        }
 
-       kn->kn_hook = sc;
-
-       selrecord_knote(&sc->sc_selq, kn);
-
        return (0);
 }
 



Home | Main Index | Thread Index | Old Index