diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2020-02-20 16:56:54 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2020-02-20 16:56:54 +0000 |
commit | ec03129c70182f2b24dd73c23b65e21de8134a24 (patch) | |
tree | aff61980f07f1f0d612de2436534affed30f3ae6 | |
parent | 00bbf32646352eb0f9b77ee2a5ab19f6b3f53f7b (diff) |
Replace field f_isfd with field f_flags in struct filterops to allow
adding more filter properties without cluttering the struct.
OK mpi@, anton@
34 files changed, 107 insertions, 105 deletions
diff --git a/sys/arch/arm64/dev/apm.c b/sys/arch/arm64/dev/apm.c index 85b2ea7c75a..93d9ae7eb85 100644 --- a/sys/arch/arm64/dev/apm.c +++ b/sys/arch/arm64/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.2 2019/12/31 13:48:31 visa Exp $ */ +/* $OpenBSD: apm.c,v 1.3 2020/02/20 16:56:51 visa Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -88,7 +88,7 @@ int apmkqfilter(dev_t dev, struct knote *kn); int apm_getdefaultinfo(struct apm_power_info *); const struct filterops apmread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_apmrdetach, .f_event = filt_apmread, diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c index 99a1c2daf6b..cf62219d414 100644 --- a/sys/arch/i386/i386/apm.c +++ b/sys/arch/i386/i386/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.121 2019/12/31 13:48:31 visa Exp $ */ +/* $OpenBSD: apm.c,v 1.122 2020/02/20 16:56:51 visa Exp $ */ /*- * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved. @@ -104,7 +104,7 @@ void filt_apmrdetach(struct knote *kn); int filt_apmread(struct knote *kn, long hint); const struct filterops apmread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_apmrdetach, .f_event = filt_apmread, diff --git a/sys/arch/loongson/dev/apm.c b/sys/arch/loongson/dev/apm.c index 38fd5a8c30e..4527a1cf0e1 100644 --- a/sys/arch/loongson/dev/apm.c +++ b/sys/arch/loongson/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.34 2020/02/16 23:37:23 jca Exp $ */ +/* $OpenBSD: apm.c,v 1.35 2020/02/20 16:56:51 visa Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -94,7 +94,7 @@ int apm_getdefaultinfo(struct apm_power_info *); int apm_suspend(int state); const struct filterops apmread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_apmrdetach, .f_event = filt_apmread, diff --git a/sys/arch/macppc/dev/apm.c b/sys/arch/macppc/dev/apm.c index 86eb7dc58fd..743dc53fc7b 100644 --- a/sys/arch/macppc/dev/apm.c +++ b/sys/arch/macppc/dev/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.20 2019/12/31 13:48:31 visa Exp $ */ +/* $OpenBSD: apm.c,v 1.21 2020/02/20 16:56:51 visa Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -86,7 +86,7 @@ int filt_apmread(struct knote *kn, long hint); int apmkqfilter(dev_t dev, struct knote *kn); const struct filterops apmread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_apmrdetach, .f_event = filt_apmread, diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 7db2b8874af..1514bb81db6 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.377 2019/12/31 13:48:31 visa Exp $ */ +/* $OpenBSD: acpi.c,v 1.378 2020/02/20 16:56:52 visa Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -3450,7 +3450,7 @@ void acpi_filtdetach(struct knote *); int acpi_filtread(struct knote *, long); const struct filterops acpiread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = acpi_filtdetach, .f_event = acpi_filtread, diff --git a/sys/dev/hotplug.c b/sys/dev/hotplug.c index 8f6042cbd9d..ac9b589238a 100644 --- a/sys/dev/hotplug.c +++ b/sys/dev/hotplug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hotplug.c,v 1.18 2019/12/31 13:48:31 visa Exp $ */ +/* $OpenBSD: hotplug.c,v 1.19 2020/02/20 16:56:52 visa Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> * @@ -39,7 +39,7 @@ void filt_hotplugrdetach(struct knote *); int filt_hotplugread(struct knote *, long); const struct filterops hotplugread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_hotplugrdetach, .f_event = filt_hotplugread, diff --git a/sys/dev/midi.c b/sys/dev/midi.c index 7a96e87ccf5..bea0a601db1 100644 --- a/sys/dev/midi.c +++ b/sys/dev/midi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.c,v 1.45 2019/12/31 13:48:31 visa Exp $ */ +/* $OpenBSD: midi.c,v 1.46 2020/02/20 16:56:52 visa Exp $ */ /* * Copyright (c) 2003, 2004 Alexandre Ratchov @@ -67,7 +67,7 @@ void filt_midiwdetach(struct knote *); int filt_midiwrite(struct knote *, long); const struct filterops midiwrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_midiwdetach, .f_event = filt_midiwrite, @@ -77,7 +77,7 @@ void filt_midirdetach(struct knote *); int filt_midiread(struct knote *, long); const struct filterops midiread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_midirdetach, .f_event = filt_midiread, diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 2f7c81e5aac..0dd934858cc 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_drv.c,v 1.170 2020/01/05 08:39:46 jsg Exp $ */ +/* $OpenBSD: drm_drv.c,v 1.171 2020/02/20 16:56:52 visa Exp $ */ /*- * Copyright 2007-2009 Owain G. Ainsworth <oga@openbsd.org> * Copyright © 2008 Intel Corporation @@ -496,7 +496,7 @@ filt_drmkms(struct knote *kn, long hint) } const struct filterops drm_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_drmdetach, .f_event = filt_drmkms, diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index 97a1320f5a5..eb328e5efda 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.200 2019/12/31 13:48:31 visa Exp $ */ +/* $OpenBSD: rnd.c,v 1.201 2020/02/20 16:56:52 visa Exp $ */ /* * Copyright (c) 2011 Theo de Raadt. @@ -242,14 +242,14 @@ static void _rs_seed(u_char *, size_t); static void _rs_clearseed(const void *p, size_t s); const struct filterops randomread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_randomdetach, .f_event = filt_randomread, }; const struct filterops randomwrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_randomdetach, .f_event = filt_randomwrite, diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 7c2cd6d8178..40b151483c9 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugen.c,v 1.101 2020/01/04 11:37:33 mpi Exp $ */ +/* $OpenBSD: ugen.c,v 1.102 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -1329,21 +1329,21 @@ filt_ugenread_isoc(struct knote *kn, long hint) } const struct filterops ugenread_intr_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_ugenrdetach, .f_event = filt_ugenread_intr, }; const struct filterops ugenread_isoc_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_ugenrdetach, .f_event = filt_ugenread_isoc, }; const struct filterops ugen_seltrue_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_ugenrdetach, .f_event = filt_seltrue, diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 979105a069d..9211f740379 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.76 2020/01/18 09:00:52 visa Exp $ */ +/* $OpenBSD: uhid.c,v 1.77 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -461,14 +461,14 @@ filt_uhidread(struct knote *kn, long hint) } const struct filterops uhidread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_uhidrdetach, .f_event = filt_uhidread, }; const struct filterops uhid_seltrue_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_uhidrdetach, .f_event = filt_seltrue, diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c index 7a85d6fef66..5b8f9994537 100644 --- a/sys/dev/vscsi.c +++ b/sys/dev/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.47 2020/02/05 16:29:29 krw Exp $ */ +/* $OpenBSD: vscsi.c,v 1.48 2020/02/20 16:56:52 visa Exp $ */ /* * Copyright (c) 2008 David Gwynne <dlg@openbsd.org> @@ -114,7 +114,7 @@ void filt_vscsidetach(struct knote *); int filt_vscsiread(struct knote *, long); const struct filterops vscsi_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_vscsidetach, .f_event = filt_vscsiread, diff --git a/sys/dev/wscons/wsevent.c b/sys/dev/wscons/wsevent.c index 883d70d96b5..36a8dd9eaa0 100644 --- a/sys/dev/wscons/wsevent.c +++ b/sys/dev/wscons/wsevent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsevent.c,v 1.22 2019/12/31 13:48:31 visa Exp $ */ +/* $OpenBSD: wsevent.c,v 1.23 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: wsevent.c,v 1.16 2003/08/07 16:31:29 agc Exp $ */ /* @@ -89,7 +89,7 @@ void filt_wseventdetach(struct knote *); int filt_wseventread(struct knote *, long); const struct filterops wsevent_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_wseventdetach, .f_event = filt_wseventread, diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 98498bcd79b..26214b90a24 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_vnops.c,v 1.81 2020/01/20 23:21:55 claudio Exp $ */ +/* $OpenBSD: cd9660_vnops.c,v 1.82 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */ /*- @@ -959,21 +959,21 @@ int filt_cd9660write(struct knote *kn, long hint); int filt_cd9660vnode(struct knote *kn, long hint); const struct filterops cd9660read_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_cd9660detach, .f_event = filt_cd9660read, }; const struct filterops cd9660write_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_cd9660detach, .f_event = filt_cd9660write, }; const struct filterops cd9660vnode_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_cd9660detach, .f_event = filt_cd9660vnode, diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 0c1d9ca2369..a64909590f6 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.125 2020/02/17 04:07:01 visa Exp $ */ +/* $OpenBSD: kern_event.c,v 1.126 2020/02/20 16:56:52 visa Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -104,28 +104,28 @@ int filt_timer(struct knote *kn, long hint); void filt_seltruedetach(struct knote *kn); const struct filterops kqread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_kqdetach, .f_event = filt_kqueue, }; const struct filterops proc_filtops = { - .f_isfd = 0, + .f_flags = 0, .f_attach = filt_procattach, .f_detach = filt_procdetach, .f_event = filt_proc, }; const struct filterops file_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = filt_fileattach, .f_detach = NULL, .f_event = NULL, }; const struct filterops timer_filtops = { - .f_isfd = 0, + .f_flags = 0, .f_attach = filt_timerattach, .f_detach = filt_timerdetach, .f_event = filt_timer, @@ -447,7 +447,7 @@ filt_seltruedetach(struct knote *kn) } const struct filterops seltrue_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_seltruedetach, .f_event = filt_seltrue, @@ -484,7 +484,7 @@ filt_deaddetach(struct knote *kn) } static const struct filterops dead_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_deaddetach, .f_event = filt_dead, @@ -684,7 +684,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, struct proc *p) return (EINVAL); } - if (fops->f_isfd) { + if (fops->f_flags & FILTEROP_ISFD) { /* validate descriptor */ if (kev->ident > INT_MAX) return (EBADF); @@ -694,7 +694,7 @@ kqueue_register(struct kqueue *kq, struct kevent *kev, struct proc *p) newkn = pool_get(&knote_pool, PR_WAITOK | PR_ZERO); again: - if (fops->f_isfd) { + if (fops->f_flags & FILTEROP_ISFD) { if ((fp = fd_getfile(fdp, kev->ident)) == NULL) { error = EBADF; goto done; @@ -774,7 +774,7 @@ again: * knote_fdclose() has missed kn if the function * ran before kn appeared in kq_knlist. */ - if (fops->f_isfd && + if ((fops->f_flags & FILTEROP_ISFD) && fd_checkclosed(fdp, kev->ident, kn->kn_fp)) { /* * Drop the knote silently without error @@ -1297,7 +1297,7 @@ knote_attach(struct knote *kn) struct kqueue *kq = kn->kn_kq; struct klist *list; - if (kn->kn_fop->f_isfd) { + if (kn->kn_fop->f_flags & FILTEROP_ISFD) { KASSERT(kq->kq_knlistsize > kn->kn_id); list = &kq->kq_knlist[kn->kn_id]; } else { @@ -1320,7 +1320,7 @@ knote_drop(struct knote *kn, struct proc *p) KASSERT(kn->kn_filter != EVFILT_MARKER); - if (kn->kn_fop->f_isfd) + if (kn->kn_fop->f_flags & FILTEROP_ISFD) list = &kq->kq_knlist[kn->kn_id]; else list = &kq->kq_knhash[KN_HASH(kn->kn_id, kq->kq_knhashmask)]; @@ -1334,7 +1334,7 @@ knote_drop(struct knote *kn, struct proc *p) wakeup(kn); } splx(s); - if (kn->kn_fop->f_isfd) + if (kn->kn_fop->f_flags & FILTEROP_ISFD) FRELE(kn->kn_fp, p); pool_put(&knote_pool, kn); } diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 9f2dbc1460b..b592cece5c9 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.248 2020/02/19 11:33:48 claudio Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.249 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -77,7 +77,7 @@ void filt_sigdetach(struct knote *kn); int filt_signal(struct knote *kn, long hint); const struct filterops sig_filtops = { - .f_isfd = 0, + .f_flags = 0, .f_attach = filt_sigattach, .f_detach = filt_sigdetach, .f_event = filt_signal, diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index 78d842b714b..129d6c7e109 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_log.c,v 1.64 2020/01/11 14:30:24 mpi Exp $ */ +/* $OpenBSD: subr_log.c,v 1.65 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */ /* @@ -87,7 +87,7 @@ void filt_logrdetach(struct knote *kn); int filt_logread(struct knote *kn, long hint); const struct filterops logread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_logrdetach, .f_event = filt_logread, diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 9a4cb6b3636..18c32ebd39d 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_pipe.c,v 1.117 2020/02/16 07:59:08 anton Exp $ */ +/* $OpenBSD: sys_pipe.c,v 1.118 2020/02/20 16:56:52 visa Exp $ */ /* * Copyright (c) 1996 John S. Dyson @@ -75,14 +75,14 @@ int filt_piperead(struct knote *kn, long hint); int filt_pipewrite(struct knote *kn, long hint); const struct filterops pipe_rfiltops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_pipedetach, .f_event = filt_piperead, }; const struct filterops pipe_wfiltops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_pipedetach, .f_event = filt_pipewrite, diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 2e02e126dc8..0b72a0042db 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.152 2020/02/08 14:52:07 visa Exp $ */ +/* $OpenBSD: tty.c,v 1.153 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -1090,14 +1090,14 @@ ttpoll(dev_t device, int events, struct proc *p) } const struct filterops ttyread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_ttyrdetach, .f_event = filt_ttyread, }; const struct filterops ttywrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_ttywdetach, .f_event = filt_ttywrite, diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 4104106c927..e5b821dfce1 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_pty.c,v 1.96 2020/01/11 14:30:24 mpi Exp $ */ +/* $OpenBSD: tty_pty.c,v 1.97 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */ /* @@ -717,14 +717,14 @@ filt_ptcwrite(struct knote *kn, long hint) } const struct filterops ptcread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_ptcrdetach, .f_event = filt_ptcread, }; const struct filterops ptcwrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_ptcwdetach, .f_event = filt_ptcwrite, diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index c14924082a1..0caeaae743e 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket.c,v 1.240 2020/02/14 14:32:44 mpi Exp $ */ +/* $OpenBSD: uipc_socket.c,v 1.241 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* @@ -73,21 +73,21 @@ int filt_sowrite(struct knote *kn, long hint); int filt_solisten(struct knote *kn, long hint); const struct filterops solisten_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_sordetach, .f_event = filt_solisten, }; const struct filterops soread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_sordetach, .f_event = filt_soread, }; const struct filterops sowrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_sowdetach, .f_event = filt_sowrite, diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index a8ca01b337a..35793370639 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_default.c,v 1.46 2019/12/31 13:48:32 visa Exp $ */ +/* $OpenBSD: vfs_default.c,v 1.47 2020/02/20 16:56:52 visa Exp $ */ /* * Portions of this code are: @@ -186,7 +186,7 @@ vop_generic_islocked(void *v) } const struct filterops generic_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_generic_detach, .f_event = filt_generic_readwrite, diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index ce61ed10671..d696fda9b42 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo_vnops.c,v 1.72 2020/01/20 23:21:56 claudio Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.73 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */ /* @@ -108,14 +108,14 @@ void filt_fifowdetach(struct knote *kn); int filt_fifowrite(struct knote *kn, long hint); const struct filterops fiforead_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_fifordetach, .f_event = filt_fiforead, }; const struct filterops fifowrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_fifowdetach, .f_event = filt_fifowrite, diff --git a/sys/miscfs/fuse/fuse_device.c b/sys/miscfs/fuse/fuse_device.c index 14a78e92370..54fc666a4cc 100644 --- a/sys/miscfs/fuse/fuse_device.c +++ b/sys/miscfs/fuse/fuse_device.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_device.c,v 1.30 2019/12/31 13:48:32 visa Exp $ */ +/* $OpenBSD: fuse_device.c,v 1.31 2020/02/20 16:56:52 visa Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -70,14 +70,14 @@ int filt_fuse_read(struct knote *, long); void filt_fuse_rdetach(struct knote *); const static struct filterops fuse_rd_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_fuse_rdetach, .f_event = filt_fuse_read, }; const static struct filterops fuse_seltrue_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_fuse_rdetach, .f_event = filt_seltrue, diff --git a/sys/miscfs/fuse/fuse_vnops.c b/sys/miscfs/fuse/fuse_vnops.c index cb0568bc0a5..881dcb653a7 100644 --- a/sys/miscfs/fuse/fuse_vnops.c +++ b/sys/miscfs/fuse/fuse_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_vnops.c,v 1.57 2020/01/20 23:21:56 claudio Exp $ */ +/* $OpenBSD: fuse_vnops.c,v 1.58 2020/02/20 16:56:52 visa Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -111,21 +111,21 @@ const struct vops fusefs_vops = { }; const struct filterops fusefsread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_fusefsdetach, .f_event = filt_fusefsread, }; const struct filterops fusefswrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_fusefsdetach, .f_event = filt_fusefswrite, }; const struct filterops fusefsvnode_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_fusefsdetach, .f_event = filt_fusefsvnode, diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 56ac3c6ddc4..c57265e3834 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vnops.c,v 1.128 2020/01/20 23:21:56 claudio Exp $ */ +/* $OpenBSD: msdosfs_vnops.c,v 1.129 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */ /*- @@ -1960,21 +1960,21 @@ const struct vops msdosfs_vops = { }; const struct filterops msdosfsread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_msdosfsdetach, .f_event = filt_msdosfsread, }; const struct filterops msdosfswrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_msdosfsdetach, .f_event = filt_msdosfswrite, }; const struct filterops msdosfsvnode_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_msdosfsdetach, .f_event = filt_msdosfsvnode, diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 5d8adf4db3e..3f8cf6b7933 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.187 2020/02/14 14:32:44 mpi Exp $ */ +/* $OpenBSD: bpf.c,v 1.188 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */ /* @@ -1163,7 +1163,7 @@ bpfpoll(dev_t dev, int events, struct proc *p) } const struct filterops bpfread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_bpfrdetach, .f_event = filt_bpfread, diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c index b6ef9404c15..a43475945cd 100644 --- a/sys/net/if_pppx.c +++ b/sys/net/if_pppx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pppx.c,v 1.75 2020/02/18 15:06:27 cheloha Exp $ */ +/* $OpenBSD: if_pppx.c,v 1.76 2020/02/20 16:56:52 visa Exp $ */ /* * Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org> @@ -191,7 +191,7 @@ void filt_pppx_rdetach(struct knote *); int filt_pppx_read(struct knote *, long); const struct filterops pppx_rd_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_pppx_rdetach, .f_event = filt_pppx_read, @@ -201,7 +201,7 @@ void filt_pppx_wdetach(struct knote *); int filt_pppx_write(struct knote *, long); const struct filterops pppx_wr_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_pppx_wdetach, .f_event = filt_pppx_write, diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 9e4bfd0acc1..b05106c3b89 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tun.c,v 1.218 2020/02/14 14:32:44 mpi Exp $ */ +/* $OpenBSD: if_tun.c,v 1.219 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */ /* @@ -133,14 +133,14 @@ void filt_tunwdetach(struct knote *); void tun_link_state(struct tun_softc *, int); const struct filterops tunread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_tunrdetach, .f_event = filt_tunread, }; const struct filterops tunwrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_tunwdetach, .f_event = filt_tunwrite, diff --git a/sys/net/switchctl.c b/sys/net/switchctl.c index 88a212afc5a..3137aaaa186 100644 --- a/sys/net/switchctl.c +++ b/sys/net/switchctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: switchctl.c,v 1.19 2020/01/28 16:26:09 visa Exp $ */ +/* $OpenBSD: switchctl.c,v 1.20 2020/02/20 16:56:52 visa Exp $ */ /* * Copyright (c) 2016 Kazuya GODA <goda@openbsd.org> @@ -60,14 +60,14 @@ int switch_dev_output(struct switch_softc *, struct mbuf *); void switch_dev_wakeup(struct switch_softc *); const struct filterops switch_rd_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_switch_rdetach, .f_event = filt_switch_read, }; const struct filterops switch_wr_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_switch_wdetach, .f_event = filt_switch_write, diff --git a/sys/nfs/nfs_kq.c b/sys/nfs/nfs_kq.c index e5976d28560..fcf69f86238 100644 --- a/sys/nfs/nfs_kq.c +++ b/sys/nfs/nfs_kq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_kq.c,v 1.28 2020/01/21 00:18:13 cheloha Exp $ */ +/* $OpenBSD: nfs_kq.c,v 1.29 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */ /*- @@ -250,14 +250,14 @@ filt_nfsvnode(struct knote *kn, long hint) } static const struct filterops nfsread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_nfsdetach, .f_event = filt_nfsread, }; static const struct filterops nfsvnode_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_nfsdetach, .f_event = filt_nfsvnode, diff --git a/sys/sys/event.h b/sys/sys/event.h index 0597021c114..c54ee63e842 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -1,4 +1,4 @@ -/* $OpenBSD: event.h,v 1.32 2019/12/31 13:48:32 visa Exp $ */ +/* $OpenBSD: event.h,v 1.33 2020/02/20 16:56:52 visa Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> @@ -146,8 +146,10 @@ SLIST_HEAD(klist, knote); */ #define NOTE_SIGNAL 0x08000000 +#define FILTEROP_ISFD 0x00000001 /* ident == filedescriptor */ + struct filterops { - int f_isfd; /* true if ident == filedescriptor */ + int f_flags; int (*f_attach)(struct knote *kn); void (*f_detach)(struct knote *kn); int (*f_event)(struct knote *kn, long hint); diff --git a/sys/tmpfs/tmpfs_vnops.c b/sys/tmpfs/tmpfs_vnops.c index cdd43a51313..ec6c704be25 100644 --- a/sys/tmpfs/tmpfs_vnops.c +++ b/sys/tmpfs/tmpfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmpfs_vnops.c,v 1.38 2020/01/20 23:21:56 claudio Exp $ */ +/* $OpenBSD: tmpfs_vnops.c,v 1.39 2020/02/20 16:56:52 visa Exp $ */ /* $NetBSD: tmpfs_vnops.c,v 1.100 2012/11/05 17:27:39 dholland Exp $ */ /* @@ -2588,21 +2588,21 @@ int filt_tmpfswrite(struct knote *kn, long hint); int filt_tmpfsvnode(struct knote *kn, long hint); const struct filterops tmpfsread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_tmpfsdetach, .f_event = filt_tmpfsread, }; const struct filterops tmpfswrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_tmpfsdetach, .f_event = filt_tmpfswrite, }; const struct filterops tmpfsvnode_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_tmpfsdetach, .f_event = filt_tmpfsvnode, diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 01530c80902..30f55bcf060 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_vnops.c,v 1.147 2019/12/31 13:48:32 visa Exp $ */ +/* $OpenBSD: ufs_vnops.c,v 1.148 2020/02/20 16:56:53 visa Exp $ */ /* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */ /* @@ -1893,21 +1893,21 @@ bad: } const struct filterops ufsread_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_ufsdetach, .f_event = filt_ufsread, }; const struct filterops ufswrite_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_ufsdetach, .f_event = filt_ufswrite, }; const struct filterops ufsvnode_filtops = { - .f_isfd = 1, + .f_flags = FILTEROP_ISFD, .f_attach = NULL, .f_detach = filt_ufsdetach, .f_event = filt_ufsvnode, |