Re: [bpf_iter] get rid of redundant 3rd argument of prepare_seq_file()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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@xxxxxxxxxxxxxxxxxx>

LGTM. Thanks for simplifying the code.

Acked-by: Yonghong Song <yonghong.song@xxxxxxxxx>

---
  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;





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux