git: 027fda80fe8b - main - inpcb: remove unused KPIs to manipulate inpcbs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 18 Mar 2024 15:52:59 UTC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=027fda80fe8b8f7f76c9e1799753601674954901 commit 027fda80fe8b8f7f76c9e1799753601674954901 Author: Gleb Smirnoff <glebius@FreeBSD.org> AuthorDate: 2024-03-18 15:49:39 +0000 Commit: Gleb Smirnoff <glebius@FreeBSD.org> CommitDate: 2024-03-18 15:49:39 +0000 inpcb: remove unused KPIs to manipulate inpcbs These KPIs were added in 9d29c635daa69 and through 15 years had zero use. They slightly remind what IfAPI does for struct ifnet. But IfAPI does that for the sake of large collection of NIC drivers not being aware of struct ifnet. For the inpcb it is unclear what could be a large collection of externally written kernel modules that need extensively use inpcb and not be aware of its internals at the same time. This isolation of a structure knowledge requires a lot of work, and just throwing in a few KPIs isn't helpful. Reviewed by: kib, bz, markj Differential Revision: https://reviews.freebsd.org/D44310 --- sys/netinet/in_pcb.c | 22 ---------------------- sys/netinet/in_pcb.h | 4 ---- sys/netinet/toecore.h | 1 + 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 981654577deb..16a3707e7c89 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -2835,28 +2835,6 @@ inp_inpcbtosocket(struct inpcb *inp) return (inp->inp_socket); } -struct tcpcb * -inp_inpcbtotcpcb(struct inpcb *inp) -{ - - INP_WLOCK_ASSERT(inp); - return ((struct tcpcb *)inp->inp_ppcb); -} - -int -inp_ip_tos_get(const struct inpcb *inp) -{ - - return (inp->inp_ip_tos); -} - -void -inp_ip_tos_set(struct inpcb *inp, int val) -{ - - inp->inp_ip_tos = val; -} - void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, uint32_t *faddr, uint16_t *fp) diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 3d633741dc27..7e9de02b0c7c 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -479,12 +479,8 @@ void inp_unlock_assert(struct inpcb *); void inp_apply_all(struct inpcbinfo *, void (*func)(struct inpcb *, void *), void *arg); -int inp_ip_tos_get(const struct inpcb *inp); -void inp_ip_tos_set(struct inpcb *inp, int val); struct socket * inp_inpcbtosocket(struct inpcb *inp); -struct tcpcb * - inp_inpcbtotcpcb(struct inpcb *inp); void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, uint32_t *faddr, uint16_t *fp); diff --git a/sys/netinet/toecore.h b/sys/netinet/toecore.h index a8e5afd6b50a..612c2fe1caf5 100644 --- a/sys/netinet/toecore.h +++ b/sys/netinet/toecore.h @@ -36,6 +36,7 @@ #include <netinet/tcp.h> #include <sys/_eventhandler.h> +struct tcpcb; struct tcpopt; struct tcphdr; struct in_conninfo;