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

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu Aug 17 16:59:37 MSK 2017


Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 drivers/connector/connector.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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 at 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);
 



More information about the Devel mailing list