]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/fork.c
Merge tag 'iommu-updates-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro...
[linux.git] / kernel / fork.c
index 541fd805fb8882f93ac104f9020ee90adc78dd6b..0ad65a932936d62ea5dd82f2e48c74bc31b2ffc6 100644 (file)
@@ -1690,6 +1690,14 @@ static inline void rcu_copy_process(struct task_struct *p)
 #endif /* #ifdef CONFIG_TASKS_RCU */
 }
 
+struct pid *pidfd_pid(const struct file *file)
+{
+       if (file->f_op == &pidfd_fops)
+               return file->private_data;
+
+       return ERR_PTR(-EBADF);
+}
+
 static int pidfd_release(struct inode *inode, struct file *file)
 {
        struct pid *pid = file->private_data;