mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
UPSTREAM: bpf: Refactor to provide aux info to bpf_iter_init_seq_priv_t
This patch refactored target bpf_iter_init_seq_priv_t callback function to accept additional information. This will be needed in later patches for map element targets since a particular map should be passed to traverse elements for that particular map. In the future, other information may be passed to target as well, e.g., pid, cgroup id, etc. to customize the iterator. Change-Id: I3676c634f448874f4d6f12b2199915972a158d10 Signed-off-by: Yonghong Song <yhs@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20200723184110.590156-1-yhs@fb.com
This commit is contained in:
parent
ecc4d9f640
commit
ccd34e4b58
7 changed files with 15 additions and 9 deletions
|
|
@ -442,7 +442,7 @@ static int prepare_seq_file(struct file *file, struct bpf_iter_link *link)
|
|||
}
|
||||
|
||||
if (tinfo->reg_info->seq_info->init_seq_private) {
|
||||
err = tinfo->reg_info->seq_info->init_seq_private(priv_data->target_private);
|
||||
err = tinfo->reg_info->seq_info->init_seq_private(priv_data->target_private, NULL);
|
||||
if (err)
|
||||
goto release_seq_file;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ static void task_file_seq_stop(struct seq_file *seq, void *v)
|
|||
}
|
||||
}
|
||||
|
||||
static int init_seq_pidns(void *priv_data)
|
||||
static int init_seq_pidns(void *priv_data, struct bpf_iter_aux_info *aux)
|
||||
{
|
||||
struct bpf_iter_seq_task_common *common = priv_data;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue