git: eac7f0798b28 - main - unix: garbage collect unp_dispose_mbuf() for brevity
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 17 May 2022 17:11:57 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=eac7f0798b2837d1389ab2bfbf53d08c7f80aca2
commit eac7f0798b2837d1389ab2bfbf53d08c7f80aca2
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-05-17 17:10:41 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-05-17 17:10:41 +0000
unix: garbage collect unp_dispose_mbuf() for brevity
---
sys/kern/uipc_usrreq.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 556a1de142d4..e89d7567fcda 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -296,7 +296,6 @@ static int unp_connectat(int, struct socket *, struct sockaddr *,
static void unp_connect2(struct socket *so, struct socket *so2, int);
static void unp_disconnect(struct unpcb *unp, struct unpcb *unp2);
static void unp_dispose(struct socket *so);
-static void unp_dispose_mbuf(struct mbuf *);
static void unp_shutdown(struct unpcb *);
static void unp_drop(struct unpcb *);
static void unp_gc(__unused void *, int);
@@ -1160,7 +1159,7 @@ uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
UNP_PCB_UNLOCK(unp);
}
if (control != NULL && error != 0)
- unp_dispose_mbuf(control);
+ unp_scan(control, unp_freerights);
release:
if (control != NULL)
@@ -2744,14 +2743,6 @@ unp_gc(__unused void *arg, int pending)
free(unref, M_TEMP);
}
-static void
-unp_dispose_mbuf(struct mbuf *m)
-{
-
- if (m)
- unp_scan(m, unp_freerights);
-}
-
/*
* Synchronize against unp_gc, which can trip over data as we are freeing it.
*/
@@ -2783,7 +2774,7 @@ unp_dispose(struct socket *so)
SOCK_IO_RECV_UNLOCK(so);
if (m != NULL) {
- unp_dispose_mbuf(m);
+ unp_scan(m, unp_freerights);
m_freem(m);
}
}