[Devel,v2,07/27] connector: take cn_already_initialized from VE

Submitted by Stanislav Kinsburskiy on Aug. 17, 2017, 1:59 p.m.

Details

Message ID 20170817135937.23505.34228.stgit@localhost.localdomain
State New
Series "proc connector: containerize on per-VE basis"
Headers show

Commit Message

Stanislav Kinsburskiy Aug. 17, 2017, 1:59 p.m.
Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 drivers/connector/connector.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index bba667d..110637b 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -38,8 +38,6 @@  MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
 MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector.");
 MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_CONNECTOR);
 
-static int cn_already_initialized;
-
 /*
  * msg->seq and msg->ack are used to determine message genealogy.
  * When someone sends message it puts there locally unique sequence
@@ -196,7 +194,7 @@  int cn_add_callback_ve(struct ve_struct *ve,
 	int err;
 	struct cn_dev *dev = get_cdev(ve);
 
-	if (!cn_already_initialized)
+	if (!ve->cn->cn_already_initialized)
 		return -EAGAIN;
 
 	err = cn_queue_add_callback(dev->cbdev, name, id, callback);
@@ -300,7 +298,7 @@  static int cn_init_ve(struct ve_struct *ve)
 		return -EINVAL;
 	}
 
-	cn_already_initialized = 1;
+	ve->cn->cn_already_initialized = 1;
 
 	proc_create("connector", S_IRUGO, net->proc_net, &cn_file_ops);
 
@@ -312,7 +310,7 @@  static void cn_fini_ve(struct ve_struct *ve)
 	struct cn_dev *dev = get_cdev(ve);
 	struct net *net = ve->ve_netns;
 
-	cn_already_initialized = 0;
+	ve->cn->cn_already_initialized = 0;
 
 	remove_proc_entry("connector", net->proc_net);