Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33c42940 authored by Al Viro's avatar Al Viro
Browse files

copy address of proc_ns_ops into ns_common



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 6344c433
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2672,6 +2672,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
		kfree(new_ns);
		return ERR_PTR(ret);
	}
	new_ns->ns.ops = &mntns_operations;
	new_ns->seq = atomic64_add_return(1, &mnt_ns_seq);
	atomic_set(&new_ns->count, 1);
	new_ns->root = NULL;
+2 −4
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ static void proc_evict_inode(struct inode *inode)
{
	struct proc_dir_entry *de;
	struct ctl_table_header *head;
	const struct proc_ns_operations *ns_ops;
	struct ns_common *ns;

	truncate_inode_pages_final(&inode->i_data);
@@ -51,10 +50,9 @@ static void proc_evict_inode(struct inode *inode)
		sysctl_head_put(head);
	}
	/* Release any associated namespace */
	ns_ops = PROC_I(inode)->ns.ns_ops;
	ns = PROC_I(inode)->ns.ns;
	if (ns_ops && ns)
		ns_ops->put(ns);
	if (ns && ns->ops)
		ns->ops->put(ns);
}

static struct kmem_cache * proc_inode_cachep;
+3 −0
Original line number Diff line number Diff line
#ifndef _LINUX_NS_COMMON_H
#define _LINUX_NS_COMMON_H

struct proc_ns_operations;

struct ns_common {
	const struct proc_ns_operations *ops;
	unsigned int inum;
};

+3 −0
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@ struct uts_namespace init_uts_ns = {
	},
	.user_ns = &init_user_ns,
	.ns.inum = PROC_UTS_INIT_INO,
#ifdef CONFIG_UTS_NS
	.ns.ops = &utsns_operations,
#endif
};
EXPORT_SYMBOL_GPL(init_uts_ns);

+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@ struct ipc_namespace init_ipc_ns = {
	.count		= ATOMIC_INIT(1),
	.user_ns = &init_user_ns,
	.ns.inum = PROC_IPC_INIT_INO,
#ifdef CONFIG_IPC_NS
	.ns.ops = &ipcns_operations,
#endif
};

atomic_t nr_ipc_ns = ATOMIC_INIT(1);
Loading