Module Name: src Committed By: thorpej Date: Fri Dec 18 02:54:34 UTC 2020
Modified Files: src/sys/dev/putter: putter.c Log Message: Use sel{record,remove}_knote(). To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/sys/dev/putter/putter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/putter/putter.c diff -u src/sys/dev/putter/putter.c:1.37 src/sys/dev/putter/putter.c:1.38 --- src/sys/dev/putter/putter.c:1.37 Thu Nov 30 20:25:55 2017 +++ src/sys/dev/putter/putter.c Fri Dec 18 02:54:34 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: putter.c,v 1.37 2017/11/30 20:25:55 christos Exp $ */ +/* $NetBSD: putter.c,v 1.38 2020/12/18 02:54:34 thorpej Exp $ */ /* * Copyright (c) 2006, 2007 Antti Kantee. All Rights Reserved. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: putter.c,v 1.37 2017/11/30 20:25:55 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: putter.c,v 1.38 2020/12/18 02:54:34 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -463,7 +463,7 @@ filt_putterdetach(struct knote *kn) KERNEL_LOCK(1, NULL); mutex_enter(&pi_mtx); - SLIST_REMOVE(&pi->pi_sel.sel_klist, kn, knote, kn_selnext); + selremove_knote(&pi->pi_sel, kn); mutex_exit(&pi_mtx); KERNEL_UNLOCK_ONE(NULL); } @@ -502,18 +502,16 @@ static int putter_fop_kqfilter(file_t *fp, struct knote *kn) { struct putter_instance *pi = fp->f_data; - struct klist *klist; KERNEL_LOCK(1, NULL); switch (kn->kn_filter) { case EVFILT_READ: - klist = &pi->pi_sel.sel_klist; kn->kn_fop = &putter_filtops; kn->kn_hook = pi; mutex_enter(&pi_mtx); - SLIST_INSERT_HEAD(klist, kn, kn_selnext); + selrecord_knote(&pi->pi_sel, kn); mutex_exit(&pi_mtx); break;