* [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file()
[not found] ` <20250615003507.GD3011112@ZenIV>
@ 2025-06-15 0:47 ` Al Viro
2025-06-16 4:51 ` Yonghong Song
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Al Viro @ 2025-06-15 0:47 UTC (permalink / raw)
To: linux-fsdevel; +Cc: Christian Brauner, bpf
[don't really care which tree that goes through; right now it's
in viro/vfs.git #work.misc, but if somebody prefers to grab it
through a different tree, just say so]
always equal to __get_seq_info(2nd argument)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
kernel/bpf/bpf_iter.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c
index 380e9a7cac75..303ab1f42d3a 100644
--- a/kernel/bpf/bpf_iter.c
+++ b/kernel/bpf/bpf_iter.c
@@ -38,8 +38,7 @@ static DEFINE_MUTEX(link_mutex);
/* incremented on every opened seq_file */
static atomic64_t session_id;
-static int prepare_seq_file(struct file *file, struct bpf_iter_link *link,
- const struct bpf_iter_seq_info *seq_info);
+static int prepare_seq_file(struct file *file, struct bpf_iter_link *link);
static void bpf_iter_inc_seq_num(struct seq_file *seq)
{
@@ -257,7 +256,7 @@ static int iter_open(struct inode *inode, struct file *file)
{
struct bpf_iter_link *link = inode->i_private;
- return prepare_seq_file(file, link, __get_seq_info(link));
+ return prepare_seq_file(file, link);
}
static int iter_release(struct inode *inode, struct file *file)
@@ -586,9 +585,9 @@ static void init_seq_meta(struct bpf_iter_priv_data *priv_data,
priv_data->done_stop = false;
}
-static int prepare_seq_file(struct file *file, struct bpf_iter_link *link,
- const struct bpf_iter_seq_info *seq_info)
+static int prepare_seq_file(struct file *file, struct bpf_iter_link *link)
{
+ const struct bpf_iter_seq_info *seq_info = __get_seq_info(link);
struct bpf_iter_priv_data *priv_data;
struct bpf_iter_target_info *tinfo;
struct bpf_prog *prog;
@@ -653,7 +652,7 @@ int bpf_iter_new_fd(struct bpf_link *link)
}
iter_link = container_of(link, struct bpf_iter_link, link);
- err = prepare_seq_file(file, iter_link, __get_seq_info(iter_link));
+ err = prepare_seq_file(file, iter_link);
if (err)
goto free_file;
--
2.39.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file()
2025-06-15 0:47 ` [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file() Al Viro
@ 2025-06-16 4:51 ` Yonghong Song
2025-06-17 17:31 ` Alexei Starovoitov
2025-06-18 0:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 6+ messages in thread
From: Yonghong Song @ 2025-06-16 4:51 UTC (permalink / raw)
To: Al Viro, linux-fsdevel; +Cc: Christian Brauner, bpf
On 6/14/25 5:47 PM, Al Viro wrote:
> [don't really care which tree that goes through; right now it's
> in viro/vfs.git #work.misc, but if somebody prefers to grab it
> through a different tree, just say so]
> always equal to __get_seq_info(2nd argument)
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
LGTM. Thanks for simplifying the code.
Acked-by: Yonghong Song <yonghong.song@linux.dev>
> ---
> kernel/bpf/bpf_iter.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c
> index 380e9a7cac75..303ab1f42d3a 100644
> --- a/kernel/bpf/bpf_iter.c
> +++ b/kernel/bpf/bpf_iter.c
> @@ -38,8 +38,7 @@ static DEFINE_MUTEX(link_mutex);
> /* incremented on every opened seq_file */
> static atomic64_t session_id;
>
> -static int prepare_seq_file(struct file *file, struct bpf_iter_link *link,
> - const struct bpf_iter_seq_info *seq_info);
> +static int prepare_seq_file(struct file *file, struct bpf_iter_link *link);
>
> static void bpf_iter_inc_seq_num(struct seq_file *seq)
> {
> @@ -257,7 +256,7 @@ static int iter_open(struct inode *inode, struct file *file)
> {
> struct bpf_iter_link *link = inode->i_private;
>
> - return prepare_seq_file(file, link, __get_seq_info(link));
> + return prepare_seq_file(file, link);
> }
>
> static int iter_release(struct inode *inode, struct file *file)
> @@ -586,9 +585,9 @@ static void init_seq_meta(struct bpf_iter_priv_data *priv_data,
> priv_data->done_stop = false;
> }
>
> -static int prepare_seq_file(struct file *file, struct bpf_iter_link *link,
> - const struct bpf_iter_seq_info *seq_info)
> +static int prepare_seq_file(struct file *file, struct bpf_iter_link *link)
> {
> + const struct bpf_iter_seq_info *seq_info = __get_seq_info(link);
> struct bpf_iter_priv_data *priv_data;
> struct bpf_iter_target_info *tinfo;
> struct bpf_prog *prog;
> @@ -653,7 +652,7 @@ int bpf_iter_new_fd(struct bpf_link *link)
> }
>
> iter_link = container_of(link, struct bpf_iter_link, link);
> - err = prepare_seq_file(file, iter_link, __get_seq_info(iter_link));
> + err = prepare_seq_file(file, iter_link);
> if (err)
> goto free_file;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file()
2025-06-15 0:47 ` [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file() Al Viro
2025-06-16 4:51 ` Yonghong Song
@ 2025-06-17 17:31 ` Alexei Starovoitov
2025-06-17 21:53 ` Al Viro
2025-06-18 0:30 ` patchwork-bot+netdevbpf
2 siblings, 1 reply; 6+ messages in thread
From: Alexei Starovoitov @ 2025-06-17 17:31 UTC (permalink / raw)
To: Al Viro; +Cc: Linux-Fsdevel, Christian Brauner, bpf
On Sat, Jun 14, 2025 at 5:47 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> [don't really care which tree that goes through; right now it's
> in viro/vfs.git #work.misc, but if somebody prefers to grab it
> through a different tree, just say so]
> always equal to __get_seq_info(2nd argument)
We'll take it through bpf-next,
but it needs a proper commit log that explains the motivation.
Just to clean up the code a bit ?
or something else?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file()
2025-06-17 17:31 ` Alexei Starovoitov
@ 2025-06-17 21:53 ` Al Viro
2025-06-18 0:24 ` Alexei Starovoitov
0 siblings, 1 reply; 6+ messages in thread
From: Al Viro @ 2025-06-17 21:53 UTC (permalink / raw)
To: Alexei Starovoitov; +Cc: Linux-Fsdevel, Christian Brauner, bpf
On Tue, Jun 17, 2025 at 10:31:37AM -0700, Alexei Starovoitov wrote:
> On Sat, Jun 14, 2025 at 5:47 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > [don't really care which tree that goes through; right now it's
> > in viro/vfs.git #work.misc, but if somebody prefers to grab it
> > through a different tree, just say so]
> > always equal to __get_seq_info(2nd argument)
>
> We'll take it through bpf-next,
> but it needs a proper commit log that explains the motivation.
> Just to clean up the code a bit ?
> or something else?
Umm... It had been sitting around for a couple of years, but IIRC
that was from doing data flow analysis for bpf_iter_seq_info.
I really don't remember details of that code audit, so just chalk
it up to cleaning the code up a bit.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file()
2025-06-17 21:53 ` Al Viro
@ 2025-06-18 0:24 ` Alexei Starovoitov
0 siblings, 0 replies; 6+ messages in thread
From: Alexei Starovoitov @ 2025-06-18 0:24 UTC (permalink / raw)
To: Al Viro; +Cc: Linux-Fsdevel, Christian Brauner, bpf
On Tue, Jun 17, 2025 at 2:53 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
>
> On Tue, Jun 17, 2025 at 10:31:37AM -0700, Alexei Starovoitov wrote:
> > On Sat, Jun 14, 2025 at 5:47 PM Al Viro <viro@zeniv.linux.org.uk> wrote:
> > >
> > > [don't really care which tree that goes through; right now it's
> > > in viro/vfs.git #work.misc, but if somebody prefers to grab it
> > > through a different tree, just say so]
> > > always equal to __get_seq_info(2nd argument)
> >
> > We'll take it through bpf-next,
> > but it needs a proper commit log that explains the motivation.
> > Just to clean up the code a bit ?
> > or something else?
>
> Umm... It had been sitting around for a couple of years, but IIRC
> that was from doing data flow analysis for bpf_iter_seq_info.
> I really don't remember details of that code audit, so just chalk
> it up to cleaning the code up a bit.
Applied to bpf-next.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file()
2025-06-15 0:47 ` [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file() Al Viro
2025-06-16 4:51 ` Yonghong Song
2025-06-17 17:31 ` Alexei Starovoitov
@ 2025-06-18 0:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-18 0:30 UTC (permalink / raw)
To: Al Viro; +Cc: linux-fsdevel, brauner, bpf
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Sun, 15 Jun 2025 01:47:19 +0100 you wrote:
> [don't really care which tree that goes through; right now it's
> in viro/vfs.git #work.misc, but if somebody prefers to grab it
> through a different tree, just say so]
> always equal to __get_seq_info(2nd argument)
>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
>
> [...]
Here is the summary with links:
- [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file()
https://git.kernel.org/bpf/bpf-next/c/f5527f0171f0
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-06-18 0:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20250615003011.GD1880847@ZenIV>
[not found] ` <20250615003110.GA3011112@ZenIV>
[not found] ` <20250615003216.GB3011112@ZenIV>
[not found] ` <20250615003321.GC3011112@ZenIV>
[not found] ` <20250615003507.GD3011112@ZenIV>
2025-06-15 0:47 ` [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file() Al Viro
2025-06-16 4:51 ` Yonghong Song
2025-06-17 17:31 ` Alexei Starovoitov
2025-06-17 21:53 ` Al Viro
2025-06-18 0:24 ` Alexei Starovoitov
2025-06-18 0:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox