summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-05-16 07:19:01 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-16 07:23:35 +0200
commit76f668be1e8e87d235fbd50037f50fdde948b46d (patch)
tree6473ada6105603c2705588b0749fa7cfb4b80176 /include
parent441bc62741e6e7f8d428b827c2a7b482a467fc42 (diff)
downloadlinux-76f668be1e8e87d235fbd50037f50fdde948b46d.tar.bz2
proc: introduce a proc_pid_ns helper
Factor out retrieving the per-sb pid namespaces from the sb private data into an easier to understand helper. Suggested-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/proc_fs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 928ef9e4d912..4edcde510631 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -83,4 +83,10 @@ struct ns_common;
int open_related_ns(struct ns_common *ns,
struct ns_common *(*get_ns)(struct ns_common *ns));
+/* get the associated pid namespace for a file in procfs */
+static inline struct pid_namespace *proc_pid_ns(struct inode *inode)
+{
+ return inode->i_sb->s_fs_info;
+}
+
#endif /* _LINUX_PROC_FS_H */