Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. commit 3eb39f47934f9d5a3027fe00d906a45fe3a15fad
  2. Author: 3eb39f47934f9d5a3027fe00d906a45fe3a15fadcommit 25afba4499ac93a41721fcb25eed1905f85d06fc (HEAD -> work, origin/work)
  3. Author: Christian Brauner <christian@brauner.io>
  4. Date: Wed Mar 20 08:05:54 2019 +0100
  5.  
  6. pidfd: introduce "pidfd" proc file
  7.  
  8. Signed-off-by: Christian Brauner <christian@brauner.io>
  9.  
  10. diff --git a/fs/proc/base.c b/fs/proc/base.c
  11. index ddef482f1334..081c57988fd6 100644
  12. --- a/fs/proc/base.c
  13. +++ b/fs/proc/base.c
  14. @@ -357,6 +357,9 @@ static const struct file_operations proc_pid_cmdline_ops = {
  15. .llseek = generic_file_llseek,
  16. };
  17.  
  18. +static const struct file_operations proc_pid_pidfd_ops = {
  19. /* Grow a .poll and .read_iter method at some point. */
  20. +};
  21. +
  22. #ifdef CONFIG_KALLSYMS
  23. /*
  24. * Provides a wchan file via kallsyms in a proper one-value-per-file format.
  25. @@ -2987,6 +2990,7 @@ static const struct pid_entry tgid_base_stuff[] = {
  26. ONE("syscall", S_IRUSR, proc_pid_syscall),
  27. #endif
  28. REG("cmdline", S_IRUGO, proc_pid_cmdline_ops),
  29. + REG("pidfd", S_IRUGO, proc_pid_pidfd_ops),
  30. ONE("stat", S_IRUGO, proc_tgid_stat),
  31. ONE("statm", S_IRUGO, proc_pid_statm),
  32. REG("maps", S_IRUGO, proc_pid_maps_operations),
  33. @@ -3076,8 +3080,7 @@ static const struct file_operations proc_tgid_base_operations = {
  34.  
  35. struct pid *tgid_pidfd_to_pid(const struct file *file)
  36. {
  37. - if (!d_is_dir(file->f_path.dentry) ||
  38. - (file->f_op != &proc_tgid_base_operations))
  39. + if (file->f_op != &proc_pid_pidfd_ops)
  40. return ERR_PTR(-EBADF);
  41.  
  42. return proc_pid(file_inode(file));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement