sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-09-10 05:16:20 +00:00
parent 9bb7c570b7
commit 887dd091b7
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
35 changed files with 571 additions and 212 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: machdep.c,v 1.287 2023/08/23 01:55:45 cheloha Exp $ */
/* $OpenBSD: machdep.c,v 1.288 2023/09/08 20:47:22 kn Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@ -2005,62 +2005,33 @@ getbootinfo(char *bootinfo, int bootinfo_size)
case BOOTARG_PCIINFO:
/* generated by i386 boot loader */
break;
case BOOTARG_CONSDEV:
if (q->ba_size > sizeof(bios_oconsdev_t) +
offsetof(struct _boot_args32, ba_arg)) {
case BOOTARG_CONSDEV: {
#if NCOM > 0
bios_consdev_t *cdp =
(bios_consdev_t*)q->ba_arg;
static const int ports[] =
{ 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
int unit = minor(cdp->consdev);
uint64_t consaddr = cdp->consaddr;
if (consaddr == -1 && unit >= 0 &&
unit < nitems(ports))
consaddr = ports[unit];
if (major(cdp->consdev) == 8 &&
consaddr != -1) {
comconsunit = unit;
comconsaddr = consaddr;
comconsrate = cdp->conspeed;
comconsfreq = cdp->consfreq;
comcons_reg_width = cdp->reg_width;
comcons_reg_shift = cdp->reg_shift;
if (cdp->flags & BCD_MMIO)
comconsiot = X86_BUS_SPACE_MEM;
else
comconsiot = X86_BUS_SPACE_IO;
}
#endif
#ifdef BOOTINFO_DEBUG
printf(" console 0x%x:%d",
cdp->consdev, cdp->conspeed);
#endif
} else {
#if NCOM > 0
bios_oconsdev_t *cdp =
(bios_oconsdev_t*)q->ba_arg;
static const int ports[] =
{ 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
int unit = minor(cdp->consdev);
int consaddr = cdp->consaddr;
if (consaddr == -1 && unit >= 0 &&
unit < nitems(ports))
consaddr = ports[unit];
if (major(cdp->consdev) == 8 &&
consaddr != -1) {
comconsunit = unit;
comconsaddr = consaddr;
comconsrate = cdp->conspeed;
bios_consdev_t *cdp = (bios_consdev_t*)q->ba_arg;
static const int ports[] =
{ 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
int unit = minor(cdp->consdev);
uint64_t consaddr = cdp->consaddr;
if (consaddr == -1 && unit >= 0 && unit < nitems(ports))
consaddr = ports[unit];
if (major(cdp->consdev) == 8 && consaddr != -1) {
comconsunit = unit;
comconsaddr = consaddr;
comconsrate = cdp->conspeed;
comconsfreq = cdp->consfreq;
comcons_reg_width = cdp->reg_width;
comcons_reg_shift = cdp->reg_shift;
if (cdp->flags & BCD_MMIO)
comconsiot = X86_BUS_SPACE_MEM;
else
comconsiot = X86_BUS_SPACE_IO;
}
}
#endif
#ifdef BOOTINFO_DEBUG
printf(" console 0x%x:%d",
cdp->consdev, cdp->conspeed);
printf(" console 0x%x:%d", cdp->consdev, cdp->conspeed);
#endif
}
break;
}
case BOOTARG_BOOTMAC:
bios_bootmac = (bios_bootmac_t *)q->ba_arg;
break;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: biosvar.h,v 1.31 2023/01/18 23:25:32 jsg Exp $ */
/* $OpenBSD: biosvar.h,v 1.32 2023/09/08 20:47:22 kn Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@ -172,14 +172,6 @@ typedef struct _bios_consdev {
int reg_shift;
} __packed bios_consdev_t;
/* Old interface; remove after OpenBSD 7.3 is released */
typedef struct _bios_oconsdev {
dev_t consdev;
int conspeed;
int consaddr;
int consfreq;
} __packed bios_oconsdev_t;
#define BOOTARG_BOOTMAC 7
typedef struct _bios_bootmac {
char mac[6];

View file

@ -1,4 +1,4 @@
/* $OpenBSD: hotplug.c,v 1.22 2022/07/02 08:50:41 visa Exp $ */
/* $OpenBSD: hotplug.c,v 1.23 2023/09/08 20:00:27 mvs Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@ -25,6 +25,7 @@
#include <sys/fcntl.h>
#include <sys/hotplug.h>
#include <sys/ioctl.h>
#include <sys/selinfo.h>
#include <sys/vnode.h>
#define HOTPLUG_MAXEVENTS 64

View file

@ -1,4 +1,4 @@
/* $OpenBSD: if_ure.c,v 1.32 2023/05/06 08:07:10 kevlo Exp $ */
/* $OpenBSD: if_ure.c,v 1.33 2023/09/09 14:23:37 kevlo Exp $ */
/*-
* Copyright (c) 2015, 2016, 2019 Kevin Lo <kevlo@openbsd.org>
* Copyright (c) 2020 Jonathon Fletcher <jonathon.fletcher@gmail.com>
@ -126,7 +126,6 @@ const struct usb_devno ure_devs[] = {
{ USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_EU300 },
{ USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_RTL8152B_1 },
{ USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_RTL8152B_2 },
{ USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_RTL8153 },
{ USB_VENDOR_TRENDNET, USB_PRODUCT_TRENDNET_RTL8156 },
{ USB_VENDOR_TTL, USB_PRODUCT_TTL_RTL8153 },
{ USB_VENDOR_TWINHEAD, USB_PRODUCT_TWINHEAD_RTL8153B },

View file

@ -1,4 +1,4 @@
$OpenBSD: usbdevs,v 1.758 2023/08/12 20:43:49 miod Exp $
$OpenBSD: usbdevs,v 1.759 2023/09/09 14:23:37 kevlo Exp $
/* $NetBSD: usbdevs,v 1.322 2003/05/10 17:47:14 hamajima Exp $ */
/*
@ -4478,7 +4478,7 @@ product TPLINK RTL8188EUS 0x010c RTL8188EUS
product TPLINK EU300 0x0601 EU300
product TPLINK RTL8152B_1 0x0602 RTL8152B
product TPLINK RTL8152B_2 0x0603 RTL8152B
product TPLINK RTL8153 0x0604 RTL8153
product TPLINK UB500 0x0604 UB500
/* Trek Technology products */
product TREK THUMBDRIVE 0x1111 ThumbDrive

View file

@ -1,10 +1,10 @@
/* $OpenBSD: usbdevs.h,v 1.770 2023/08/12 20:44:32 miod Exp $ */
/* $OpenBSD: usbdevs.h,v 1.771 2023/09/09 14:24:06 kevlo Exp $ */
/*
* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
*
* generated from:
* OpenBSD: usbdevs,v 1.758 2023/08/12 20:43:49 miod Exp
* OpenBSD: usbdevs,v 1.759 2023/09/09 14:23:37 kevlo Exp
*/
/* $NetBSD: usbdevs,v 1.322 2003/05/10 17:47:14 hamajima Exp $ */
@ -4485,7 +4485,7 @@
#define USB_PRODUCT_TPLINK_EU300 0x0601 /* EU300 */
#define USB_PRODUCT_TPLINK_RTL8152B_1 0x0602 /* RTL8152B */
#define USB_PRODUCT_TPLINK_RTL8152B_2 0x0603 /* RTL8152B */
#define USB_PRODUCT_TPLINK_RTL8153 0x0604 /* RTL8153 */
#define USB_PRODUCT_TPLINK_UB500 0x0604 /* UB500 */
/* Trek Technology products */
#define USB_PRODUCT_TREK_THUMBDRIVE 0x1111 /* ThumbDrive */

View file

@ -1,10 +1,10 @@
/* $OpenBSD: usbdevs_data.h,v 1.764 2023/08/12 20:44:32 miod Exp $ */
/* $OpenBSD: usbdevs_data.h,v 1.765 2023/09/09 14:24:06 kevlo Exp $ */
/*
* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
*
* generated from:
* OpenBSD: usbdevs,v 1.758 2023/08/12 20:43:49 miod Exp
* OpenBSD: usbdevs,v 1.759 2023/09/09 14:23:37 kevlo Exp
*/
/* $NetBSD: usbdevs,v 1.322 2003/05/10 17:47:14 hamajima Exp $ */
@ -11538,8 +11538,8 @@ const struct usb_known_product usb_known_products[] = {
"RTL8152B",
},
{
USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_RTL8153,
"RTL8153",
USB_VENDOR_TPLINK, USB_PRODUCT_TPLINK_UB500,
"UB500",
},
{
USB_VENDOR_TREK, USB_PRODUCT_TREK_THUMBDRIVE,

View file

@ -1,4 +1,4 @@
/* $OpenBSD: wseventvar.h,v 1.11 2022/07/02 08:50:42 visa Exp $ */
/* $OpenBSD: wseventvar.h,v 1.12 2023/09/08 20:00:28 mvs Exp $ */
/* $NetBSD: wseventvar.h,v 1.1 1998/03/22 14:24:03 drochner Exp $ */
/*
@ -71,6 +71,7 @@
* @(#)event_var.h 8.1 (Berkeley) 6/11/93
*/
#include <sys/selinfo.h>
#include <sys/sigio.h>
/*

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cd9660_vnops.c,v 1.94 2023/03/08 04:43:08 guenther Exp $ */
/* $OpenBSD: cd9660_vnops.c,v 1.95 2023/09/08 20:00:28 mvs Exp $ */
/* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */
/*-
@ -961,7 +961,7 @@ cd9660_kqfilter(void *v)
kn->kn_hook = (caddr_t)vp;
klist_insert_locked(&vp->v_selectinfo.si_note, kn);
klist_insert_locked(&vp->v_klist, kn);
return (0);
}
@ -971,7 +971,7 @@ filt_cd9660detach(struct knote *kn)
{
struct vnode *vp = (struct vnode *)kn->kn_hook;
klist_remove_locked(&vp->v_selectinfo.si_note, kn);
klist_remove_locked(&vp->v_klist, kn);
}
int

View file

@ -1,4 +1,4 @@
/* $OpenBSD: kern_clockintr.c,v 1.38 2023/09/06 02:33:18 cheloha Exp $ */
/* $OpenBSD: kern_clockintr.c,v 1.43 2023/09/09 16:34:39 cheloha Exp $ */
/*
* Copyright (c) 2003 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@ -43,7 +43,6 @@ uint32_t statclock_min; /* [I] minimum statclock period (ns) */
uint32_t statclock_mask; /* [I] set of allowed offsets */
uint64_t clockintr_advance_random(struct clockintr *, uint64_t, uint32_t);
void clockintr_cancel_locked(struct clockintr *);
void clockintr_hardclock(struct clockintr *, void *);
void clockintr_schedule(struct clockintr *, uint64_t);
void clockintr_schedule_locked(struct clockintr *, uint64_t);
@ -51,6 +50,9 @@ void clockintr_statclock(struct clockintr *, void *);
void clockqueue_intrclock_install(struct clockintr_queue *,
const struct intrclock *);
uint64_t clockqueue_next(const struct clockintr_queue *);
void clockqueue_pend_delete(struct clockintr_queue *, struct clockintr *);
void clockqueue_pend_insert(struct clockintr_queue *, struct clockintr *,
uint64_t);
void clockqueue_reset_intrclock(struct clockintr_queue *);
uint64_t nsec_advance(uint64_t *, uint64_t, uint64_t);
@ -255,12 +257,13 @@ clockintr_dispatch(void *frame)
if (cq->cq_uptime < cl->cl_expiration)
break;
}
clockintr_cancel_locked(cl);
clockqueue_pend_delete(cq, cl);
cq->cq_shadow.cl_expiration = cl->cl_expiration;
cq->cq_shadow.cl_func = cl->cl_func;
cq->cq_running = cl;
mtx_leave(&cq->cq_mtx);
cl->cl_func(&cq->cq_shadow, frame);
cq->cq_shadow.cl_func(&cq->cq_shadow, frame);
mtx_enter(&cq->cq_mtx);
cq->cq_running = NULL;
@ -270,7 +273,7 @@ clockintr_dispatch(void *frame)
}
if (ISSET(cq->cq_shadow.cl_flags, CLST_SHADOW_PENDING)) {
CLR(cq->cq_shadow.cl_flags, CLST_SHADOW_PENDING);
clockintr_schedule_locked(cl,
clockqueue_pend_insert(cq, cl,
cq->cq_shadow.cl_expiration);
}
run++;
@ -329,17 +332,7 @@ clockintr_advance(struct clockintr *cl, uint64_t period)
mtx_enter(&cq->cq_mtx);
expiration = cl->cl_expiration;
count = nsec_advance(&expiration, period, nsecuptime());
if (ISSET(cl->cl_flags, CLST_PENDING))
clockintr_cancel_locked(cl);
clockintr_schedule_locked(cl, expiration);
if (ISSET(cq->cq_flags, CQ_INTRCLOCK)) {
if (cl == TAILQ_FIRST(&cq->cq_pend)) {
if (cq == &curcpu()->ci_queue)
clockqueue_reset_intrclock(cq);
}
}
if (cl == cq->cq_running)
SET(cl->cl_flags, CLST_IGNORE_SHADOW);
mtx_leave(&cq->cq_mtx);
return count;
}
@ -377,7 +370,7 @@ clockintr_cancel(struct clockintr *cl)
mtx_enter(&cq->cq_mtx);
if (ISSET(cl->cl_flags, CLST_PENDING)) {
was_next = cl == TAILQ_FIRST(&cq->cq_pend);
clockintr_cancel_locked(cl);
clockqueue_pend_delete(cq, cl);
if (ISSET(cq->cq_flags, CQ_INTRCLOCK)) {
if (was_next && !TAILQ_EMPTY(&cq->cq_pend)) {
if (cq == &curcpu()->ci_queue)
@ -390,18 +383,6 @@ clockintr_cancel(struct clockintr *cl)
mtx_leave(&cq->cq_mtx);
}
void
clockintr_cancel_locked(struct clockintr *cl)
{
struct clockintr_queue *cq = cl->cl_queue;
MUTEX_ASSERT_LOCKED(&cq->cq_mtx);
KASSERT(ISSET(cl->cl_flags, CLST_PENDING));
TAILQ_REMOVE(&cq->cq_pend, cl, cl_plink);
CLR(cl->cl_flags, CLST_PENDING);
}
struct clockintr *
clockintr_establish(struct cpu_info *ci,
void (*func)(struct clockintr *, void *))
@ -433,9 +414,20 @@ clockintr_schedule(struct clockintr *cl, uint64_t expiration)
}
mtx_enter(&cq->cq_mtx);
if (ISSET(cl->cl_flags, CLST_PENDING))
clockintr_cancel_locked(cl);
clockintr_schedule_locked(cl, expiration);
mtx_leave(&cq->cq_mtx);
}
void
clockintr_schedule_locked(struct clockintr *cl, uint64_t expiration)
{
struct clockintr_queue *cq = cl->cl_queue;
MUTEX_ASSERT_LOCKED(&cq->cq_mtx);
if (ISSET(cl->cl_flags, CLST_PENDING))
clockqueue_pend_delete(cq, cl);
clockqueue_pend_insert(cq, cl, expiration);
if (ISSET(cq->cq_flags, CQ_INTRCLOCK)) {
if (cl == TAILQ_FIRST(&cq->cq_pend)) {
if (cq == &curcpu()->ci_queue)
@ -444,28 +436,6 @@ clockintr_schedule(struct clockintr *cl, uint64_t expiration)
}
if (cl == cq->cq_running)
SET(cl->cl_flags, CLST_IGNORE_SHADOW);
mtx_leave(&cq->cq_mtx);
}
void
clockintr_schedule_locked(struct clockintr *cl, uint64_t expiration)
{
struct clockintr *elm;
struct clockintr_queue *cq = cl->cl_queue;
MUTEX_ASSERT_LOCKED(&cq->cq_mtx);
KASSERT(!ISSET(cl->cl_flags, CLST_PENDING));
cl->cl_expiration = expiration;
TAILQ_FOREACH(elm, &cq->cq_pend, cl_plink) {
if (cl->cl_expiration < elm->cl_expiration)
break;
}
if (elm == NULL)
TAILQ_INSERT_TAIL(&cq->cq_pend, cl, cl_plink);
else
TAILQ_INSERT_BEFORE(elm, cl, cl_plink);
SET(cl->cl_flags, CLST_PENDING);
}
void
@ -541,6 +511,38 @@ clockqueue_next(const struct clockintr_queue *cq)
return TAILQ_FIRST(&cq->cq_pend)->cl_expiration;
}
void
clockqueue_pend_delete(struct clockintr_queue *cq, struct clockintr *cl)
{
MUTEX_ASSERT_LOCKED(&cq->cq_mtx);
KASSERT(ISSET(cl->cl_flags, CLST_PENDING));
TAILQ_REMOVE(&cq->cq_pend, cl, cl_plink);
CLR(cl->cl_flags, CLST_PENDING);
}
void
clockqueue_pend_insert(struct clockintr_queue *cq, struct clockintr *cl,
uint64_t expiration)
{
struct clockintr *elm;
MUTEX_ASSERT_LOCKED(&cq->cq_mtx);
KASSERT(!ISSET(cl->cl_flags, CLST_PENDING));
cl->cl_expiration = expiration;
TAILQ_FOREACH(elm, &cq->cq_pend, cl_plink) {
if (cl->cl_expiration < elm->cl_expiration)
break;
}
if (elm == NULL)
TAILQ_INSERT_TAIL(&cq->cq_pend, cl, cl_plink);
else
TAILQ_INSERT_BEFORE(elm, cl, cl_plink);
SET(cl->cl_flags, CLST_PENDING);
}
void
clockqueue_reset_intrclock(struct clockintr_queue *cq)
{

View file

@ -1,4 +1,4 @@
/* $OpenBSD: kern_sig.c,v 1.315 2023/09/08 09:06:31 claudio Exp $ */
/* $OpenBSD: kern_sig.c,v 1.316 2023/09/09 14:50:09 claudio Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@ -2109,12 +2109,14 @@ single_thread_set(struct proc *p, enum single_thread_mode mode, int wait)
TAILQ_FOREACH(q, &pr->ps_threads, p_thr_link) {
if (q == p)
continue;
SCHED_LOCK(s);
if (q->p_flag & P_WEXIT) {
SCHED_LOCK(s);
if (mode == SINGLE_EXIT && q->p_stat == SSTOP)
setrunnable(q);
SCHED_UNLOCK(s);
continue;
}
SCHED_LOCK(s);
atomic_setbits_int(&q->p_flag, P_SUSPSINGLE);
switch (q->p_stat) {
case SIDL:

View file

@ -1,4 +1,4 @@
/* $OpenBSD: fuse_device.c,v 1.38 2022/08/29 06:08:04 jsg Exp $ */
/* $OpenBSD: fuse_device.c,v 1.39 2023/09/08 20:00:28 mvs Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@ -25,6 +25,7 @@
#include <sys/statvfs.h>
#include <sys/vnode.h>
#include <sys/fusebuf.h>
#include <sys/selinfo.h>
#include "fusefs_node.h"
#include "fusefs.h"

View file

@ -1,4 +1,4 @@
/* $OpenBSD: fuse_vnops.c,v 1.66 2022/06/26 05:20:42 visa Exp $ */
/* $OpenBSD: fuse_vnops.c,v 1.67 2023/09/08 20:00:28 mvs Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@ -154,7 +154,7 @@ fusefs_kqfilter(void *v)
kn->kn_hook = (caddr_t)vp;
klist_insert_locked(&vp->v_selectinfo.si_note, kn);
klist_insert_locked(&vp->v_klist, kn);
return (0);
}
@ -164,7 +164,7 @@ filt_fusefsdetach(struct knote *kn)
{
struct vnode *vp = (struct vnode *)kn->kn_hook;
klist_remove_locked(&vp->v_selectinfo.si_note, kn);
klist_remove_locked(&vp->v_klist, kn);
}
int

View file

@ -1,4 +1,4 @@
/* $OpenBSD: msdosfs_vnops.c,v 1.139 2022/08/23 20:37:16 cheloha Exp $ */
/* $OpenBSD: msdosfs_vnops.c,v 1.140 2023/09/08 20:00:28 mvs Exp $ */
/* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */
/*-
@ -1970,7 +1970,7 @@ msdosfs_kqfilter(void *v)
kn->kn_hook = (caddr_t)vp;
klist_insert_locked(&vp->v_selectinfo.si_note, kn);
klist_insert_locked(&vp->v_klist, kn);
return (0);
}
@ -1980,7 +1980,7 @@ filt_msdosfsdetach(struct knote *kn)
{
struct vnode *vp = (struct vnode *)kn->kn_hook;
klist_remove_locked(&vp->v_selectinfo.si_note, kn);
klist_remove_locked(&vp->v_klist, kn);
}
int

View file

@ -1,4 +1,4 @@
/* $OpenBSD: nfs_kq.c,v 1.35 2023/03/08 04:43:09 guenther Exp $ */
/* $OpenBSD: nfs_kq.c,v 1.36 2023/09/08 20:00:28 mvs Exp $ */
/* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */
/*-
@ -185,7 +185,7 @@ filt_nfsdetach(struct knote *kn)
{
struct vnode *vp = (struct vnode *)kn->kn_hook;
klist_remove_locked(&vp->v_selectinfo.si_note, kn);
klist_remove_locked(&vp->v_klist, kn);
/* Remove the vnode from watch list */
if ((kn->kn_flags & (__EV_POLL | __EV_SELECT)) == 0)
@ -342,7 +342,7 @@ nfs_kqfilter(void *v)
return (error);
}
klist_insert_locked(&vp->v_selectinfo.si_note, kn);
klist_insert_locked(&vp->v_klist, kn);
return (0);
}

View file

@ -1,4 +1,4 @@
/* $OpenBSD: vnode.h,v 1.168 2023/02/10 14:34:17 visa Exp $ */
/* $OpenBSD: vnode.h,v 1.169 2023/09/08 20:00:28 mvs Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
@ -37,8 +37,8 @@
#include <sys/buf.h>
#include <sys/types.h>
#include <sys/event.h>
#include <sys/queue.h>
#include <sys/selinfo.h>
#include <sys/tree.h>
/*
@ -127,7 +127,7 @@ struct vnode {
TAILQ_HEAD(, namecache) v_cache_dst; /* cache entries to us */
void *v_data; /* private data for fs */
struct selinfo v_selectinfo; /* identity of poller(s) */
struct klist v_klist; /* identity of poller(s) */
};
#define v_mountedhere v_un.vu_mountedhere
#define v_socket v_un.vu_socket
@ -246,7 +246,7 @@ extern int vttoif_tab[];
#define VATTR_NULL(vap) vattr_null(vap)
#define NULLVP ((struct vnode *)NULL)
#define VN_KNOTE(vp, b) \
knote_locked(&vp->v_selectinfo.si_note, (b))
knote_locked(&vp->v_klist, (b))
/*
* Global vnode data.

View file

@ -1,4 +1,4 @@
/* $OpenBSD: tmpfs_vnops.c,v 1.52 2022/06/26 05:20:42 visa Exp $ */
/* $OpenBSD: tmpfs_vnops.c,v 1.53 2023/09/08 20:00:28 mvs Exp $ */
/* $NetBSD: tmpfs_vnops.c,v 1.100 2012/11/05 17:27:39 dholland Exp $ */
/*
@ -2627,7 +2627,7 @@ tmpfs_kqfilter(void *v)
kn->kn_hook = (caddr_t)vp;
klist_insert_locked(&vp->v_selectinfo.si_note, kn);
klist_insert_locked(&vp->v_klist, kn);
return (0);
}
@ -2637,7 +2637,7 @@ filt_tmpfsdetach(struct knote *kn)
{
struct vnode *vp = (struct vnode *)kn->kn_hook;
klist_remove_locked(&vp->v_selectinfo.si_note, kn);
klist_remove_locked(&vp->v_klist, kn);
}
int

View file

@ -1,4 +1,4 @@
/* $OpenBSD: ufs_vnops.c,v 1.157 2023/03/08 04:43:09 guenther Exp $ */
/* $OpenBSD: ufs_vnops.c,v 1.158 2023/09/08 20:00:28 mvs Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */
/*
@ -1921,7 +1921,7 @@ ufs_kqfilter(void *v)
kn->kn_hook = (caddr_t)vp;
klist_insert_locked(&vp->v_selectinfo.si_note, kn);
klist_insert_locked(&vp->v_klist, kn);
return (0);
}
@ -1931,7 +1931,7 @@ filt_ufsdetach(struct knote *kn)
{
struct vnode *vp = (struct vnode *)kn->kn_hook;
klist_remove_locked(&vp->v_selectinfo.si_note, kn);
klist_remove_locked(&vp->v_klist, kn);
}
int