Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/sysmon Use sel{remove,record}_knote().
details: https://anonhg.NetBSD.org/src/rev/27ededa41b2c
branches: trunk
changeset: 957931:27ededa41b2c
user: thorpej <thorpej%NetBSD.org@localhost>
date: Fri Dec 18 01:46:39 2020 +0000
description:
Use sel{remove,record}_knote().
diffstat:
sys/dev/sysmon/sysmon_power.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diffs (54 lines):
diff -r 44c4d82e6f01 -r 27ededa41b2c sys/dev/sysmon/sysmon_power.c
--- a/sys/dev/sysmon/sysmon_power.c Fri Dec 18 01:31:49 2020 +0000
+++ b/sys/dev/sysmon/sysmon_power.c Fri Dec 18 01:46:39 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_power.c,v 1.65 2020/10/30 22:19:18 christos Exp $ */
+/* $NetBSD: sysmon_power.c,v 1.66 2020/12/18 01:46:39 thorpej Exp $ */
/*-
* Copyright (c) 2007 Juan Romero Pardines.
@@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.65 2020/10/30 22:19:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.66 2020/12/18 01:46:39 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -538,8 +538,7 @@
{
mutex_enter(&sysmon_power_event_queue_mtx);
- SLIST_REMOVE(&sysmon_power_event_queue_selinfo.sel_klist,
- kn, knote, kn_selnext);
+ selremove_knote(&sysmon_power_event_queue_selinfo, kn);
mutex_exit(&sysmon_power_event_queue_mtx);
}
@@ -576,16 +575,13 @@
int
sysmonkqfilter_power(dev_t dev, struct knote *kn)
{
- struct klist *klist;
switch (kn->kn_filter) {
case EVFILT_READ:
- klist = &sysmon_power_event_queue_selinfo.sel_klist;
kn->kn_fop = &sysmon_power_read_filtops;
break;
case EVFILT_WRITE:
- klist = &sysmon_power_event_queue_selinfo.sel_klist;
kn->kn_fop = &sysmon_power_write_filtops;
break;
@@ -594,7 +590,7 @@
}
mutex_enter(&sysmon_power_event_queue_mtx);
- SLIST_INSERT_HEAD(klist, kn, kn_selnext);
+ selrecord_knote(&sysmon_power_event_queue_selinfo, kn);
mutex_exit(&sysmon_power_event_queue_mtx);
return 0;
Home |
Main Index |
Thread Index |
Old Index