All of lore.kernel.org
 help / color / mirror / Atom feed
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;
>   


  reply	other threads:[~2025-06-16  4:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-15  0:30 [PATCH] landlock: opened file never has a negative dentry Al Viro
2025-06-15  0:31 ` [PATCH] apparmor: file never has NULL f_path.mnt Al Viro
2025-06-15  0:32   ` [PATCH] don't duplicate vfs_open() in kernel_file_open() Al Viro
2025-06-15  0:33     ` [PATCH] proc_fd_getattr(): don't bother with S_ISDIR() check Al Viro
2025-06-15  0:35       ` [PATCH] secretmem: move setting O_LARGEFILE and bumping users' count to the place where we create the file Al Viro
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
2025-06-15 21:46         ` [PATCH] secretmem: move setting O_LARGEFILE and bumping users' count to the place where we create the file Andrew Morton
2025-06-16  3:00           ` Mike Rapoport
2025-06-16 14:21       ` (subset) [PATCH] proc_fd_getattr(): don't bother with S_ISDIR() check Christian Brauner
2025-06-15  2:03     ` [PATCH] binder_ioctl_write_read(): simplify control flow a bit Al Viro
2025-06-16 10:20       ` Greg Kroah-Hartman
2025-06-16 14:17     ` [PATCH] don't duplicate vfs_open() in kernel_file_open() Christian Brauner
2025-06-16 14:18     ` (subset) " Christian Brauner
2025-06-15  2:01   ` [PATCH] selinuxfs_fill_super(): don't bother with selinuxfs_info_free() on failures Al Viro
2025-06-16 14:19     ` Christian Brauner
2025-06-24 23:44     ` Paul Moore
2025-06-25  0:57       ` Al Viro
2025-06-16 14:16   ` [PATCH] apparmor: file never has NULL f_path.mnt Christian Brauner
2025-06-16 15:36     ` Ryan Lee
2025-06-16 14:16 ` [PATCH] landlock: opened file never has a negative dentry Christian Brauner
2025-06-17 10:03 ` Mickaël Salaün

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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.