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>
This commit is contained in:
parent
e149ed2b80
commit
3d3d35b1e9
|
@ -66,8 +66,7 @@ static struct inode *proc_alloc_inode(struct super_block *sb)
|
||||||
ei->pde = NULL;
|
ei->pde = NULL;
|
||||||
ei->sysctl = NULL;
|
ei->sysctl = NULL;
|
||||||
ei->sysctl_entry = NULL;
|
ei->sysctl_entry = NULL;
|
||||||
ei->ns.ns = NULL;
|
ei->ns_ops = NULL;
|
||||||
ei->ns.ns_ops = NULL;
|
|
||||||
inode = &ei->vfs_inode;
|
inode = &ei->vfs_inode;
|
||||||
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
|
||||||
return inode;
|
return inode;
|
||||||
|
|
|
@ -57,11 +57,6 @@ union proc_op {
|
||||||
struct task_struct *task);
|
struct task_struct *task);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct proc_ns {
|
|
||||||
struct ns_common *ns;
|
|
||||||
const struct proc_ns_operations *ns_ops;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct proc_inode {
|
struct proc_inode {
|
||||||
struct pid *pid;
|
struct pid *pid;
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -69,7 +64,7 @@ struct proc_inode {
|
||||||
struct proc_dir_entry *pde;
|
struct proc_dir_entry *pde;
|
||||||
struct ctl_table_header *sysctl;
|
struct ctl_table_header *sysctl;
|
||||||
struct ctl_table *sysctl_entry;
|
struct ctl_table *sysctl_entry;
|
||||||
struct proc_ns ns;
|
const struct proc_ns_operations *ns_ops;
|
||||||
struct inode vfs_inode;
|
struct inode vfs_inode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ static const struct proc_ns_operations *ns_entries[] = {
|
||||||
static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd)
|
static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd)
|
||||||
{
|
{
|
||||||
struct inode *inode = dentry->d_inode;
|
struct inode *inode = dentry->d_inode;
|
||||||
const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns.ns_ops;
|
const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns_ops;
|
||||||
struct task_struct *task;
|
struct task_struct *task;
|
||||||
struct path ns_path;
|
struct path ns_path;
|
||||||
void *error = ERR_PTR(-EACCES);
|
void *error = ERR_PTR(-EACCES);
|
||||||
|
@ -54,7 +54,7 @@ static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd)
|
||||||
static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int buflen)
|
static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int buflen)
|
||||||
{
|
{
|
||||||
struct inode *inode = dentry->d_inode;
|
struct inode *inode = dentry->d_inode;
|
||||||
const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns.ns_ops;
|
const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns_ops;
|
||||||
struct task_struct *task;
|
struct task_struct *task;
|
||||||
char name[50];
|
char name[50];
|
||||||
int res = -EACCES;
|
int res = -EACCES;
|
||||||
|
@ -92,7 +92,7 @@ static int proc_ns_instantiate(struct inode *dir,
|
||||||
ei = PROC_I(inode);
|
ei = PROC_I(inode);
|
||||||
inode->i_mode = S_IFLNK|S_IRWXUGO;
|
inode->i_mode = S_IFLNK|S_IRWXUGO;
|
||||||
inode->i_op = &proc_ns_link_inode_operations;
|
inode->i_op = &proc_ns_link_inode_operations;
|
||||||
ei->ns.ns_ops = ns_ops;
|
ei->ns_ops = ns_ops;
|
||||||
|
|
||||||
d_set_d_op(dentry, &pid_dentry_operations);
|
d_set_d_op(dentry, &pid_dentry_operations);
|
||||||
d_add(dentry, inode);
|
d_add(dentry, inode);
|
||||||
|
|
Loading…
Reference in New Issue