git: 3454a7caa053 - main - kqueue: retire knlist_init_rw_reader()

From: Robert Wing <rew_at_FreeBSD.org>
Date: Sun, 21 Aug 2022 05:23:34 UTC
The branch main has been updated by rew:

URL: https://cgit.FreeBSD.org/src/commit/?id=3454a7caa053a2f44ad20216f908f472e9d43f1e

commit 3454a7caa053a2f44ad20216f908f472e9d43f1e
Author:     Robert Wing <rew@FreeBSD.org>
AuthorDate: 2022-08-21 05:17:39 +0000
Commit:     Robert Wing <rew@FreeBSD.org>
CommitDate: 2022-08-21 05:17:39 +0000

    kqueue: retire knlist_init_rw_reader()
    
    Last usage was removed in afa85850e79c1839ec33efa1138206687b952cfa.
    
    Reviewed by:    pauamma, melifaro, kib
    Differential Revision:  https://reviews.freebsd.org/D36205
---
 ObsoleteFiles.inc       |  3 +++
 share/man/man9/Makefile |  1 -
 share/man/man9/kqueue.9 | 24 ++++--------------------
 sys/kern/kern_event.c   | 33 ---------------------------------
 sys/sys/event.h         |  1 -
 5 files changed, 7 insertions(+), 55 deletions(-)

diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index d7b622bc496c..66aa0c9c807d 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -52,6 +52,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20220820: remove knlist_init_rw_reader()
+OLD_FILES+=usr/share/man/man9/knlist_init_rw_reader.9.gz
+
 # 20220813: minigzip(1) removed in favor of gzip(1)
 OLD_FILES+=usr/bin/minigzip
 OLD_FILES+=usr/share/man/man1/minigzip.1.gz
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 1913f03a48fd..b99575b595ed 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1366,7 +1366,6 @@ MLINKS+=kqueue.9 knlist_add.9 \
 	kqueue.9 knlist_empty.9 \
 	kqueue.9 knlist_init.9 \
 	kqueue.9 knlist_init_mtx.9 \
-	kqueue.9 knlist_init_rw_reader.9 \
 	kqueue.9 knlist_remove.9 \
 	kqueue.9 knlist_remove_inevent.9 \
 	kqueue.9 knote_fdclose.9 \
diff --git a/share/man/man9/kqueue.9 b/share/man/man9/kqueue.9
index 53f55b8efe03..15a430d4a5a3 100644
--- a/share/man/man9/kqueue.9
+++ b/share/man/man9/kqueue.9
@@ -24,14 +24,14 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 12, 2021
+.Dd August 20, 2022
 .Dt KQUEUE 9
 .Os
 .Sh NAME
 .Nm kqueue_add_filteropts , kqueue_del_filteropts ,
 .Nm kqfd_register ,
 .Nm knote_fdclose ,
-.Nm knlist_init , knlist_init_mtx , knlist_init_rw_reader ,
+.Nm knlist_init , knlist_init_mtx ,
 .Nm knlist_add , knlist_remove , knlist_remove_inevent , knlist_empty ,
 .Nm knlist_clear , knlist_delete , knlist_destroy ,
 .Nm KNOTE_LOCKED , KNOTE_UNLOCKED
@@ -57,8 +57,6 @@
 .Ft void
 .Fn knlist_init_mtx "struct knlist *knl" "struct mtx *lock"
 .Ft void
-.Fn knlist_init_rw_reader "struct knlist *knl" "struct rwlock *lock"
-.Ft void
 .Fn knlist_add "struct knlist *knl" "struct knote *kn" "int islocked"
 .Ft void
 .Fn knlist_remove "struct knlist *knl" "struct knote *kn" "int islocked"
@@ -260,10 +258,9 @@ is not required, but is commonly used.
 If used, the
 .Vt knlist
 must be initialized with either
-.Fn knlist_init ,
-.Fn knlist_init_mtx
+.Fn knlist_init
 or
-.Fn knlist_init_rw_reader .
+.Fn knlist_init_mtx .
 The
 .Vt knlist
 structure may be embedded into the object structure.
@@ -308,19 +305,6 @@ style
 lock.
 .Pp
 The function
-.Fn knlist_init_rw_reader
-may be used to initialize a
-.Vt knlist
-when
-.Fa lock
-is a
-.Xr rwlock 9
-read lock.
-Lock is acquired via
-.Fn rw_rlock
-function.
-.Pp
-The function
 .Fn knlist_empty
 returns true when there are no
 .Vt knotes
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 5b24741028a9..f952a5f00340 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/limits.h>
 #include <sys/lock.h>
 #include <sys/mutex.h>
-#include <sys/rwlock.h>
 #include <sys/proc.h>
 #include <sys/malloc.h>
 #include <sys/unistd.h>
@@ -2506,30 +2505,6 @@ knlist_mtx_assert_lock(void *arg, int what)
 		mtx_assert((struct mtx *)arg, MA_NOTOWNED);
 }
 
-static void
-knlist_rw_rlock(void *arg)
-{
-
-	rw_rlock((struct rwlock *)arg);
-}
-
-static void
-knlist_rw_runlock(void *arg)
-{
-
-	rw_runlock((struct rwlock *)arg);
-}
-
-static void
-knlist_rw_assert_lock(void *arg, int what)
-{
-
-	if (what == LA_LOCKED)
-		rw_assert((struct rwlock *)arg, RA_LOCKED);
-	else
-		rw_assert((struct rwlock *)arg, RA_UNLOCKED);
-}
-
 void
 knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *),
     void (*kl_unlock)(void *),
@@ -2575,14 +2550,6 @@ knlist_alloc(struct mtx *lock)
 	return (knl);
 }
 
-void
-knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock)
-{
-
-	knlist_init(knl, lock, knlist_rw_rlock, knlist_rw_runlock,
-	    knlist_rw_assert_lock);
-}
-
 void
 knlist_destroy(struct knlist *knl)
 {
diff --git a/sys/sys/event.h b/sys/sys/event.h
index 05eddfd681b1..1007b88828ae 100644
--- a/sys/sys/event.h
+++ b/sys/sys/event.h
@@ -337,7 +337,6 @@ int	knlist_empty(struct knlist *knl);
 void	knlist_init(struct knlist *knl, void *lock, void (*kl_lock)(void *),
 	    void (*kl_unlock)(void *), void (*kl_assert_lock)(void *, int));
 void	knlist_init_mtx(struct knlist *knl, struct mtx *lock);
-void	knlist_init_rw_reader(struct knlist *knl, struct rwlock *lock);
 void	knlist_destroy(struct knlist *knl);
 void	knlist_cleardel(struct knlist *knl, struct thread *td,
 	    int islocked, int killkn);