From 830bed053cd89d42be8b93a0647e0d18ababcfe2 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Mon, 28 Jan 2013 17:25:41 +0400 Subject: [PATCH] rename functions in sspt_file --- driver/sspt/sspt_file.c | 14 +++++++------- driver/sspt/sspt_file.h | 14 +++++++------- driver/sspt/sspt_procs.c | 8 ++++---- driver/us_proc_inst.c | 10 +++++----- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/driver/sspt/sspt_file.c b/driver/sspt/sspt_file.c index 0a8f111..95daf3f 100644 --- a/driver/sspt/sspt_file.c +++ b/driver/sspt/sspt_file.c @@ -13,7 +13,7 @@ static int calculation_hash_bits(int cnt) return bits; } -struct sspt_file *file_p_new(const char *path, struct dentry *dentry, int page_cnt) +struct sspt_file *sspt_file_create(const char *path, struct dentry *dentry, int page_cnt) { struct sspt_file *obj = kmalloc(sizeof(*obj), GFP_ATOMIC); @@ -38,7 +38,7 @@ struct sspt_file *file_p_new(const char *path, struct dentry *dentry, int page_c return obj; } -void file_p_del(struct sspt_file *file) +void sspt_file_free(struct sspt_file *file) { struct hlist_node *p, *n; struct hlist_head *head; @@ -62,7 +62,7 @@ static void file_p_add_page_p(struct sspt_file *file, struct sspt_page *page) hlist_add_head(&page->hlist, &file->page_probes_table[hash_ptr(page->offset, file->page_probes_hash_bits)]); } -struct sspt_file *file_p_copy(const struct sspt_file *file) +struct sspt_file *sspt_file_copy(const struct sspt_file *file) { struct sspt_file *file_out; @@ -134,7 +134,7 @@ static struct sspt_page *file_p_find_page_p_or_new(struct sspt_file *file, unsig return page; } -struct sspt_page *file_p_find_page_p_mapped(struct sspt_file *file, unsigned long page) +struct sspt_page *sspt_find_page_mapped(struct sspt_file *file, unsigned long page) { unsigned long offset; @@ -150,7 +150,7 @@ struct sspt_page *file_p_find_page_p_mapped(struct sspt_file *file, unsigned lon return file_p_find_page_p(file, offset); } -void file_p_add_probe(struct sspt_file *file, struct ip_data *ip_d) +void sspt_file_add_ip(struct sspt_file *file, struct ip_data *ip_d) { unsigned long offset = ip_d->offset & PAGE_MASK; struct sspt_page *page = file_p_find_page_p_or_new(file, offset); @@ -161,7 +161,7 @@ void file_p_add_probe(struct sspt_file *file, struct ip_data *ip_d) page_p_add_ip(page, ip); } -struct sspt_page *get_page_p(struct sspt_file *file, unsigned long offset_addr) +struct sspt_page *sspt_get_page(struct sspt_file *file, unsigned long offset_addr) { unsigned long offset = offset_addr & PAGE_MASK; struct sspt_page *page = file_p_find_page_p_or_new(file, offset); @@ -171,7 +171,7 @@ struct sspt_page *get_page_p(struct sspt_file *file, unsigned long offset_addr) return page; } -void put_page_p(struct sspt_page *page) +void sspt_put_page(struct sspt_page *page) { spin_unlock(&page->lock); } diff --git a/driver/sspt/sspt_file.h b/driver/sspt/sspt_file.h index 5c4e289..5b04ece 100644 --- a/driver/sspt/sspt_file.h +++ b/driver/sspt/sspt_file.h @@ -18,14 +18,14 @@ struct sspt_file { }; -struct sspt_file *file_p_new(const char *path, struct dentry *dentry, int page_cnt); -struct sspt_file *file_p_copy(const struct sspt_file *file); -void file_p_del(struct sspt_file *file); +struct sspt_file *sspt_file_create(const char *path, struct dentry *dentry, int page_cnt); +struct sspt_file *sspt_file_copy(const struct sspt_file *file); +void sspt_file_free(struct sspt_file *file); -struct sspt_page *file_p_find_page_p_mapped(struct sspt_file *file, unsigned long page); -void file_p_add_probe(struct sspt_file *file, struct ip_data *ip_d); +struct sspt_page *sspt_find_page_mapped(struct sspt_file *file, unsigned long page); +void sspt_file_add_ip(struct sspt_file *file, struct ip_data *ip_d); -struct sspt_page *get_page_p(struct sspt_file *file, unsigned long offset_addr); -void put_page_p(struct sspt_page *page); +struct sspt_page *sspt_get_page(struct sspt_file *file, unsigned long offset_addr); +void sspt_put_page(struct sspt_page *page); #endif /* __FILE_PROBES__ */ diff --git a/driver/sspt/sspt_procs.c b/driver/sspt/sspt_procs.c index 7ec8584..a09cc7e 100644 --- a/driver/sspt/sspt_procs.c +++ b/driver/sspt/sspt_procs.c @@ -23,7 +23,7 @@ void sspt_procs_free(struct sspt_procs *procs) struct sspt_file *file, *n; list_for_each_entry_safe(file, n, &procs->file_list, list) { list_del(&file->list); - file_p_del(file); + sspt_file_free(file); } kfree(procs); @@ -65,7 +65,7 @@ struct sspt_file *proc_p_find_file_p_by_dentry(struct sspt_procs *procs, } } - file = file_p_new(pach, dentry, 10); + file = sspt_file_create(pach, dentry, 10); sspt_procs_add_file(procs, file); return file; @@ -78,7 +78,7 @@ void proc_p_add_dentry_probes(struct sspt_procs *procs, const char *pach, struct sspt_file *file = proc_p_find_file_p_by_dentry(procs, pach, dentry); for (i = 0; i < cnt; ++i) { - file_p_add_probe(file, &ip_d[i]); + sspt_file_add_ip(file, &ip_d[i]); } } @@ -88,7 +88,7 @@ struct sspt_procs *sspt_procs_copy(struct sspt_procs *procs, struct task_struct struct sspt_procs *procs_out = sspt_procs_create(procs->dentry, task->tgid); list_for_each_entry(file, &procs->file_list, list) { - sspt_procs_add_file(procs_out, file_p_copy(file)); + sspt_procs_add_file(procs_out, sspt_file_copy(file)); } return procs_out; diff --git a/driver/us_proc_inst.c b/driver/us_proc_inst.c index f680698..7dffb3c 100644 --- a/driver/us_proc_inst.c +++ b/driver/us_proc_inst.c @@ -606,7 +606,7 @@ int install_otg_ip(unsigned long addr, }; struct sspt_file *file = proc_p_find_file_p_by_dentry(procs, name, dentry); - struct sspt_page *page = get_page_p(file, offset_addr); + struct sspt_page *page = sspt_get_page(file, offset_addr); struct us_ip *ip = page_p_find_ip(page, offset_addr & ~PAGE_MASK); if (!file->loaded) { @@ -616,7 +616,7 @@ int install_otg_ip(unsigned long addr, if (ip == NULL) { struct sspt_file *file = proc_p_find_file_p_by_dentry(procs, name, dentry); - file_p_add_probe(file, &pd); + sspt_file_add_ip(file, &pd); /* if addr mapping, that probe install, else it be installed in do_page_fault handler */ if (page_present(mm, addr)) { @@ -633,7 +633,7 @@ int install_otg_ip(unsigned long addr, } } - put_page_p(page); + sspt_put_page(page); } } @@ -1125,7 +1125,7 @@ static void install_page_probes(unsigned long page_addr, struct task_struct *tas file->loaded = 1; } - page = file_p_find_page_p_mapped(file, page_addr); + page = sspt_find_page_mapped(file, page_addr); if (page) { register_us_page_probe(page, file, task); } @@ -1406,7 +1406,7 @@ static int remove_unmap_probes(struct task_struct *task, struct sspt_procs *proc struct sspt_page *page; for (page_addr = vma->vm_start; page_addr < vma->vm_end; page_addr += PAGE_SIZE) { - page = file_p_find_page_p_mapped(file, page_addr); + page = sspt_find_page_mapped(file, page_addr); if (page) { unregister_us_page_probe(task, page, US_NOT_RP2); } -- 2.7.4