From: Vyacheslav Cherkashin Date: Mon, 6 May 2013 11:14:31 +0000 (+0400) Subject: [REFACTOR] remove argument 'atomic' X-Git-Tag: Tizen_SDK_2.3~515 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=46ea8aaf32a1d0f302b7d7c4a453225eb0581616;p=kernel%2Fswap-modules.git [REFACTOR] remove argument 'atomic' from: install_proc_probes() install_page_probes() --- diff --git a/driver/helper.c b/driver/helper.c index 3c5c97b..91acea7 100644 --- a/driver/helper.c +++ b/driver/helper.c @@ -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: diff --git a/driver/us_proc_inst.c b/driver/us_proc_inst.c index 48d7268..5024f1e 100644 --- a/driver/us_proc_inst.c +++ b/driver/us_proc_inst.c @@ -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) { diff --git a/driver/us_proc_inst.h b/driver/us_proc_inst.h index a3f2f21..8aef81c 100644 --- a/driver/us_proc_inst.h +++ b/driver/us_proc_inst.h @@ -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);