[REFACTOR] remove argument 'atomic'
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 6 May 2013 11:14:31 +0000 (15:14 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Mon, 6 May 2013 11:19:41 +0000 (15:19 +0400)
from:
install_proc_probes()
install_page_probes()

driver/helper.c
driver/us_proc_inst.c
driver/us_proc_inst.h

index 3c5c97b..91acea7 100644 (file)
@@ -72,7 +72,7 @@ static int ret_handler_pf(struct kretprobe_instance *ri, struct pt_regs *regs)
 
                                us_proc_info.pp->sm = create_sm_us(task);
                                /* install probes in already mapped memory */
-                               install_proc_probes(task, us_proc_info.pp, 1);
+                               install_proc_probes(task, us_proc_info.pp);
                        }
                }
 
@@ -83,7 +83,7 @@ static int ret_handler_pf(struct kretprobe_instance *ri, struct pt_regs *regs)
 
        if (procs) {
                unsigned long page = addr & PAGE_MASK;
-               install_page_probes(page, task, procs, 1);
+               install_page_probes(page, task, procs);
        }
 
 out:
index 48d7268..5024f1e 100644 (file)
@@ -336,7 +336,7 @@ int inst_usr_space_proc (void)
 
                        procs = sspt_procs_get_by_task_or_new(task);
                        DPRINTF("trying process");
-                       install_proc_probes(task, procs, 1);
+                       install_proc_probes(task, procs);
                        //put_task_struct (task);
                }
        }
@@ -348,7 +348,7 @@ int inst_usr_space_proc (void)
                        DPRINTF("task found. installing probes");
                        us_proc_info.tgid = task->pid;
                        us_proc_info.pp->sm = create_sm_us(task);
-                       install_proc_probes(task, us_proc_info.pp, 0);
+                       install_proc_probes(task, us_proc_info.pp);
                        put_task_struct (task);
                }
        }
@@ -437,12 +437,13 @@ int unregister_us_page_probe(struct task_struct *task,
        return err;
 }
 
-void install_page_probes(unsigned long page_addr, struct task_struct *task, struct sspt_procs *procs, int atomic)
+void install_page_probes(unsigned long page_addr, struct task_struct *task, struct sspt_procs *procs)
 {
-       int lock;
+       int lock, atomic;
        struct mm_struct *mm;
        struct vm_area_struct *vma;
 
+       atomic = in_atomic();
        mm_read_lock(task, mm, atomic, lock);
 
        vma = find_vma(mm, page_addr);
@@ -481,12 +482,13 @@ static void install_file_probes(struct task_struct *task, struct mm_struct *mm,
        }
 }
 
-void install_proc_probes(struct task_struct *task, struct sspt_procs *procs, int atomic)
+void install_proc_probes(struct task_struct *task, struct sspt_procs *procs)
 {
-       int lock;
+       int lock, atomic;
        struct vm_area_struct *vma;
        struct mm_struct *mm;
 
+       atomic = in_atomic();
        mm_read_lock(task, mm, atomic, lock);
 
        for (vma = mm->mmap; vma; vma = vma->vm_next) {
index a3f2f21..8aef81c 100644 (file)
@@ -56,9 +56,9 @@ int install_otg_ip(unsigned long addr,
 int check_install_pages_in_file(struct task_struct *task, struct sspt_file *file);
 int unregister_us_page_probe(struct task_struct *task,
                             struct sspt_page *page, enum US_FLAGS flag);
-void install_proc_probes(struct task_struct *task, struct sspt_procs *procs, int atomic);
+void install_proc_probes(struct task_struct *task, struct sspt_procs *procs);
 pid_t find_proc_by_task(const struct task_struct *task, struct dentry *dentry);
-void install_page_probes(unsigned long page_addr, struct task_struct *task, struct sspt_procs *procs, int atomic);
+void install_page_probes(unsigned long page_addr, struct task_struct *task, struct sspt_procs *procs);
 int uninstall_us_proc_probes(struct task_struct *task, struct sspt_procs *procs, enum US_FLAGS flag);
 int check_vma(struct vm_area_struct *vma);
 int unregister_us_file_probes(struct task_struct *task, struct sspt_file *file, enum US_FLAGS flag);