From: Jonathan Lemon Date: Fri, 18 Dec 2020 18:50:31 +0000 (-0800) Subject: bpf: Use thread_group_leader() X-Git-Tag: microblaze-v5.13~439^2~13^2 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=a61daaf351da7c8493f2586437617d60c24350b0;p=linux-2.6-microblaze.git 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: Jonathan Lemon Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20201218185032.2464558-3-jonathan.lemon@gmail.com --- diff --git a/kernel/bpf/task_iter.c b/kernel/bpf/task_iter.c index 8033ab19138a..dc4007f1843b 100644 --- a/kernel/bpf/task_iter.c +++ b/kernel/bpf/task_iter.c @@ -37,7 +37,7 @@ retry: if (!task) { ++*tid; 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) { put_task_struct(task); task = NULL;