[REFACTOR] move and rename check_install_pages_in_file()
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 7 May 2013 12:49:31 +0000 (16:49 +0400)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Tue, 7 May 2013 12:49:31 +0000 (16:49 +0400)
move:
from src/modules/driver/us_proc_inst.c
to src/modules/driver/sspt/sspt_file.c

rename:
check_install_pages_in_file() --> sspt_file_check_install_pages()

driver/helper.c
driver/sspt/sspt_file.c
driver/sspt/sspt_file.h
driver/us_proc_inst.c
driver/us_proc_inst.h

index 0d61f9e..7bf8cec 100644 (file)
@@ -223,7 +223,7 @@ static int remove_unmap_probes(struct task_struct *task, struct sspt_procs *proc
                                        }
                                }
 
-                               if (check_install_pages_in_file(task, file)) {
+                               if (sspt_file_check_install_pages(file)) {
                                        file->loaded = 0;
                                }
                        }
index c8f72d9..e36ae71 100644 (file)
@@ -204,3 +204,23 @@ void sspt_put_page(struct sspt_page *page)
 {
        spin_unlock(&page->lock);
 }
+
+int sspt_file_check_install_pages(struct sspt_file *file)
+{
+       int i, table_size;
+       struct sspt_page *page;
+       struct hlist_node *node, *tmp;
+       struct hlist_head *head;
+
+       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_safe(page, node, tmp, head, hlist) {
+                       if (sspt_page_is_install(page)) {
+                               return 1;
+                       }
+               }
+       }
+
+       return 0;
+}
index b85a66e..52b8871 100644 (file)
@@ -53,4 +53,6 @@ void sspt_file_add_ip(struct sspt_file *file, struct ip_data *ip_d);
 struct sspt_page *sspt_get_page(struct sspt_file *file, unsigned long offset_addr);
 void sspt_put_page(struct sspt_page *page);
 
+int sspt_file_check_install_pages(struct sspt_file *file);
+
 #endif /* __SSPT_FILE__ */
index 673eeae..28d7b8c 100644 (file)
@@ -411,26 +411,6 @@ void install_proc_probes(struct task_struct *task, struct sspt_procs *procs)
        mm_read_unlock(mm, atomic, lock);
 }
 
-int check_install_pages_in_file(struct task_struct *task, struct sspt_file *file)
-{
-       int i;
-       int table_size = (1 << file->page_probes_hash_bits);
-       struct sspt_page *page;
-       struct hlist_node *node, *tmp;
-       struct hlist_head *head;
-
-       for (i = 0; i < table_size; ++i) {
-               head = &file->page_probes_table[i];
-               swap_hlist_for_each_entry_safe (page, node, tmp, head, hlist) {
-                       if (page->install) {
-                               return 1;
-                       }
-               }
-       }
-
-       return 0;
-}
-
 int unregister_us_file_probes(struct task_struct *task, struct sspt_file *file, enum US_FLAGS flag)
 {
        int i, err = 0;
index e27f16d..c9b7ab8 100644 (file)
@@ -52,8 +52,6 @@ int install_otg_ip(unsigned long addr,
                        unsigned long jp_handler,
                        uretprobe_handler_t rp_handler);
 
-
-int check_install_pages_in_file(struct task_struct *task, struct sspt_file *file);
 void install_proc_probes(struct task_struct *task, struct sspt_procs *procs);
 int check_dentry(struct task_struct *task, struct dentry *dentry);
 void install_page_probes(unsigned long page_addr, struct task_struct *task, struct sspt_procs *procs);