[Devel,v2,02/27] connector: store all private data on VE structure

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

Details

Message ID 20170817135911.23505.64844.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.
This is needed to containerize connector and its proc part.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 include/linux/connector.h |    9 +++++++++
 include/linux/ve.h        |    4 ++++
 2 files changed, 13 insertions(+)

Patch hide | download patch | download mbox

diff --git a/include/linux/connector.h b/include/linux/connector.h
index 4c4d2b9..9e05e28 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -67,6 +67,15 @@  struct cn_dev {
 	struct cn_queue_dev *cbdev;
 };
 
+struct cn_private {
+	struct cn_dev   cdev;
+	int             cn_already_initialized;
+
+	atomic_t        proc_event_num_listeners;
+	u32 __percpu    *proc_event_counts;
+
+};
+
 int cn_add_callback(struct cb_id *id, const char *name,
 		    void (*callback)(struct cn_msg *, struct netlink_skb_parms *));
 void cn_del_callback(struct cb_id *);
diff --git a/include/linux/ve.h b/include/linux/ve.h
index c9b0af4..d63edee 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -30,6 +30,7 @@  struct file_system_type;
 struct veip_struct;
 struct nsproxy;
 struct user_namespace;
+struct cn_private;
 extern struct user_namespace init_user_ns;
 
 struct ve_struct {
@@ -123,6 +124,9 @@  struct ve_struct {
 #ifdef CONFIG_COREDUMP
 	char 			core_pattern[CORENAME_MAX_SIZE];
 #endif
+#ifdef CONFIG_CONNECTOR
+	struct cn_private	*cn;
+#endif
 };
 
 struct ve_devmnt {