[3/5] kdat: Merge dump and restore kerndats

Submitted by Pavel Emelianov on April 26, 2017, 9:24 a.m.

Details

Message ID 69c6d225-4e3c-c7a9-51f9-edde173d1d24@virtuozzo.com
State New
Series "Speed up kdat checks"
Headers show

Commit Message

Pavel Emelianov April 26, 2017, 9:24 a.m.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/cr-restore.c      |  2 +-
 criu/include/kerndat.h |  1 -
 criu/kerndat.c         | 36 ------------------------------------
 criu/lsm.c             |  2 +-
 4 files changed, 2 insertions(+), 39 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index e973ce0..f08b577 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -2164,7 +2164,7 @@  int cr_restore_tasks(void)
 	if (init_stats(RESTORE_STATS))
 		goto err;
 
-	if (kerndat_init_rst())
+	if (kerndat_init())
 		goto err;
 
 	timing_start(TIME_RESTORE);
diff --git a/criu/include/kerndat.h b/criu/include/kerndat.h
index 4945a4b..6b621c6 100644
--- a/criu/include/kerndat.h
+++ b/criu/include/kerndat.h
@@ -11,7 +11,6 @@  struct stat;
  */
 
 extern int kerndat_init(void);
-extern int kerndat_init_rst(void);
 extern int kerndat_get_dirty_track(void);
 extern int kerndat_fdinfo_has_lock(void);
 extern int kerndat_loginuid(void);
diff --git a/criu/kerndat.c b/criu/kerndat.c
index 416b1bc..87a7b62 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -683,46 +683,10 @@  int kerndat_init(void)
 		ret = kerndat_nsid();
 	if (!ret)
 		ret = kerndat_has_nspid();
-
-	kerndat_lsm();
-	kerndat_mmap_min_addr();
-
-	return ret;
-}
-
-int kerndat_init_rst(void)
-{
-	int ret;
-
-	/*
-	 * Read TCP sysctls before anything else,
-	 * since the limits we're interested in are
-	 * not available inside namespaces.
-	 */
-
-	ret = check_pagemap();
-	if (!ret)
-		ret = get_last_cap();
 	if (!ret)
 		ret = kerndat_has_memfd_create();
 	if (!ret)
-		ret = get_task_size();
-	if (!ret)
-		ret = get_ipv6();
-	if (!ret)
-		ret = kerndat_loginuid();
-	if (!ret)
-		ret = kerndat_iptables_has_xtlocks();
-	if (!ret)
-		ret = kerndat_tcp_repair();
-	if (!ret)
-		ret = kerndat_compat_restore();
-	if (!ret)
 		ret = kerndat_uffd();
-	if (!ret)
-		ret = kerndat_socket_netns();
-	if (!ret)
-		ret = kerndat_nsid();
 
 	kerndat_lsm();
 	kerndat_mmap_min_addr();
diff --git a/criu/lsm.c b/criu/lsm.c
index 8c014d4..4f5c436 100644
--- a/criu/lsm.c
+++ b/criu/lsm.c
@@ -111,7 +111,7 @@  void kerndat_lsm(void)
 {
 	/* On restore, if someone passes --lsm-profile, we might end up doing
 	 * detection twice, once during flag parsing and once for
-	 * kerndat_init_rst(). Let's detect when we've already done detection
+	 * kerndat_init(). Let's detect when we've already done detection
 	 * and not do it again.
 	 */
 	if (name)