From: Yonghong Song <yonghong.song@linux.dev>
To: Al Viro <viro@zeniv.linux.org.uk>, linux-fsdevel@vger.kernel.org
Cc: Christian Brauner <brauner@kernel.org>, bpf@vger.kernel.org
Subject: Re: [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file()
Date: Sun, 15 Jun 2025 21:51:25 -0700 [thread overview]
Message-ID: <1c0723d6-952d-4475-a2be-59f2871fccf1@linux.dev> (raw)
In-Reply-To: <20250615004719.GE3011112@ZenIV>
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;
>
next prev parent reply other threads:[~2025-06-16 4:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1c0723d6-952d-4475-a2be-59f2871fccf1@linux.dev \
--to=yonghong.song@linux.dev \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox