[Bug 225934] FIFOs lack kevent EVFILT_VNODE support

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Apr 28 15:15:23 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225934

--- Comment #2 from Jan Kokemüller <jan.kokemueller at gmail.com> ---
I've seen some places in sys_pipe.c where operations are delegated to vnode
operations (in the fifo case). Could something like the following work?


--- a/sys/kern/sys_pipe.c
+++ b/sys/kern/sys_pipe.c
@@ -1707,6 +1707,10 @@ pipe_kqfilter(struct file *fp, struct knote *kn)
                cpipe = PIPE_PEER(cpipe);
                break;
        default:
+               if (cpipe->pipe_state & PIPE_NAMED) {
+                       PIPE_UNLOCK(cpipe);
+                       return (vnops.fo_kqfilter(fp, kn));
+               }
                PIPE_UNLOCK(cpipe);
                return (EINVAL);
        }


Maybe vop_kqfilter/VOP_KQFILTER could be removed completely in favor of
vfs_kqfilter() as the only implementation? It looks like this mechanism was
only needed to forward *_kqfilter calls to fifo's vop_kqfilter. But now it's
done the other way around in a sense.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list