inpcb: garbage collect INP_LOCK_INIT(), used only once in sctp

Reviewed by:		tuexen
Differential revision:	https://reviews.freebsd.org/D33543
This commit is contained in:
Gleb Smirnoff 2022-01-03 10:20:30 -08:00
parent fec8a8c7cb
commit afad340a14
2 changed files with 2 additions and 3 deletions

View File

@ -501,8 +501,6 @@ struct inpcblbgroup {
struct inpcb *il_inp[]; /* (h) */ 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_LOCK_DESTROY(inp) rw_destroy(&(inp)->inp_lock)
#define INP_RLOCK(inp) rw_rlock(&(inp)->inp_lock) #define INP_RLOCK(inp) rw_rlock(&(inp)->inp_lock)
#define INP_WLOCK(inp) rw_wlock(&(inp)->inp_lock) #define INP_WLOCK(inp) rw_wlock(&(inp)->inp_lock)

View File

@ -2498,7 +2498,8 @@ sctp_inpcb_alloc(struct socket *so, uint32_t vrf_id)
SCTP_INP_INFO_WLOCK(); SCTP_INP_INFO_WLOCK();
SCTP_INP_LOCK_INIT(inp); 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_INP_READ_INIT(inp);
SCTP_ASOC_CREATE_LOCK_INIT(inp); SCTP_ASOC_CREATE_LOCK_INIT(inp);
/* lock the new ep */ /* lock the new ep */