[RHEL7,COMMIT] Revert "ve/kobject: new type for VE-aware object introduced"

Submitted by Konstantin Khorenko on Dec. 27, 2017, 3:54 p.m.

Details

Message ID 201712271554.vBRFsHcC013677@finist_ce7.work
State New
Headers show

Patch hide | download patch | download mbox

diff --git a/include/linux/ve.h b/include/linux/ve.h
index 486fa24d25c0..d62bf4dc8f87 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -152,10 +152,6 @@  extern unsigned int sysctl_ve_mount_nr;
 #ifdef CONFIG_VE
 #define ve_uevent_seqnum       (get_exec_env()->_uevent_seqnum)
 
-extern struct kobj_ns_type_operations ve_ns_type_operations;
-extern struct kobject * kobject_create_and_add_ve(const char *name,
-						struct kobject *parent);
-
 extern struct kmapset_set ve_sysfs_perms;
 
 extern int vz_security_family_check(struct net *net, int family, int type);
diff --git a/kernel/ve/Makefile b/kernel/ve/Makefile
index f9f77df7e507..76357429fa22 100644
--- a/kernel/ve/Makefile
+++ b/kernel/ve/Makefile
@@ -5,7 +5,7 @@ 
 # Copyright (c) 2009-2015 Parallels IP Holdings GmbH
 #
 
-obj-$(CONFIG_VE) = ve.o veowner.o hooks.o vzstat_core.o ve-kobject.o
+obj-$(CONFIG_VE) = ve.o veowner.o hooks.o vzstat_core.o
 obj-$(CONFIG_VZ_WDOG) += vzwdog.o
 obj-$(CONFIG_VE_CALLS) += vzmon.o
 
diff --git a/kernel/ve/ve-kobject.c b/kernel/ve/ve-kobject.c
deleted file mode 100644
index e1051bd4e9a7..000000000000
--- a/kernel/ve/ve-kobject.c
+++ /dev/null
@@ -1,48 +0,0 @@ 
-/*
- *  kernel/ve/ve-kobject.c
- *
- *  Copyright (c) 2010-2015 Parallels IP Holdings GmbH
- *
- */
-
-#include <linux/ve.h>
-#include <linux/kobject_ns.h>
-
-static const struct kobj_ns_type_operations *ve_child_ns_type(struct kobject *kobj)
-{
-	return &ve_ns_type_operations;
-}
-
-static void ve_kobj_release(struct kobject *kobj)
-{
-	kfree(kobj);
-}
-
-static struct kobj_type ve_kobj_ktype = {
-	.release	= ve_kobj_release,
-	.sysfs_ops	= &kobj_sysfs_ops,
-	.child_ns_type	= ve_child_ns_type,
-};
-
-struct kobject *kobject_create_and_add_ve(const char *name, struct kobject *parent)
-{
-	struct kobject *kobj;
-	int retval;
-
-	kobj = kzalloc(sizeof(*kobj), GFP_KERNEL);
-	if (!kobj)
-		return NULL;
-
-	kobject_init(kobj, &ve_kobj_ktype);
-
-	retval = kobject_add(kobj, parent, "%s", name);
-	if (retval) {
-		printk(KERN_WARNING "%s: kobject_add error: %d\n",
-		       __func__, retval);
-		kobject_put(kobj);
-		kobj = NULL;
-	}
-	return kobj;
-}
-
-
diff --git a/kernel/ve/veowner.c b/kernel/ve/veowner.c
index bb2b6fb8c335..647a878b5473 100644
--- a/kernel/ve/veowner.c
+++ b/kernel/ve/veowner.c
@@ -128,6 +128,4 @@  void init_ve_system(void)
 	prepare_proc();
 #endif
 	prepare_sysctl();
-
-	kobj_ns_type_register(&ve_ns_type_operations);
 }