1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 23:33:33 +02:00

Replace field f_isfd with field f_flags in struct filterops to allow

adding more filter properties without cluttering the struct.

OK mpi@, anton@
This commit is contained in:
visa
2020-02-20 16:56:51 +00:00
parent ba8d8ac868
commit b821368957
34 changed files with 107 additions and 105 deletions
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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,
+3 -3
View File
@@ -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,
+2 -2
View File
@@ -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,
+3 -3
View File
@@ -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,
+4 -4
View File
@@ -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,
+3 -3
View File
@@ -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,
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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,
+4 -4
View File
@@ -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,
+13 -13
View File
@@ -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);
}
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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,
+3 -3
View File
@@ -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,
+3 -3
View File
@@ -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,
+3 -3
View File
@@ -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,
+4 -4
View File
@@ -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,
+2 -2
View File
@@ -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,
+3 -3
View File
@@ -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,
+3 -3
View File
@@ -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,
+4 -4
View File
@@ -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,
+4 -4
View File
@@ -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,
+2 -2
View File
@@ -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,
+3 -3
View File
@@ -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,
+3 -3
View File
@@ -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,
+3 -3
View File
@@ -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,
+3 -3
View File
@@ -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,
+4 -2
View File
@@ -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);
+4 -4
View File
@@ -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,
+4 -4
View File
@@ -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,