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

Commit 435d5f4b authored by Al Viro's avatar Al Viro
Browse files

common object embedded into various struct ....ns



for now - just move corresponding ->proc_inum instances over there

Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent cac7f242
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
#include <linux/mount.h>
#include <linux/seq_file.h>
#include <linux/poll.h>
#include <linux/ns_common.h>

struct mnt_namespace {
	atomic_t		count;
	unsigned int		proc_inum;
	struct ns_common	ns;
	struct mount *	root;
	struct list_head	list;
	struct user_namespace	*user_ns;
+3 −3
Original line number Diff line number Diff line
@@ -2640,7 +2640,7 @@ long do_mount(const char *dev_name, const char __user *dir_name,

static void free_mnt_ns(struct mnt_namespace *ns)
{
	proc_free_inum(ns->proc_inum);
	proc_free_inum(ns->ns.inum);
	put_user_ns(ns->user_ns);
	kfree(ns);
}
@@ -2662,7 +2662,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns)
	new_ns = kmalloc(sizeof(struct mnt_namespace), GFP_KERNEL);
	if (!new_ns)
		return ERR_PTR(-ENOMEM);
	ret = proc_alloc_inum(&new_ns->proc_inum);
	ret = proc_alloc_inum(&new_ns->ns.inum);
	if (ret) {
		kfree(new_ns);
		return ERR_PTR(ret);
@@ -3201,7 +3201,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns)
static unsigned int mntns_inum(void *ns)
{
	struct mnt_namespace *mnt_ns = ns;
	return mnt_ns->proc_inum;
	return mnt_ns->ns.inum;
}

const struct proc_ns_operations mntns_operations = {
+2 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#include <linux/rwsem.h>
#include <linux/notifier.h>
#include <linux/nsproxy.h>
#include <linux/ns_common.h>

/*
 * ipc namespace events
@@ -68,7 +69,7 @@ struct ipc_namespace {
	/* user_ns which owns the ipc ns */
	struct user_namespace *user_ns;

	unsigned int	proc_inum;
	struct ns_common ns;
};

extern struct ipc_namespace init_ipc_ns;
+8 −0
Original line number Diff line number Diff line
#ifndef _LINUX_NS_COMMON_H
#define _LINUX_NS_COMMON_H

struct ns_common {
	unsigned int inum;
};

#endif
+2 −1
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#include <linux/threads.h>
#include <linux/nsproxy.h>
#include <linux/kref.h>
#include <linux/ns_common.h>

struct pidmap {
       atomic_t nr_free;
@@ -43,7 +44,7 @@ struct pid_namespace {
	kgid_t pid_gid;
	int hide_pid;
	int reboot;	/* group exit code if this pidns was rebooted */
	unsigned int proc_inum;
	struct ns_common ns;
};

extern struct pid_namespace init_pid_ns;
Loading