Commit 7bce51f6 authored by Pavel Emelyanov's avatar Pavel Emelyanov

locks: Use in-house pid_in_pstree helper

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: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent fa7ead80
...@@ -84,7 +84,6 @@ struct pstree_item *pstree_item_by_real(pid_t virt); ...@@ -84,7 +84,6 @@ struct pstree_item *pstree_item_by_real(pid_t virt);
struct pstree_item *pstree_item_by_virt(pid_t virt); struct pstree_item *pstree_item_by_virt(pid_t virt);
extern int pid_to_virt(pid_t pid); extern int pid_to_virt(pid_t pid);
extern bool pid_in_pstree(pid_t pid);
struct task_entries; struct task_entries;
extern struct task_entries *task_entries; extern struct task_entries *task_entries;
......
...@@ -1932,6 +1932,11 @@ static int parse_file_lock_buf(char *buf, struct file_lock *fl, ...@@ -1932,6 +1932,11 @@ static int parse_file_lock_buf(char *buf, struct file_lock *fl,
return 0; return 0;
} }
static bool pid_in_pstree(pid_t pid)
{
return pstree_item_by_real(pid) != NULL;
}
int parse_file_locks(void) int parse_file_locks(void)
{ {
struct file_lock *fl; struct file_lock *fl;
......
...@@ -959,8 +959,3 @@ int pid_to_virt(pid_t real) ...@@ -959,8 +959,3 @@ int pid_to_virt(pid_t real)
return item->pid.virt; return item->pid.virt;
return 0; return 0;
} }
bool pid_in_pstree(pid_t pid)
{
return pstree_item_by_real(pid) != NULL;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment