summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2025-10-15 14:36:33 +0200
committerChristian Brauner <brauner@kernel.org>2026-02-10 11:39:31 +0100
commit84f90ab5d3e859cced1d7b080adc4ea562ca2eaa (patch)
treed5852201267bb4468067c9471179b15bafb0b6db
parent1cf2e88e0651dbd5fb7f5651c32d617de759b855 (diff)
pid: introduce task_ppid_vnr() helper
Cosmetic change. Unlike all other similar helpers task_ppid_nr_ns() doesn't have a _vnr() version; add one for consistency. Signed-off-by: Oleg Nesterov <oleg@redhat.com> Link: https://patch.msgid.link/20251015123633.GB9456@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--fs/pidfs.c2
-rw-r--r--include/linux/pid.h5
2 files changed, 6 insertions, 1 deletions
diff --git a/fs/pidfs.c b/fs/pidfs.c
index b984d0e95734..e21205c2fd12 100644
--- a/fs/pidfs.c
+++ b/fs/pidfs.c
@@ -446,7 +446,7 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg)
* the fields are set correctly, or return ESRCH to avoid providing
* incomplete information. */
- kinfo.ppid = task_ppid_nr_ns(task, NULL);
+ kinfo.ppid = task_ppid_vnr(task);
kinfo.tgid = task_tgid_vnr(task);
kinfo.pid = task_pid_vnr(task);
kinfo.mask |= PIDFD_INFO_PID;
diff --git a/include/linux/pid.h b/include/linux/pid.h
index ce9b5cb7560b..ddaef0bbc8ba 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -310,6 +310,11 @@ static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_na
return pid;
}
+static inline pid_t task_ppid_vnr(const struct task_struct *tsk)
+{
+ return task_ppid_nr_ns(tsk, NULL);
+}
+
static inline pid_t task_ppid_nr(const struct task_struct *tsk)
{
return task_ppid_nr_ns(tsk, &init_pid_ns);