[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aDTDOgqCrVryvr0_@f4>
Date: Mon, 26 May 2025 15:38:34 -0400
From: Benjamin Poirier <benjamin.poirier@...il.com>
To: Xin Long <lucien.xin@...il.com>
Cc: Christoph Hellwig <hch@....de>, marcelo.leitner@...il.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, horms@...nel.org, linux-sctp@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH] sctp: mark sctp_do_peeloff static
On 2025-05-26 14:25 -0400, Xin Long wrote:
> On Mon, May 26, 2025 at 1:47 AM Christoph Hellwig <hch@....de> wrote:
> >
> > sctp_do_peeloff is only used inside of net/sctp/socket.c,
> > so mark it static.
> >
> > Signed-off-by: Christoph Hellwig <hch@....de>
> > ---
> > include/net/sctp/sctp.h | 2 --
> > net/sctp/socket.c | 4 ++--
> > 2 files changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
> > index d8da764cf6de..e96d1bd087f6 100644
> > --- a/include/net/sctp/sctp.h
> > +++ b/include/net/sctp/sctp.h
> > @@ -364,8 +364,6 @@ sctp_assoc_to_state(const struct sctp_association *asoc)
> > /* Look up the association by its id. */
> > struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id);
> >
> > -int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp);
> > -
> > /* A macro to walk a list of skbs. */
> > #define sctp_skb_for_each(pos, head, tmp) \
> > skb_queue_walk_safe(head, pos, tmp)
> > diff --git a/net/sctp/socket.c b/net/sctp/socket.c
> > index 53725ee7ba06..da048e386476 100644
> > --- a/net/sctp/socket.c
> > +++ b/net/sctp/socket.c
> > @@ -5627,7 +5627,8 @@ static int sctp_getsockopt_autoclose(struct sock *sk, int len, char __user *optv
> > }
> >
> > /* Helper routine to branch off an association to a new socket. */
> > -int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
> > +static int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id,
> > + struct socket **sockp)
> > {
> > struct sctp_association *asoc = sctp_id2assoc(sk, id);
> > struct sctp_sock *sp = sctp_sk(sk);
> > @@ -5675,7 +5676,6 @@ int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
> >
> > return err;
> > }
> > -EXPORT_SYMBOL(sctp_do_peeloff);
> >
> I believe sctp_do_peeloff() was exported specifically to allow usage
> outside of the core SCTP code. See:
>
> commit 0343c5543b1d3ffa08e6716d82afb62648b80eba
> Author: Benjamin Poirier <benjamin.poirier@...il.com>
> Date: Thu Mar 8 05:55:58 2012 +0000
>
> sctp: Export sctp_do_peeloff
>
Thanks for digging that up. The purpose was of course for the commit
that followed:
2f2d76cc3e93 dlm: Do not allocate a fd for peeloff (v3.4-rc1)
Since that usage was removed in
ee44b4bc054a dlm: use sctp 1-to-1 API (v4.3-rc1)
I don't see a problem with marking sctp_do_peeloff() static again.
> While there’s no known in-tree usage beyond SCTP itself, we can’t be
> sure whether this function has been used by out-of-tree kernel modules.
The mainline kernel does not need to cater to out-of-tree users.
Powered by blists - more mailing lists