Source-Changes-HG archive

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

[src/kqueue]: src/sys/miscfs/specfs add spec_kqfilter()



details:   https://anonhg.NetBSD.org/src/rev/52791c1fb889
branches:  kqueue
changeset: 512367:52791c1fb889
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Jul 10 14:01:35 2001 +0000

description:
add spec_kqfilter()

diffstat:

 sys/miscfs/specfs/spec_vnops.c |  29 ++++++++++++++++++++++++++++-
 sys/miscfs/specfs/specdev.h    |   3 ++-
 2 files changed, 30 insertions(+), 2 deletions(-)

diffs (67 lines):

diff -r 194a52646b78 -r 52791c1fb889 sys/miscfs/specfs/spec_vnops.c
--- a/sys/miscfs/specfs/spec_vnops.c    Tue Jul 10 14:00:39 2001 +0000
+++ b/sys/miscfs/specfs/spec_vnops.c    Tue Jul 10 14:01:35 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec_vnops.c,v 1.54 2001/04/17 18:49:26 thorpej Exp $  */
+/*     $NetBSD: spec_vnops.c,v 1.54.2.1 2001/07/10 14:01:35 lukem Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -90,6 +90,7 @@
        { &vop_fcntl_desc, spec_fcntl },                /* fcntl */
        { &vop_ioctl_desc, spec_ioctl },                /* ioctl */
        { &vop_poll_desc, spec_poll },                  /* poll */
+       { &vop_kqfilter_desc, spec_kqfilter },          /* kqfilter */
        { &vop_revoke_desc, spec_revoke },              /* revoke */
        { &vop_mmap_desc, spec_mmap },                  /* mmap */
        { &vop_fsync_desc, spec_fsync },                /* fsync */
@@ -471,6 +472,32 @@
                return (genfs_poll(v));
        }
 }
+
+/* ARGSUSED */
+int
+spec_kqfilter(v)
+       void *v;
+{
+       struct vop_kqfilter_args /* {
+               struct vnode    *a_vp;
+               struct proc     *a_kn;
+       } */ *ap = v;
+       dev_t dev;
+
+       switch (ap->a_vp->v_type) {
+
+       case VCHR:
+               dev = ap->a_vp->v_rdev;
+               return (*cdevsw[major(dev)].d_kqfilter)(dev, ap->a_kn);
+       default:
+#if 1  /* XXXLUKEM; no genfs_kqfilter (yet) */
+               return (0);
+#else
+               return (genfs_kqfilter(v));
+#endif
+       }
+}
+
 /*
  * Synch buffers associated with a block device
  */
diff -r 194a52646b78 -r 52791c1fb889 sys/miscfs/specfs/specdev.h
--- a/sys/miscfs/specfs/specdev.h       Tue Jul 10 14:00:39 2001 +0000
+++ b/sys/miscfs/specfs/specdev.h       Tue Jul 10 14:01:35 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: specdev.h,v 1.19 1999/12/08 19:16:52 sommerfeld Exp $  */
+/*     $NetBSD: specdev.h,v 1.19.8.1 2001/07/10 14:01:36 lukem Exp $   */
 
 /*
  * Copyright (c) 1990, 1993
@@ -93,6 +93,7 @@
 #define spec_fcntl     genfs_fcntl
 int    spec_ioctl      __P((void *));
 int    spec_poll       __P((void *));
+int    spec_kqfilter   __P((void *));
 #define spec_revoke    genfs_revoke
 #define        spec_mmap       genfs_badop
 int    spec_fsync      __P((void *));



Home | Main Index | Thread Index | Old Index