summaryrefslogtreecommitdiffstats
path: root/fs/proc/self.c
diff options
context:
space:
mode:
authorChristoph Hellwig2018-05-16 07:19:01 +0200
committerChristoph Hellwig2018-05-16 07:23:35 +0200
commit76f668be1e8e87d235fbd50037f50fdde948b46d (patch)
tree6473ada6105603c2705588b0749fa7cfb4b80176 /fs/proc/self.c
parentnet/can: single_open_net needs to be paired with single_release_net (diff)
downloadkernel-qcow2-linux-76f668be1e8e87d235fbd50037f50fdde948b46d.tar.gz
kernel-qcow2-linux-76f668be1e8e87d235fbd50037f50fdde948b46d.tar.xz
kernel-qcow2-linux-76f668be1e8e87d235fbd50037f50fdde948b46d.zip
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 'fs/proc/self.c')
-rw-r--r--fs/proc/self.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/proc/self.c b/fs/proc/self.c
index 4d7d061696b3..127265e5c55f 100644
--- a/fs/proc/self.c
+++ b/fs/proc/self.c
@@ -12,7 +12,7 @@ static const char *proc_self_get_link(struct dentry *dentry,
struct inode *inode,
struct delayed_call *done)
{
- struct pid_namespace *ns = inode->i_sb->s_fs_info;
+ struct pid_namespace *ns = proc_pid_ns(inode);
pid_t tgid = task_tgid_nr_ns(current, ns);
char *name;
@@ -36,7 +36,7 @@ static unsigned self_inum __ro_after_init;
int proc_setup_self(struct super_block *s)
{
struct inode *root_inode = d_inode(s->s_root);
- struct pid_namespace *ns = s->s_fs_info;
+ struct pid_namespace *ns = proc_pid_ns(root_inode);
struct dentry *self;
inode_lock(root_inode);