pid: add pidfd_get_task() helper
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 11 Oct 2021 13:32:44 +0000 (15:32 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 14 Oct 2021 11:29:18 +0000 (13:29 +0200)
commite9bdcdbf6936dd1fbf419e00222dc9038b7812c2
tree1eabd32a68976f36fb256ad3c4b9723412adcea8
parent64570fbc14f8d7cb3fe3995f20e26bc25ce4b2cc
pid: add pidfd_get_task() helper

The number of system calls making use of pidfds is constantly
increasing. Some of those new system calls duplicate the code to turn a
pidfd into task_struct it refers to. Give them a simple helper for this.

Link: https://lore.kernel.org/r/20211004125050.1153693-2-christian.brauner@ubuntu.com
Link: https://lore.kernel.org/r/20211011133245.1703103-2-brauner@kernel.org
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Matthew Bobrowski <repnop@google.com>
Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Minchan Kim <minchan@kernel.org>
Reviewed-by: Matthew Bobrowski <repnop@google.com>
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
include/linux/pid.h
kernel/pid.c