}
}
- if (check_install_pages_in_file(task, file)) {
+ if (sspt_file_check_install_pages(file)) {
file->loaded = 0;
}
}
{
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;
+}
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__ */
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;
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);