[Devel] [PATCH rh7 5/6] Revert "devtmpfs: per-VE mounts introduced"

Vladimir Davydov vdavydov at parallels.com
Thu Jul 23 08:10:02 PDT 2015


This reverts commit e85a799b629d5e28c8931ddd9127cf18d501745c.

More devtmpfs virtualization crap to drop. Will be reworked.

Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>

Conflicts:
	include/linux/ve.h
	kernel/ve/ve.c
---
 drivers/base/devtmpfs.c | 28 ++--------------------------
 include/linux/device.h  |  4 ----
 include/linux/ve.h      |  3 ---
 kernel/ve/ve.c          |  8 --------
 4 files changed, 2 insertions(+), 41 deletions(-)

diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index 6f4ba37f22fa..f59b7986ce08 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -23,8 +23,6 @@
 #include <linux/ramfs.h>
 #include <linux/slab.h>
 #include <linux/kthread.h>
-#include <linux/fs_struct.h>
-#include <linux/ve.h>
 #include "base.h"
 
 static struct task_struct *thread;
@@ -59,9 +57,9 @@ static struct dentry *dev_mount(struct file_system_type *fs_type, int flags,
 		      const char *dev_name, void *data)
 {
 #ifdef CONFIG_TMPFS
-	return mount_ns(fs_type, flags, data, shmem_fill_super);
+	return mount_single(fs_type, flags, data, shmem_fill_super);
 #else
-	return mount_ns(fs_type, flags, data, ramfs_fill_super);
+	return mount_single(fs_type, flags, data, ramfs_fill_super);
 #endif
 }
 
@@ -387,7 +385,6 @@ static int devtmpfsd(void *p)
 		goto out;
 	sys_chdir("/.."); /* will traverse into overmounted root */
 	sys_chroot(".");
-	get_fs_root(current->fs, &get_exec_env()->devtmpfs_root);
 	complete(&setup_done);
 	while (1) {
 		spin_lock(&req_lock);
@@ -408,33 +405,12 @@ static int devtmpfsd(void *p)
 		spin_unlock(&req_lock);
 		schedule();
 	}
-	path_put(&get_exec_env()->devtmpfs_root);
 	return 0;
 out:
 	complete(&setup_done);
 	return *err;
 }
 
-int ve_init_devtmpfs(void *data)
-{
-	struct ve_struct *ve = data;
-	struct vfsmount *mnt;
-
-	mnt = kern_mount_data(&dev_fs_type, ve);
-	if (IS_ERR(mnt))
-		return PTR_ERR(mnt);
-	ve->devtmpfs_root.mnt = mnt;
-	ve->devtmpfs_root.dentry = mnt->mnt_root;
-	return 0;
-}
-
-void ve_fini_devtmpfs(void *data)
-{
-	struct ve_struct *ve = data;
-
-	kern_unmount(ve->devtmpfs_root.mnt);
-}
-
 /*
  * Create devtmpfs instance, driver-core devices will add their device
  * nodes here.
diff --git a/include/linux/device.h b/include/linux/device.h
index 7d7cac469063..e4f914465b5a 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -997,14 +997,10 @@ extern void put_device(struct device *dev);
 extern int devtmpfs_create_node(struct device *dev);
 extern int devtmpfs_delete_node(struct device *dev);
 extern int devtmpfs_mount(const char *mntdir);
-extern int ve_init_devtmpfs(void *data);
-extern void ve_fini_devtmpfs(void *data);
 #else
 static inline int devtmpfs_create_node(struct device *dev) { return 0; }
 static inline int devtmpfs_delete_node(struct device *dev) { return 0; }
 static inline int devtmpfs_mount(const char *mountpoint) { return 0; }
-static inline int ve_init_devtmpfs(void *data) { return 0; }
-static inline void ve_fini_devtmpfs(void *data) { }
 #endif
 
 /* drivers/base/power/shutdown.c */
diff --git a/include/linux/ve.h b/include/linux/ve.h
index 7ba3f922f4fa..84be82303c39 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -134,9 +134,6 @@ struct ve_struct {
 	struct mutex		devmnt_mutex;
 
 	struct kmapset_key	ve_sysfs_perms;
-#if IS_ENABLED(CONFIG_DEVTMPFS)
-	struct path		devtmpfs_root;
-#endif
 };
 
 struct ve_devmnt {
diff --git a/kernel/ve/ve.c b/kernel/ve/ve.c
index c5fdf382ac93..6699b83734b5 100644
--- a/kernel/ve/ve.c
+++ b/kernel/ve/ve.c
@@ -445,10 +445,6 @@ int ve_start_container(struct ve_struct *ve)
 	if (err)
 		goto err_umh;
 
-	err = ve_init_devtmpfs(ve);
-	if (err)
-		goto err_dev;
-
 	err = ve_legacy_pty_init(ve);
 	if (err)
 		goto err_legacy_pty;
@@ -480,8 +476,6 @@ err_tty_console:
 err_unix98_pty:
 	ve_legacy_pty_fini(ve);
 err_legacy_pty:
-	ve_fini_devtmpfs(ve);
-err_dev:
 	ve_stop_umh(ve);
 err_umh:
 	ve_stop_kthread(ve);
@@ -515,8 +509,6 @@ void ve_stop_ns(struct pid_namespace *pid_ns)
 	ve_unix98_pty_fini(ve);
 	ve_legacy_pty_fini(ve);
 
-	ve_fini_devtmpfs(ve);
-
 	ve_stop_umh(ve);
 	/*
 	 * Stop kernel thread, or zap_pid_ns_processes() would wait it forever.
-- 
2.1.4




More information about the Devel mailing list