From nobody Mon Oct 18 18:41:57 2021 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 8FCDB181553C; Mon, 18 Oct 2021 18:41:57 +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 4HY5M93bdGz3t7d; Mon, 18 Oct 2021 18:41:57 +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 5CE8B256FD; Mon, 18 Oct 2021 18:41:57 +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 19IIfvSo037770; Mon, 18 Oct 2021 18:41:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19IIfvA5037769; Mon, 18 Oct 2021 18:41:57 GMT (envelope-from git) Date: Mon, 18 Oct 2021 18:41:57 GMT Message-Id: <202110181841.19IIfvA5037769@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: 9b7501e7977c - main - in_mcast: garbage collect inp_gcmoptions() 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: 9b7501e7977c1f4a0a4a798cdf0af64846009df8 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9b7501e7977c1f4a0a4a798cdf0af64846009df8 commit 9b7501e7977c1f4a0a4a798cdf0af64846009df8 Author: Gleb Smirnoff AuthorDate: 2021-10-18 18:36:07 +0000 Commit: Gleb Smirnoff CommitDate: 2021-10-18 18:36:07 +0000 in_mcast: garbage collect inp_gcmoptions() It is is used only once, merge it into inp_freemoptions(). --- sys/netinet/in_mcast.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index ad2d7af799a5..f307be283e64 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -1588,13 +1588,16 @@ inp_findmoptions(struct inpcb *inp) return (imo); } -static void -inp_gcmoptions(struct ip_moptions *imo) +void +inp_freemoptions(struct ip_moptions *imo) { struct in_mfilter *imf; struct in_multi *inm; struct ifnet *ifp; + if (imo == NULL) + return; + while ((imf = ip_mfilter_first(&imo->imo_head)) != NULL) { ip_mfilter_remove(&imo->imo_head, imf); @@ -1613,20 +1616,6 @@ inp_gcmoptions(struct ip_moptions *imo) free(imo, M_IPMOPTS); } -/* - * Discard the IP multicast options (and source filters). To minimize - * the amount of work done while holding locks such as the INP's - * pcbinfo lock (which is used in the receive path), the free - * operation is deferred to the epoch callback task. - */ -void -inp_freemoptions(struct ip_moptions *imo) -{ - if (imo == NULL) - return; - inp_gcmoptions(imo); -} - /* * Atomically get source filters on a socket for an IPv4 multicast group. * Called with INP lock held; returns with lock released.