[CRIU] [PATCH] locks: Use in-house pid_in_pstree helper

Pavel Emelyanov xemul at virtuozzo.com
Fri May 13 06:34:10 PDT 2016


This code is for older kernels that don't have locks info
in fdinfo files. So don't keep global pstree helper for this.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/include/pstree.h | 1 -
 criu/proc_parse.c     | 5 +++++
 criu/pstree.c         | 5 -----
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/criu/include/pstree.h b/criu/include/pstree.h
index b7583c6..5998295 100644
--- a/criu/include/pstree.h
+++ b/criu/include/pstree.h
@@ -84,7 +84,6 @@ struct pstree_item *pstree_item_by_real(pid_t virt);
 struct pstree_item *pstree_item_by_virt(pid_t virt);
 
 extern int pid_to_virt(pid_t pid);
-extern bool pid_in_pstree(pid_t pid);
 
 struct task_entries;
 extern struct task_entries *task_entries;
diff --git a/criu/proc_parse.c b/criu/proc_parse.c
index 5210226..c51cc40 100644
--- a/criu/proc_parse.c
+++ b/criu/proc_parse.c
@@ -1932,6 +1932,11 @@ static int parse_file_lock_buf(char *buf, struct file_lock *fl,
 	return 0;
 }
 
+static bool pid_in_pstree(pid_t pid)
+{
+	return pstree_item_by_real(pid) != NULL;
+}
+
 int parse_file_locks(void)
 {
 	struct file_lock *fl;
diff --git a/criu/pstree.c b/criu/pstree.c
index 00e6204..efb5c72 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -1046,8 +1046,3 @@ int pid_to_virt(pid_t real)
 		return item->pid.virt;
 	return 0;
 }
-
-bool pid_in_pstree(pid_t pid)
-{
-	return pstree_item_by_real(pid) != NULL;
-}
-- 
2.5.0


More information about the CRIU mailing list