From: Jonathan Gray Subject: remove vop_generic_kqfilter() To: tech@openbsd.org Date: Thu, 4 Jul 2024 08:51:21 +1000 unused diff --git sys/kern/vfs_default.c sys/kern/vfs_default.c index 2be006944b1..2f56929b748 100644 --- sys/kern/vfs_default.c +++ sys/kern/vfs_default.c @@ -42,12 +42,8 @@ #include #include #include -#include #include -int filt_generic_readwrite(struct knote *, long); -void filt_generic_detach(struct knote *); - /* * Eliminate all activity associated with the requested vnode * and with all vnodes aliased to the requested vnode. @@ -167,31 +163,6 @@ vop_generic_abortop(void *v) return (0); } -const struct filterops generic_filtops = { - .f_flags = FILTEROP_ISFD, - .f_attach = NULL, - .f_detach = filt_generic_detach, - .f_event = filt_generic_readwrite, -}; - -int -vop_generic_kqfilter(void *v) -{ - struct vop_kqfilter_args *ap = v; - struct knote *kn = ap->a_kn; - - switch (kn->kn_filter) { - case EVFILT_READ: - case EVFILT_WRITE: - kn->kn_fop = &generic_filtops; - break; - default: - return (EINVAL); - } - - return (0); -} - /* Trivial lookup routine that always fails. */ int vop_generic_lookup(void *v) @@ -201,25 +172,3 @@ vop_generic_lookup(void *v) *ap->a_vpp = NULL; return (ENOTDIR); } - -void -filt_generic_detach(struct knote *kn) -{ -} - -int -filt_generic_readwrite(struct knote *kn, long hint) -{ - /* - * filesystem is gone, so set the EOF flag and schedule - * the knote for deletion. - */ - if (hint == NOTE_REVOKE) { - kn->kn_flags |= (EV_EOF | EV_ONESHOT); - return (1); - } - - kn->kn_data = 0; - - return (1); -} diff --git sys/sys/vnode.h sys/sys/vnode.h index d06901f8d85..781cad3ad3d 100644 --- sys/sys/vnode.h +++ sys/sys/vnode.h @@ -619,7 +619,6 @@ int vop_generic_badop(void *); int vop_generic_bmap(void *); int vop_generic_bwrite(void *); int vop_generic_revoke(void *); -int vop_generic_kqfilter(void *); int vop_generic_lookup(void *); /* vfs_vnops.c */