uprobes/core: Clean up, refactor and improve the code
Make the uprobes code readable to me:
- improve the Kconfig text so that a mere mortal gets some idea
what CONFIG_UPROBES=y is really about
- do trivial renames to standardize around the uprobes_*() namespace
- clean up and simplify various code flow details
- separate basic blocks of functionality
- line break artifact and white space related removal
- use standard local varible definition blocks
- use vertical spacing to make things more readable
- remove unnecessary volatile
- restructure comment blocks to make them more uniform and
more readable in general
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Anton Arapov <anton@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Link: http://lkml.kernel.org/n/tip-ewbwhb8o6navvllsauu7k07p@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/mm/mmap.c b/mm/mmap.c
index 1aed183..5a863d3 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -618,10 +618,10 @@
mutex_unlock(&mapping->i_mmap_mutex);
if (root) {
- mmap_uprobe(vma);
+ uprobe_mmap(vma);
if (adjust_next)
- mmap_uprobe(next);
+ uprobe_mmap(next);
}
if (remove_next) {
@@ -646,7 +646,7 @@
}
}
if (insert && file)
- mmap_uprobe(insert);
+ uprobe_mmap(insert);
validate_mm(mm);
@@ -1340,7 +1340,7 @@
} else if ((flags & MAP_POPULATE) && !(flags & MAP_NONBLOCK))
make_pages_present(addr, addr + len);
- if (file && mmap_uprobe(vma))
+ if (file && uprobe_mmap(vma))
/* matching probes but cannot insert */
goto unmap_and_free_vma;
@@ -2301,7 +2301,7 @@
security_vm_enough_memory_mm(mm, vma_pages(vma)))
return -ENOMEM;
- if (vma->vm_file && mmap_uprobe(vma))
+ if (vma->vm_file && uprobe_mmap(vma))
return -EINVAL;
vma_link(mm, vma, prev, rb_link, rb_parent);
@@ -2374,7 +2374,7 @@
if (new_vma->vm_file) {
get_file(new_vma->vm_file);
- if (mmap_uprobe(new_vma))
+ if (uprobe_mmap(new_vma))
goto out_free_mempol;
if (vma->vm_flags & VM_EXECUTABLE)