diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c index f1080f05e888..428c97b34fee 100644 --- a/sys/cam/scsi/scsi_target.c +++ b/sys/cam/scsi/scsi_target.c @@ -103,8 +103,11 @@ static d_poll_t targpoll; static d_kqfilter_t targkqfilter; static void targreadfiltdetach(struct knote *kn); static int targreadfilt(struct knote *kn, long hint); -static struct filterops targread_filtops = - { 1, NULL, targreadfiltdetach, targreadfilt }; +static struct filterops targread_filtops = { + .f_isfd = 1, + .f_detach = targreadfiltdetach, + .f_event = targreadfilt, +}; static struct cdevsw targ_cdevsw = { .d_version = D_VERSION, diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index 5668f751d966..6dea11c0821d 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -100,12 +100,21 @@ static int filt_fifowrite(struct knote *kn, long hint); static void filt_fifodetach_notsup(struct knote *kn); static int filt_fifo_notsup(struct knote *kn, long hint); -static struct filterops fiforead_filtops = - { 1, NULL, filt_fifordetach, filt_fiforead }; -static struct filterops fifowrite_filtops = - { 1, NULL, filt_fifowdetach, filt_fifowrite }; -static struct filterops fifo_notsup_filtops = - { 1, NULL, filt_fifodetach_notsup, filt_fifo_notsup }; +static struct filterops fiforead_filtops = { + .f_isfd = 1, + .f_detach = filt_fifordetach, + .f_event = filt_fiforead, +}; +static struct filterops fifowrite_filtops = { + .f_isfd = 1, + .f_detach = filt_fifowdetach, + .f_event = filt_fifowrite, +}; +static struct filterops fifo_notsup_filtops = { + .f_isfd = 1, + .f_detach = filt_fifodetach_notsup, + .f_event = filt_fifo_notsup, +}; struct vop_vector fifo_specops = { .vop_default = &default_vnodeops, diff --git a/sys/i386/acpica/acpi_machdep.c b/sys/i386/acpica/acpi_machdep.c index e26cce9a7297..a0ef60ffa4d8 100644 --- a/sys/i386/acpica/acpi_machdep.c +++ b/sys/i386/acpica/acpi_machdep.c @@ -80,8 +80,11 @@ static d_poll_t apmpoll; static d_kqfilter_t apmkqfilter; static void apmreadfiltdetach(struct knote *kn); static int apmreadfilt(struct knote *kn, long hint); -static struct filterops apm_readfiltops = - { 1, NULL, apmreadfiltdetach, apmreadfilt }; +static struct filterops apm_readfiltops = { + .f_isfd = 1, + .f_detach = apmreadfiltdetach, + .f_event = apmreadfilt, +}; static struct cdevsw apm_cdevsw = { .d_version = D_VERSION, diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 6603d110c23f..63360497bc2a 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -142,15 +142,28 @@ static int filt_timerattach(struct knote *kn); static void filt_timerdetach(struct knote *kn); static int filt_timer(struct knote *kn, long hint); -static struct filterops file_filtops = - { 1, filt_fileattach, NULL, NULL }; -static struct filterops kqread_filtops = - { 1, NULL, filt_kqdetach, filt_kqueue }; +static struct filterops file_filtops = { + .f_isfd = 1, + .f_attach = filt_fileattach, +}; +static struct filterops kqread_filtops = { + .f_isfd = 1, + .f_detach = filt_kqdetach, + .f_event = filt_kqueue, +}; /* XXX - move to kern_proc.c? */ -static struct filterops proc_filtops = - { 0, filt_procattach, filt_procdetach, filt_proc }; -static struct filterops timer_filtops = - { 0, filt_timerattach, filt_timerdetach, filt_timer }; +static struct filterops proc_filtops = { + .f_isfd = 0, + .f_attach = filt_procattach, + .f_detach = filt_procdetach, + .f_event = filt_proc, +}; +static struct filterops timer_filtops = { + .f_isfd = 0, + .f_attach = filt_timerattach, + .f_detach = filt_timerdetach, + .f_event = filt_timer, +}; static uma_zone_t knote_zone; static int kq_ncallouts = 0; @@ -228,8 +241,10 @@ filt_nullattach(struct knote *kn) return (ENXIO); }; -struct filterops null_filtops = - { 0, filt_nullattach, NULL, NULL }; +struct filterops null_filtops = { + .f_isfd = 0, + .f_attach = filt_nullattach, +}; /* XXX - make SYSINIT to add these, and move into respective modules. */ extern struct filterops sig_filtops; diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index cdf757db52f0..74e625a4be5f 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -111,8 +111,12 @@ static struct thread *sigtd(struct proc *p, int sig, int prop); static void sigqueue_start(void); static uma_zone_t ksiginfo_zone = NULL; -struct filterops sig_filtops = - { 0, filt_sigattach, filt_sigdetach, filt_signal }; +struct filterops sig_filtops = { + .f_isfd = 0, + .f_attach = filt_sigattach, + .f_detach = filt_sigdetach, + .f_event = filt_signal, +}; int kern_logsigexit = 1; SYSCTL_INT(_kern, KERN_LOGSIGEXIT, logsigexit, CTLFLAG_RW, diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index ce20d280c316..fcfb226ea712 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -162,10 +162,16 @@ static void filt_pipedetach(struct knote *kn); static int filt_piperead(struct knote *kn, long hint); static int filt_pipewrite(struct knote *kn, long hint); -static struct filterops pipe_rfiltops = - { 1, NULL, filt_pipedetach, filt_piperead }; -static struct filterops pipe_wfiltops = - { 1, NULL, filt_pipedetach, filt_pipewrite }; +static struct filterops pipe_rfiltops = { + .f_isfd = 1, + .f_detach = filt_pipedetach, + .f_event = filt_piperead +}; +static struct filterops pipe_wfiltops = { + .f_isfd = 1, + .f_detach = filt_pipedetach, + .f_event = filt_pipewrite +}; /* * Default pipe buffer size(s), this can be kind-of large now because pipe diff --git a/sys/kern/tty.c b/sys/kern/tty.c index a14f71425b2a..6990b8ff94fe 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -635,10 +635,16 @@ tty_kqops_write_event(struct knote *kn, long hint) } } -static struct filterops tty_kqops_read = - { 1, NULL, tty_kqops_read_detach, tty_kqops_read_event }; -static struct filterops tty_kqops_write = - { 1, NULL, tty_kqops_write_detach, tty_kqops_write_event }; +static struct filterops tty_kqops_read = { + .f_isfd = 1, + .f_detach = tty_kqops_read_detach, + .f_event = tty_kqops_read_event, +}; +static struct filterops tty_kqops_write = { + .f_isfd = 1, + .f_detach = tty_kqops_write_detach, + .f_event = tty_kqops_write_event, +}; static int ttydev_kqfilter(struct cdev *dev, struct knote *kn) diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c index 350244b334dd..bc6e15828674 100644 --- a/sys/kern/tty_pts.c +++ b/sys/kern/tty_pts.c @@ -494,10 +494,16 @@ pts_kqops_write_event(struct knote *kn, long hint) } } -static struct filterops pts_kqops_read = - { 1, NULL, pts_kqops_read_detach, pts_kqops_read_event }; -static struct filterops pts_kqops_write = - { 1, NULL, pts_kqops_write_detach, pts_kqops_write_event }; +static struct filterops pts_kqops_read = { + .f_isfd = 1, + .f_detach = pts_kqops_read_detach, + .f_event = pts_kqops_read_event, +}; +static struct filterops pts_kqops_write = { + .f_isfd = 1, + .f_detach = pts_kqops_write_detach, + .f_event = pts_kqops_write_event, +}; static int ptsdev_kqfilter(struct file *fp, struct knote *kn) diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index 69bf59c296c8..c44ab5a6ca30 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -256,10 +256,16 @@ static void filt_mqdetach(struct knote *kn); static int filt_mqread(struct knote *kn, long hint); static int filt_mqwrite(struct knote *kn, long hint); -struct filterops mq_rfiltops = - { 1, NULL, filt_mqdetach, filt_mqread }; -struct filterops mq_wfiltops = - { 1, NULL, filt_mqdetach, filt_mqwrite }; +struct filterops mq_rfiltops = { + .f_isfd = 1, + .f_detach = filt_mqdetach, + .f_event = filt_mqread, +}; +struct filterops mq_wfiltops = { + .f_isfd = 1, + .f_detach = filt_mqdetach, + .f_event = filt_mqwrite, +}; /* * Initialize fileno bitmap diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 2f4dd92736a3..d11af34e0e3d 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -151,12 +151,21 @@ static void filt_sowdetach(struct knote *kn); static int filt_sowrite(struct knote *kn, long hint); static int filt_solisten(struct knote *kn, long hint); -static struct filterops solisten_filtops = - { 1, NULL, filt_sordetach, filt_solisten }; -static struct filterops soread_filtops = - { 1, NULL, filt_sordetach, filt_soread }; -static struct filterops sowrite_filtops = - { 1, NULL, filt_sowdetach, filt_sowrite }; +static struct filterops solisten_filtops = { + .f_isfd = 1, + .f_detach = filt_sordetach, + .f_event = filt_solisten, +}; +static struct filterops soread_filtops = { + .f_isfd = 1, + .f_detach = filt_sordetach, + .f_event = filt_soread, +}; +static struct filterops sowrite_filtops = { + .f_isfd = 1, + .f_detach = filt_sowdetach, + .f_event = filt_sowrite, +}; uma_zone_t socket_zone; so_gen_t so_gencnt; /* generation count for sockets */ diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 3f7596b7956c..088e4f6431a3 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -372,10 +372,18 @@ static int filt_lio(struct knote *kn, long hint); static uma_zone_t kaio_zone, aiop_zone, aiocb_zone, aiol_zone, aiolio_zone; /* kqueue filters for aio */ -static struct filterops aio_filtops = - { 0, filt_aioattach, filt_aiodetach, filt_aio }; -static struct filterops lio_filtops = - { 0, filt_lioattach, filt_liodetach, filt_lio }; +static struct filterops aio_filtops = { + .f_isfd = 0, + .f_attach = filt_aioattach, + .f_detach = filt_aiodetach, + .f_event = filt_aio, +}; +static struct filterops lio_filtops = { + .f_isfd = 0, + .f_attach = filt_lioattach, + .f_detach = filt_liodetach, + .f_event = filt_lio +}; static eventhandler_tag exit_tag, exec_tag; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index f3ec5650956a..c40dad1f0110 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -4002,8 +4002,12 @@ static int filt_fsattach(struct knote *kn); static void filt_fsdetach(struct knote *kn); static int filt_fsevent(struct knote *kn, long hint); -struct filterops fs_filtops = - { 0, filt_fsattach, filt_fsdetach, filt_fsevent }; +struct filterops fs_filtops = { + .f_isfd = 0, + .f_attach = filt_fsattach, + .f_detach = filt_fsdetach, + .f_event = filt_fsevent +}; static int filt_fsattach(struct knote *kn) @@ -4076,12 +4080,21 @@ static int filt_vfsread(struct knote *kn, long hint); static int filt_vfswrite(struct knote *kn, long hint); static int filt_vfsvnode(struct knote *kn, long hint); static void filt_vfsdetach(struct knote *kn); -static struct filterops vfsread_filtops = - { 1, NULL, filt_vfsdetach, filt_vfsread }; -static struct filterops vfswrite_filtops = - { 1, NULL, filt_vfsdetach, filt_vfswrite }; -static struct filterops vfsvnode_filtops = - { 1, NULL, filt_vfsdetach, filt_vfsvnode }; +static struct filterops vfsread_filtops = { + .f_isfd = 1, + .f_detach = filt_vfsdetach, + .f_event = filt_vfsread +}; +static struct filterops vfswrite_filtops = { + .f_isfd = 1, + .f_detach = filt_vfsdetach, + .f_event = filt_vfswrite +}; +static struct filterops vfsvnode_filtops = { + .f_isfd = 1, + .f_detach = filt_vfsdetach, + .f_event = filt_vfsvnode +}; static void vfs_knllock(void *arg) diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 9656a6e7b3db..2b62f037e374 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -148,8 +148,11 @@ static struct cdevsw bpf_cdevsw = { .d_kqfilter = bpfkqfilter, }; -static struct filterops bpfread_filtops = - { 1, NULL, filt_bpfdetach, filt_bpfread }; +static struct filterops bpfread_filtops = { + .f_isfd = 1, + .f_detach = filt_bpfdetach, + .f_event = filt_bpfread, +}; /* * Wrapper functions for various buffering methods. If the set of buffer