diff options
author | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2013-10-16 21:30:49 +0400 |
---|---|---|
committer | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2013-10-17 13:19:04 +0400 |
commit | defc0b17009d0eccd1810fa855942717a90e43f5 (patch) | |
tree | 31b1f8719ca52f4864c8f746e16c3b8d420e9431 /us_manager/sspt/sspt_proc.c | |
parent | b03569b52ef8a82545892f8625f211b347ee527c (diff) | |
download | swap-modules-defc0b17009d0eccd1810fa855942717a90e43f5.tar.gz swap-modules-defc0b17009d0eccd1810fa855942717a90e43f5.tar.bz2 swap-modules-defc0b17009d0eccd1810fa855942717a90e43f5.zip |
[FIX] uninstall probes on do_munmap() call
Change-Id: I370fb69f8d41bea3d007c90dfa9b671b3a99ec81
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
Diffstat (limited to 'us_manager/sspt/sspt_proc.c')
-rw-r--r-- | us_manager/sspt/sspt_proc.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/us_manager/sspt/sspt_proc.c b/us_manager/sspt/sspt_proc.c index be4bd015..3534247d 100644 --- a/us_manager/sspt/sspt_proc.c +++ b/us_manager/sspt/sspt_proc.c @@ -255,3 +255,34 @@ int sspt_proc_uninstall(struct sspt_proc *proc, struct task_struct *task, enum U return err; } + +static int intersection(unsigned long start_a, unsigned long end_a, + unsigned long start_b, unsigned long end_b) +{ + return start_a < start_b ? + end_a > start_b : + start_a < end_b; +} + +int sspt_proc_get_files_by_region(struct sspt_proc *proc, + struct list_head *head, + unsigned long start, size_t len) +{ + int ret = 0; + struct sspt_file *file, *n; + unsigned long end = start + len; + + list_for_each_entry_safe(file, n, &proc->file_list, list) { + if (intersection(file->vm_start, file->vm_end, start, end)) { + ret = 1; + list_move(&file->list, head); + } + } + + return ret; +} + +void sspt_proc_insert_files(struct sspt_proc *proc, struct list_head *head) +{ + list_splice(head, &proc->file_list); +} |