git: b0580c7a6742 - main - sockets: remove empty shim function sopoll()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 03 Feb 2025 06:41:33 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=b0580c7a67423efb0c2bff7081ff9747d257c830
commit b0580c7a67423efb0c2bff7081ff9747d257c830
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2025-02-03 05:46:13 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2025-02-03 06:38:28 +0000
sockets: remove empty shim function sopoll()
---
sys/kern/sys_generic.c | 3 ++-
sys/kern/sys_socket.c | 2 +-
sys/kern/uipc_socket.c | 15 ++-------------
sys/sys/socketvar.h | 1 -
4 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index a3722d771573..dd9c28e81388 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -49,6 +49,7 @@
#include <sys/lock.h>
#include <sys/proc.h>
#include <sys/signalvar.h>
+#include <sys/protosw.h>
#include <sys/socketvar.h>
#include <sys/uio.h>
#include <sys/eventfd.h>
@@ -1817,7 +1818,7 @@ selsocket(struct socket *so, int events, struct timeval *tvp, struct thread *td)
*/
for (;;) {
selfdalloc(td, NULL);
- if (sopoll(so, events, td) != 0) {
+ if (so->so_proto->pr_sopoll(so, events, td) != 0) {
error = 0;
break;
}
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index ec9fd615685b..33cfd1637b78 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -288,7 +288,7 @@ soo_poll(struct file *fp, int events, struct ucred *active_cred,
if (error)
return (error);
#endif
- return (sopoll(so, events, td));
+ return (so->so_proto->pr_sopoll(so, events, td));
}
static int
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index accd63642024..c4ebb43eef18 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -96,8 +96,8 @@
* NOTE: With regard to VNETs the general rule is that callers do not set
* curvnet. Exceptions to this rule include soabort(), sodisconnect(),
* sofree(), sorele(), sonewconn() and sorflush(), which are usually called
- * from a pre-set VNET context. sopoll() currently does not need a VNET
- * context to be set.
+ * from a pre-set VNET context. sopoll_generic() currently does not need a
+ * VNET context to be set.
*/
#include <sys/cdefs.h>
@@ -4404,17 +4404,6 @@ sohasoutofband(struct socket *so)
selwakeuppri(&so->so_rdsel, PSOCK);
}
-int
-sopoll(struct socket *so, int events, struct thread *td)
-{
-
- /*
- * We do not need to set or assert curvnet as long as everyone uses
- * sopoll_generic().
- */
- return (so->so_proto->pr_sopoll(so, events, td));
-}
-
int
sopoll_generic(struct socket *so, int events, struct thread *td)
{
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 57209ea5557f..6e2eb64ea0b8 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -525,7 +525,6 @@ struct socket *
sonewconn(struct socket *head, int connstatus);
struct socket *
sopeeloff(struct socket *);
-int sopoll(struct socket *so, int events, struct thread *td);
int sopoll_generic(struct socket *so, int events, struct thread *td);
int soreceive(struct socket *so, struct sockaddr **paddr, struct uio *uio,
struct mbuf **mp0, struct mbuf **controlp, int *flagsp);