diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-01 11:10:28 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-10 21:30:57 -0500 |
commit | 3d3d35b1e94ec918fc0ae670663235bf197d8609 (patch) | |
tree | 28f1f6c1061c118544ff626bc336e826b270f2ca | |
parent | e149ed2b805fefdccf7ccdfc19eca22fdd4514ac (diff) |
kill proc_ns completely
procfs inodes need only the ns_ops part; nsfs inodes don't need it at all
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/proc/inode.c | 3 | ||||
-rw-r--r-- | fs/proc/internal.h | 7 | ||||
-rw-r--r-- | fs/proc/namespaces.c | 6 |
3 files changed, 5 insertions, 11 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 57a9be9a6668..8420a2f80811 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -66,8 +66,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb) | |||
66 | ei->pde = NULL; | 66 | ei->pde = NULL; |
67 | ei->sysctl = NULL; | 67 | ei->sysctl = NULL; |
68 | ei->sysctl_entry = NULL; | 68 | ei->sysctl_entry = NULL; |
69 | ei->ns.ns = NULL; | 69 | ei->ns_ops = NULL; |
70 | ei->ns.ns_ops = NULL; | ||
71 | inode = &ei->vfs_inode; | 70 | inode = &ei->vfs_inode; |
72 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; | 71 | inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; |
73 | return inode; | 72 | return inode; |
diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 0fabc48d905f..d689fd6960d5 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h | |||
@@ -57,11 +57,6 @@ union proc_op { | |||
57 | struct task_struct *task); | 57 | struct task_struct *task); |
58 | }; | 58 | }; |
59 | 59 | ||
60 | struct proc_ns { | ||
61 | struct ns_common *ns; | ||
62 | const struct proc_ns_operations *ns_ops; | ||
63 | }; | ||
64 | |||
65 | struct proc_inode { | 60 | struct proc_inode { |
66 | struct pid *pid; | 61 | struct pid *pid; |
67 | int fd; | 62 | int fd; |
@@ -69,7 +64,7 @@ struct proc_inode { | |||
69 | struct proc_dir_entry *pde; | 64 | struct proc_dir_entry *pde; |
70 | struct ctl_table_header *sysctl; | 65 | struct ctl_table_header *sysctl; |
71 | struct ctl_table *sysctl_entry; | 66 | struct ctl_table *sysctl_entry; |
72 | struct proc_ns ns; | 67 | const struct proc_ns_operations *ns_ops; |
73 | struct inode vfs_inode; | 68 | struct inode vfs_inode; |
74 | }; | 69 | }; |
75 | 70 | ||
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c index aaaac77abad0..c9eac4563fa8 100644 --- a/fs/proc/namespaces.c +++ b/fs/proc/namespaces.c | |||
@@ -33,7 +33,7 @@ static const struct proc_ns_operations *ns_entries[] = { | |||
33 | static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd) | 33 | static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd) |
34 | { | 34 | { |
35 | struct inode *inode = dentry->d_inode; | 35 | struct inode *inode = dentry->d_inode; |
36 | const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns.ns_ops; | 36 | const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns_ops; |
37 | struct task_struct *task; | 37 | struct task_struct *task; |
38 | struct path ns_path; | 38 | struct path ns_path; |
39 | void *error = ERR_PTR(-EACCES); | 39 | void *error = ERR_PTR(-EACCES); |
@@ -54,7 +54,7 @@ static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
54 | static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int buflen) | 54 | static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int buflen) |
55 | { | 55 | { |
56 | struct inode *inode = dentry->d_inode; | 56 | struct inode *inode = dentry->d_inode; |
57 | const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns.ns_ops; | 57 | const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns_ops; |
58 | struct task_struct *task; | 58 | struct task_struct *task; |
59 | char name[50]; | 59 | char name[50]; |
60 | int res = -EACCES; | 60 | int res = -EACCES; |
@@ -92,7 +92,7 @@ static int proc_ns_instantiate(struct inode *dir, | |||
92 | ei = PROC_I(inode); | 92 | ei = PROC_I(inode); |
93 | inode->i_mode = S_IFLNK|S_IRWXUGO; | 93 | inode->i_mode = S_IFLNK|S_IRWXUGO; |
94 | inode->i_op = &proc_ns_link_inode_operations; | 94 | inode->i_op = &proc_ns_link_inode_operations; |
95 | ei->ns.ns_ops = ns_ops; | 95 | ei->ns_ops = ns_ops; |
96 | 96 | ||
97 | d_set_d_op(dentry, &pid_dentry_operations); | 97 | d_set_d_op(dentry, &pid_dentry_operations); |
98 | d_add(dentry, inode); | 98 | d_add(dentry, inode); |