locks: Use in-house pid_in_pstree helper

Submitted by Pavel Emelianov on May 13, 2016, 1:34 p.m.

Details

Message ID 5735D7D2.2040407@virtuozzo.com
State Accepted
Series "locks: Use in-house pid_in_pstree helper"
Commit 6d1fe1b0443980e2526594cee8818adf5804f2c0
Headers show

Commit Message

Pavel Emelianov May 13, 2016, 1:34 p.m.
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@virtuozzo.com>
---
 criu/include/pstree.h | 1 -
 criu/proc_parse.c     | 5 +++++
 criu/pstree.c         | 5 -----
 3 files changed, 5 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

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;
-}