Commit a61daaf3 authored by Jonathan Lemon's avatar Jonathan Lemon Committed by Daniel Borkmann

bpf: Use thread_group_leader()

Instead of directly comparing task->tgid and task->pid, use the
thread_group_leader() helper.  This helps with readability, and
there should be no functional change.
Signed-off-by: default avatarJonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20201218185032.2464558-3-jonathan.lemon@gmail.com
parent 69ca310f
...@@ -37,7 +37,7 @@ static struct task_struct *task_seq_get_next(struct pid_namespace *ns, ...@@ -37,7 +37,7 @@ static struct task_struct *task_seq_get_next(struct pid_namespace *ns,
if (!task) { if (!task) {
++*tid; ++*tid;
goto retry; goto retry;
} else if (skip_if_dup_files && task->tgid != task->pid && } else if (skip_if_dup_files && !thread_group_leader(task) &&
task->files == task->group_leader->files) { task->files == task->group_leader->files) {
put_task_struct(task); put_task_struct(task);
task = NULL; task = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment