diff options
author | Christoph Hellwig <hch@lst.de> | 2018-05-16 01:19:01 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 01:23:35 -0400 |
commit | 76f668be1e8e87d235fbd50037f50fdde948b46d (patch) | |
tree | 6473ada6105603c2705588b0749fa7cfb4b80176 /fs/proc/self.c | |
parent | 441bc62741e6e7f8d428b827c2a7b482a467fc42 (diff) |
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.c | 4 |
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, | |||
12 | struct inode *inode, | 12 | struct inode *inode, |
13 | struct delayed_call *done) | 13 | struct delayed_call *done) |
14 | { | 14 | { |
15 | struct pid_namespace *ns = inode->i_sb->s_fs_info; | 15 | struct pid_namespace *ns = proc_pid_ns(inode); |
16 | pid_t tgid = task_tgid_nr_ns(current, ns); | 16 | pid_t tgid = task_tgid_nr_ns(current, ns); |
17 | char *name; | 17 | char *name; |
18 | 18 | ||
@@ -36,7 +36,7 @@ static unsigned self_inum __ro_after_init; | |||
36 | int proc_setup_self(struct super_block *s) | 36 | int proc_setup_self(struct super_block *s) |
37 | { | 37 | { |
38 | struct inode *root_inode = d_inode(s->s_root); | 38 | struct inode *root_inode = d_inode(s->s_root); |
39 | struct pid_namespace *ns = s->s_fs_info; | 39 | struct pid_namespace *ns = proc_pid_ns(root_inode); |
40 | struct dentry *self; | 40 | struct dentry *self; |
41 | 41 | ||
42 | inode_lock(root_inode); | 42 | inode_lock(root_inode); |