Skip to contentSkip to conversation

pre/post_restore_task: Do not pass checkpoint context when unused

PATCH In review Matt Helsley 2 participants 2 messages Oct 14, 2009 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 pre/post_restore_task: Do not pass checkpoint context when unused

The checkpoint context is not used in these functions -- they only rely on current -- so it's safe to remove.

---
 checkpoint/process.c       |    4 ++--
 checkpoint/restart.c       |   10 +++++-----
 include/linux/checkpoint.h |    4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)
checkpoint/process.c +2 -2
index 17c08e8..4008529 100644
@@ -815,7 +815,7 @@ static int restore_task_pgid(struct ckpt_ctx *ctx)
 }
 
 /* prepare the task for restore */
-int pre_restore_task(struct ckpt_ctx *ctx)
+int pre_restore_task(void)
 {
 	sigset_t sigset;
 
@@ -844,7 +844,7 @@ int pre_restore_task(struct ckpt_ctx *ctx)
 	return 0;
 }
 
-void post_restore_task(struct ckpt_ctx *ctx)
+void post_restore_task(void)
 {
 	/* can happen if restart failed early */
 	if (!current->checkpoint_data)
checkpoint/restart.c +5 -5
index fc94374..6679472 100644
@@ -945,7 +945,7 @@ static int do_restore_task(void)
 
 	restore_debug_running(ctx);
 
-	ret = pre_restore_task(ctx);
+	ret = pre_restore_task();
 	if (ret < 0)
 		goto out;
 
@@ -967,7 +967,7 @@ static int do_restore_task(void)
 	 */
 	if (zombie) {
 		restore_debug_exit(ctx);
-		post_restore_task(ctx);
+		post_restore_task();
 		ckpt_ctx_put(ctx);
 		do_exit(current->exit_code);
 	}
@@ -979,7 +979,7 @@ static int do_restore_task(void)
 	if (ret < 0)
 		restore_notify_error(ctx, ret);
 
-	post_restore_task(ctx);
+	post_restore_task();
 	current->flags &= ~PF_RESTARTING;
 	clear_task_ctx(current);
 	ckpt_ctx_put(ctx);
@@ -1196,7 +1196,7 @@ static int do_restore_coord(struct ckpt_ctx *ctx, pid_t pid)
 	 */
 
 	if (ctx->uflags & RESTART_TASKSELF) {
-		ret = pre_restore_task(ctx);
+		ret = pre_restore_task();
 		ckpt_debug("pre restore task: %d\n", ret);
 		if (ret < 0)
 			goto out;
@@ -1233,7 +1233,7 @@ static int do_restore_coord(struct ckpt_ctx *ctx, pid_t pid)
 	}
  out:
 	if (ctx->uflags & RESTART_TASKSELF)
-		post_restore_task(ctx);
+		post_restore_task();
 
 	restore_debug_error(ctx, ret);
 	if (ret < 0) {
include/linux/checkpoint.h +2 -2
index dd75bc2..4b61378 100644
@@ -154,8 +154,8 @@ extern int ckpt_activate_next(struct ckpt_ctx *ctx);
 extern int ckpt_collect_task(struct ckpt_ctx *ctx, struct task_struct *t);
 extern int checkpoint_task(struct ckpt_ctx *ctx, struct task_struct *t);
 extern int restore_task(struct ckpt_ctx *ctx);
-extern int pre_restore_task(struct ckpt_ctx *ctx);
-extern void post_restore_task(struct ckpt_ctx *ctx);
+extern int pre_restore_task(void);
+extern void post_restore_task(void);
 
 /* arch hooks */
 extern int checkpoint_write_header_arch(struct ckpt_ctx *ctx);
Signature · 1 line
1.5.6.3
#2 lore raw
In reply to a message not in the archive

Pulled.

Quoted 96 lines · Matt Helsley

The checkpoint context is not used in these functions -- they only rely on current -- so it's safe to remove.

---
 checkpoint/process.c       |    4 ++--
 checkpoint/restart.c       |   10 +++++-----
 include/linux/checkpoint.h |    4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)
checkpoint/process.c +2 -2
index 17c08e8..4008529 100644
@@ -815,7 +815,7 @@ static int restore_task_pgid(struct ckpt_ctx *ctx)
 }
 
 /* prepare the task for restore */
-int pre_restore_task(struct ckpt_ctx *ctx)
+int pre_restore_task(void)
 {
 	sigset_t sigset;
 
@@ -844,7 +844,7 @@ int pre_restore_task(struct ckpt_ctx *ctx)
 	return 0;
 }
 
-void post_restore_task(struct ckpt_ctx *ctx)
+void post_restore_task(void)
 {
 	/* can happen if restart failed early */
 	if (!current->checkpoint_data)
checkpoint/restart.c +5 -5
index fc94374..6679472 100644
@@ -945,7 +945,7 @@ static int do_restore_task(void)
 
 	restore_debug_running(ctx);
 
-	ret = pre_restore_task(ctx);
+	ret = pre_restore_task();
 	if (ret < 0)
 		goto out;
 
@@ -967,7 +967,7 @@ static int do_restore_task(void)
 	 */
 	if (zombie) {
 		restore_debug_exit(ctx);
-		post_restore_task(ctx);
+		post_restore_task();
 		ckpt_ctx_put(ctx);
 		do_exit(current->exit_code);
 	}
@@ -979,7 +979,7 @@ static int do_restore_task(void)
 	if (ret < 0)
 		restore_notify_error(ctx, ret);
 
-	post_restore_task(ctx);
+	post_restore_task();
 	current->flags &= ~PF_RESTARTING;
 	clear_task_ctx(current);
 	ckpt_ctx_put(ctx);
@@ -1196,7 +1196,7 @@ static int do_restore_coord(struct ckpt_ctx *ctx, pid_t pid)
 	 */
 
 	if (ctx->uflags & RESTART_TASKSELF) {
-		ret = pre_restore_task(ctx);
+		ret = pre_restore_task();
 		ckpt_debug("pre restore task: %d\n", ret);
 		if (ret < 0)
 			goto out;
@@ -1233,7 +1233,7 @@ static int do_restore_coord(struct ckpt_ctx *ctx, pid_t pid)
 	}
  out:
 	if (ctx->uflags & RESTART_TASKSELF)
-		post_restore_task(ctx);
+		post_restore_task();
 
 	restore_debug_error(ctx, ret);
 	if (ret < 0) {
include/linux/checkpoint.h +2 -2
index dd75bc2..4b61378 100644
@@ -154,8 +154,8 @@ extern int ckpt_activate_next(struct ckpt_ctx *ctx);
 extern int ckpt_collect_task(struct ckpt_ctx *ctx, struct task_struct *t);
 extern int checkpoint_task(struct ckpt_ctx *ctx, struct task_struct *t);
 extern int restore_task(struct ckpt_ctx *ctx);
-extern int pre_restore_task(struct ckpt_ctx *ctx);
-extern void post_restore_task(struct ckpt_ctx *ctx);
+extern int pre_restore_task(void);
+extern void post_restore_task(void);
 
 /* arch hooks */
 extern int checkpoint_write_header_arch(struct ckpt_ctx *ctx);