[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 2 Mar 2020 20:18:02 -0800
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Andrii Nakryiko <andriin@...com>, bpf <bpf@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH bpf-next 1/3] bpf: introduce pinnable bpf_link abstraction
On Mon, Mar 2, 2020 at 6:50 PM Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
>
> On Fri, Feb 28, 2020 at 02:39:46PM -0800, Andrii Nakryiko wrote:
> >
> > +int bpf_link_new_fd(struct bpf_link *link)
> > +{
> > + return anon_inode_getfd("bpf-link", &bpf_link_fops, link, O_CLOEXEC);
> > +}
> ...
> > - tr_fd = anon_inode_getfd("bpf-tracing-prog", &bpf_tracing_prog_fops,
> > - prog, O_CLOEXEC);
> > + tr_fd = anon_inode_getfd("bpf-tracing-link", &bpf_link_fops,
> > + &link->link, O_CLOEXEC);
> ...
> > - tp_fd = anon_inode_getfd("bpf-raw-tracepoint", &bpf_raw_tp_fops, raw_tp,
> > - O_CLOEXEC);
> > + tp_fd = anon_inode_getfd("bpf-raw-tp-link", &bpf_link_fops,
> > + &raw_tp->link, O_CLOEXEC);
>
> I don't think different names are strong enough reason to open code it.
> I think bpf_link_new_fd() should be used in all cases.
Oh, this got simplified from initial implementation after few rounds
of refactorings and I didn't notice that now I can just use
bpf_link_new_fd() here. Will update.
Powered by blists - more mailing lists