From nobody Mon Jan 3 18:23:00 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BFBA1191D4BF; Mon, 3 Jan 2022 18:23:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JSPHm56Jmz3F5F; Mon, 3 Jan 2022 18:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F6D51EDC; Mon, 3 Jan 2022 18:23:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 203IN0oF026374; Mon, 3 Jan 2022 18:23:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 203IN07w026373; Mon, 3 Jan 2022 18:23:00 GMT (envelope-from git) Date: Mon, 3 Jan 2022 18:23:00 GMT Message-Id: <202201031823.203IN07w026373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: afad340a14f8 - main - inpcb: garbage collect INP_LOCK_INIT(), used only once in sctp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: afad340a14f85b6519fd2bd2b0dd47153eb18a99 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641234181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tIhsm2CM1TTL0y6mMRB5T18GidrledUBXCsQCDtO5Zc=; b=dmMvfwZGMO7NLzPEnYB9eEJ41OgVNsSxrA6HDkHJiZS6TXKr4e0TEzgIVcvx0TbfRsWik9 R8X3MYAGaBxHiVWsSs9KGT6wF2ldqUefdUKTZF84VxZUYLdYCJqYwlUqsOcAFil022/YaF r5Y1dhwG+sxMkioukyRjkeNA8xuzOaqgstdBKtA6PcUArGf6QIzt9T2dXAr/sPDuX/eUac Ooy6Y2cTwrnoOUCj2Uk2iLTpK4LSywfUBrNa/QSAGWvrlHfv6sEloQ9H7wVI6wNjjpBLle BUWz/+uOlQooHt8OGvfdgzB/SI3vGHh4EWhQCFsVxgFuZSyVeRaWISTKF7ajWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641234181; a=rsa-sha256; cv=none; b=a0luHuINR7dfFtejv9K6zNXX3wW9e1KJdAwkOCZKgm3gEfjM+j7vKgFPAd9W+g9ZLSSH5j rsSZSNfEMPPp4bcdsNIstutwySC7F36obKDdGkxV7Q0o+BFaKfZZQQz2OgXLxGlXcOfsXO CMwBWuEhXZWuO/AXs/7wsfjcNq70lRMA4CTsRjGtvFuQpCdNvnUqC7h53KEZoBiPgLiGNC kTMn8au/K4nfP0Y3VQpdmczXhG7Urv4mZu6qO2Tv2yMSiNQ6FI4inQqbQeAO6QBpKqI0zy z2UFQ3o3IiJtmWwcdyE34iTa51GOSVnCK19xjqdEs1T/Nyf5cp8TTvC2VXw5GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=afad340a14f85b6519fd2bd2b0dd47153eb18a99 commit afad340a14f85b6519fd2bd2b0dd47153eb18a99 Author: Gleb Smirnoff AuthorDate: 2022-01-03 18:20:30 +0000 Commit: Gleb Smirnoff 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 */