From: Vyacheslav Cherkashin Date: Tue, 7 May 2013 13:20:28 +0000 (+0400) Subject: [REFACTOR] new interface at sspt_register_page() X-Git-Tag: Tizen_SDK_2.3~507 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4c376fd8d55d752d19b50b67839a8d3f9ba82a8;p=kernel%2Fswap-modules.git [REFACTOR] new interface at sspt_register_page() -int sspt_register_page(struct sspt_page *page, struct sspt_file *file, struct task_struct *task) +int sspt_register_page(struct sspt_page *page, struct sspt_file *file) --- diff --git a/driver/sspt/sspt_page.c b/driver/sspt/sspt_page.c index 2daa00a..2fe3bef 100644 --- a/driver/sspt/sspt_page.c +++ b/driver/sspt/sspt_page.c @@ -129,9 +129,7 @@ void sspt_set_all_ip_addr(struct sspt_page *page, const struct sspt_file *file) } } -int sspt_register_page(struct sspt_page *page, - struct sspt_file *file, - struct task_struct *task) +int sspt_register_page(struct sspt_page *page, struct sspt_file *file) { int err = 0; struct us_ip *ip, *n; @@ -139,6 +137,8 @@ int sspt_register_page(struct sspt_page *page, spin_lock(&page->lock); if (sspt_page_is_install(page)) { + struct task_struct *task = page->file->procs->task; + printk("page %lx in %s task[tgid=%u, pid=%u] already installed\n", page->offset, file->dentry->d_iname, task->tgid, task->pid); goto unlock; diff --git a/driver/sspt/sspt_page.h b/driver/sspt/sspt_page.h index 1060791..5c98ace 100644 --- a/driver/sspt/sspt_page.h +++ b/driver/sspt/sspt_page.h @@ -74,9 +74,7 @@ static inline void sspt_page_uninstalled(struct sspt_page *page) void sspt_set_all_ip_addr(struct sspt_page *page, const struct sspt_file *file); -int sspt_register_page(struct sspt_page *page, - struct sspt_file *file, - struct task_struct *task); +int sspt_register_page(struct sspt_page *page, struct sspt_file *file); int sspt_unregister_page(struct sspt_page *page, enum US_FLAGS flag, diff --git a/driver/us_proc_inst.c b/driver/us_proc_inst.c index beba07f..43c3180 100644 --- a/driver/us_proc_inst.c +++ b/driver/us_proc_inst.c @@ -361,7 +361,7 @@ void install_page_probes(unsigned long page_addr, struct task_struct *task, stru page = sspt_find_page_mapped(file, page_addr); if (page) { - sspt_register_page(page, file, task); + sspt_register_page(page, file); } } } @@ -379,7 +379,7 @@ static void install_file_probes(struct task_struct *task, struct mm_struct *mm, for (i = 0; i < table_size; ++i) { head = &file->page_probes_table[i]; swap_hlist_for_each_entry_rcu(page, node, head, hlist) { - sspt_register_page(page, file, task); + sspt_register_page(page, file); } } }