git: afad340a14f8 - main - inpcb: garbage collect INP_LOCK_INIT(), used only once in sctp
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 03 Jan 2022 18:23:00 UTC
The branch main has been updated by glebius:
URL: https://cgit.FreeBSD.org/src/commit/?id=afad340a14f85b6519fd2bd2b0dd47153eb18a99
commit afad340a14f85b6519fd2bd2b0dd47153eb18a99
Author: Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-01-03 18:20:30 +0000
Commit: Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-01-03 18:20:30 +0000
inpcb: garbage collect INP_LOCK_INIT(), used only once in sctp
Reviewed by: tuexen
Differential revision: https://reviews.freebsd.org/D33543
---
sys/netinet/in_pcb.h | 2 --
sys/netinet/sctp_pcb.c | 3 ++-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 1f7efd19e868..49b891e33b15 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -501,8 +501,6 @@ struct inpcblbgroup {
struct inpcb *il_inp[]; /* (h) */
};
-#define INP_LOCK_INIT(inp, d, t) \
- rw_init_flags(&(inp)->inp_lock, (t), RW_RECURSE | RW_DUPOK)
#define INP_LOCK_DESTROY(inp) rw_destroy(&(inp)->inp_lock)
#define INP_RLOCK(inp) rw_rlock(&(inp)->inp_lock)
#define INP_WLOCK(inp) rw_wlock(&(inp)->inp_lock)
diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c
index b7fce09fc661..e1006255204a 100644
--- a/sys/netinet/sctp_pcb.c
+++ b/sys/netinet/sctp_pcb.c
@@ -2498,7 +2498,8 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
SCTP_INP_INFO_WLOCK();
SCTP_INP_LOCK_INIT(inp);
- INP_LOCK_INIT(&inp->ip_inp.inp, "inp", "sctpinp");
+ rw_init_flags(&inp->ip_inp.inp.inp_lock, "sctpinp",
+ RW_RECURSE | RW_DUPOK);
SCTP_INP_READ_INIT(inp);
SCTP_ASOC_CREATE_LOCK_INIT(inp);
/* lock the new ep */