[CRIU] [PATCH 27/44] cr-dump.c: moved the function core_free_entry() into the file arch/x86/crtools.c.

Alexander Kartashov alekskartashov at parallels.com
Mon Jan 7 10:04:56 EST 2013


Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
 arch/x86/crtools.c          |   23 +++++++++++++++++++++++
 arch/x86/include/asm/dump.h |    1 +
 cr-dump.c                   |   22 ----------------------
 3 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/arch/x86/crtools.c b/arch/x86/crtools.c
index eb9271c..58c4820 100644
--- a/arch/x86/crtools.c
+++ b/arch/x86/crtools.c
@@ -261,3 +261,26 @@ int arch_alloc_thread_info(CoreEntry *core) {
 err:
 	return 1;
 }
+
+
+void core_entry_free(CoreEntry *core)
+{
+	if (core) {
+		if (core->thread_info) {
+			if (core->thread_info->fpregs) {
+				if (core->thread_info->fpregs->xsave)
+					xfree(core->thread_info->fpregs->xsave->ymmh_space);
+				xfree(core->thread_info->fpregs->xsave);
+				xfree(core->thread_info->fpregs->st_space);
+				xfree(core->thread_info->fpregs->xmm_space);
+				xfree(core->thread_info->fpregs->padding);
+			}
+			xfree(core->thread_info->gpregs);
+			xfree(core->thread_info->fpregs);
+		}
+		xfree(core->thread_info);
+		xfree(core->thread_core);
+		xfree(core->tc);
+		xfree(core->ids);
+	}
+}
diff --git a/arch/x86/include/asm/dump.h b/arch/x86/include/asm/dump.h
index fafa214..ba4d5c8 100644
--- a/arch/x86/include/asm/dump.h
+++ b/arch/x86/include/asm/dump.h
@@ -3,5 +3,6 @@
 
 extern int get_task_regs(pid_t pid, CoreEntry *core, const struct parasite_ctl *ctl);
 extern int arch_alloc_thread_info(CoreEntry *core);
+extern void core_entry_free(CoreEntry *core);
 
 #endif
diff --git a/cr-dump.c b/cr-dump.c
index ff199fe..668859c 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -692,28 +692,6 @@ static int dump_task_kobj_ids(pid_t pid, CoreEntry *core)
 	return 0;
 }
 
-static void core_entry_free(CoreEntry *core)
-{
-	if (core) {
-		if (core->thread_info) {
-			if (core->thread_info->fpregs) {
-				if (core->thread_info->fpregs->xsave)
-					xfree(core->thread_info->fpregs->xsave->ymmh_space);
-				xfree(core->thread_info->fpregs->xsave);
-				xfree(core->thread_info->fpregs->st_space);
-				xfree(core->thread_info->fpregs->xmm_space);
-				xfree(core->thread_info->fpregs->padding);
-			}
-			xfree(core->thread_info->gpregs);
-			xfree(core->thread_info->fpregs);
-		}
-		xfree(core->thread_info);
-		xfree(core->thread_core);
-		xfree(core->tc);
-		xfree(core->ids);
-	}
-}
-
 static CoreEntry *core_entry_alloc(int alloc_thread_info,
 				   int alloc_tc,
 				   int alloc_ids)
-- 
1.7.10.4



More information about the CRIU mailing list