From 401f0c5212017b57baca00c648c0613da274b08f Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Tue, 7 May 2013 17:35:05 +0400 Subject: [PATCH] [REFACTOR] move and rename install_file_probes() move: from src/modules/driver/us_proc_inst.c to src/modules/driver/sspt/sspt_file.c rename: install_file_probes() --> sspt_file_install() --- driver/sspt/sspt_file.c | 15 +++++++++++++++ driver/sspt/sspt_file.h | 1 + driver/us_proc_inst.c | 17 +---------------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/driver/sspt/sspt_file.c b/driver/sspt/sspt_file.c index e36ae71..49d92a9 100644 --- a/driver/sspt/sspt_file.c +++ b/driver/sspt/sspt_file.c @@ -224,3 +224,18 @@ int sspt_file_check_install_pages(struct sspt_file *file) return 0; } + +void sspt_file_install(struct sspt_file *file) +{ + struct sspt_page *page = NULL; + struct hlist_node *node = NULL; + struct hlist_head *head = NULL; + int i, table_size = (1 << file->page_probes_hash_bits); + + 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); + } + } +} diff --git a/driver/sspt/sspt_file.h b/driver/sspt/sspt_file.h index 52b8871..14e8b4f 100644 --- a/driver/sspt/sspt_file.h +++ b/driver/sspt/sspt_file.h @@ -54,5 +54,6 @@ struct sspt_page *sspt_get_page(struct sspt_file *file, unsigned long offset_add void sspt_put_page(struct sspt_page *page); int sspt_file_check_install_pages(struct sspt_file *file); +void sspt_file_install(struct sspt_file *file); #endif /* __SSPT_FILE__ */ diff --git a/driver/us_proc_inst.c b/driver/us_proc_inst.c index 4cf1d50..57f966c 100644 --- a/driver/us_proc_inst.c +++ b/driver/us_proc_inst.c @@ -369,21 +369,6 @@ void install_page_probes(unsigned long page_addr, struct task_struct *task, stru mm_read_unlock(mm, atomic, lock); } -static void install_file_probes(struct sspt_file *file) -{ - struct sspt_page *page = NULL; - struct hlist_node *node = NULL; - struct hlist_head *head = NULL; - int i, table_size = (1 << file->page_probes_hash_bits); - - 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); - } - } -} - void install_proc_probes(struct task_struct *task, struct sspt_procs *procs) { int lock, atomic; @@ -403,7 +388,7 @@ void install_proc_probes(struct task_struct *task, struct sspt_procs *procs) file->loaded = 1; } - install_file_probes(file); + sspt_file_install(file); } } } -- 2.7.4