[REFACTOR] new interface at sspt_register_page()
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 7 May 2013 13:20:28 +0000 (17:20 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 7 May 2013 13:31:59 +0000 (17:31 +0400)
-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)

driver/sspt/sspt_page.c
driver/sspt/sspt_page.h
driver/us_proc_inst.c

index 2daa00a..2fe3bef 100644 (file)
@@ -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;
index 1060791..5c98ace 100644 (file)
@@ -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,
index beba07f..43c3180 100644 (file)
@@ -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);
                }
        }
 }