From a2e0ee7e462f452a6101977eb6ab10304a860cf2 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Mon, 28 Jan 2013 15:46:30 +0400 Subject: [PATCH] rename functions in sspt_procs --- driver/device_driver.c | 2 +- driver/new_dpf.h | 2 +- driver/sspt/sspt_procs.c | 22 +++++++++++----------- driver/sspt/sspt_procs.h | 10 +++++----- driver/us_proc_inst.c | 8 ++++---- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/driver/device_driver.c b/driver/device_driver.c index db9be17..c29b006 100644 --- a/driver/device_driver.c +++ b/driver/device_driver.c @@ -537,7 +537,7 @@ static long device_ioctl (struct file *file UNUSED, unsigned int cmd, unsigned l goto sad_cleanup; } - proc_p_free_all(); + sspt_procs_free_all(); vfree(bundle); result = 0; diff --git a/driver/new_dpf.h b/driver/new_dpf.h index 20e4c13..f052776 100644 --- a/driver/new_dpf.h +++ b/driver/new_dpf.h @@ -47,7 +47,7 @@ static void print_proc_probes(const struct sspt_procs *procs); struct sspt_procs *get_file_probes(const inst_us_proc_t *task_inst_info) { - struct sspt_procs *procs = proc_p_create(task_inst_info->m_f_dentry, 0); + struct sspt_procs *procs = sspt_procs_create(task_inst_info->m_f_dentry, 0); printk("####### get START #######\n"); diff --git a/driver/sspt/sspt_procs.c b/driver/sspt/sspt_procs.c index a8800f9..7ec8584 100644 --- a/driver/sspt/sspt_procs.c +++ b/driver/sspt/sspt_procs.c @@ -4,7 +4,7 @@ extern struct list_head proc_probes_list; -struct sspt_procs *proc_p_create(struct dentry* dentry, pid_t tgid) +struct sspt_procs *sspt_procs_create(struct dentry* dentry, pid_t tgid) { struct sspt_procs *procs = kmalloc(sizeof(*procs), GFP_ATOMIC); @@ -18,7 +18,7 @@ struct sspt_procs *proc_p_create(struct dentry* dentry, pid_t tgid) return procs; } -void proc_p_free(struct sspt_procs *procs) +void sspt_procs_free(struct sspt_procs *procs) { struct sspt_file *file, *n; list_for_each_entry_safe(file, n, &procs->file_list, list) { @@ -33,23 +33,23 @@ void proc_p_free(struct sspt_procs *procs) #include "../storage.h" extern inst_us_proc_t us_proc_info; -void proc_p_free_all(void) +void sspt_procs_free_all(void) { if (strcmp(us_proc_info.path,"*") == 0) { // app - proc_p_free(us_proc_info.pp); + sspt_procs_free(us_proc_info.pp); us_proc_info.pp = NULL; } else { // libonly struct sspt_procs *procs, *n; list_for_each_entry_safe(procs, n, &proc_probes_list, list) { list_del(&procs->list); - proc_p_free(procs); + sspt_procs_free(procs); } } } -static void proc_p_add_file_p(struct sspt_procs *procs, struct sspt_file *file) +static void sspt_procs_add_file(struct sspt_procs *procs, struct sspt_file *file) { list_add(&file->list, &procs->file_list); } @@ -66,7 +66,7 @@ struct sspt_file *proc_p_find_file_p_by_dentry(struct sspt_procs *procs, } file = file_p_new(pach, dentry, 10); - proc_p_add_file_p(procs, file); + sspt_procs_add_file(procs, file); return file; } @@ -82,19 +82,19 @@ void proc_p_add_dentry_probes(struct sspt_procs *procs, const char *pach, } } -struct sspt_procs *proc_p_copy(struct sspt_procs *procs, struct task_struct *task) +struct sspt_procs *sspt_procs_copy(struct sspt_procs *procs, struct task_struct *task) { struct sspt_file *file; - struct sspt_procs *procs_out = proc_p_create(procs->dentry, task->tgid); + struct sspt_procs *procs_out = sspt_procs_create(procs->dentry, task->tgid); list_for_each_entry(file, &procs->file_list, list) { - proc_p_add_file_p(procs_out, file_p_copy(file)); + sspt_procs_add_file(procs_out, file_p_copy(file)); } return procs_out; } -struct sspt_file *proc_p_find_file_p(struct sspt_procs *procs, struct vm_area_struct *vma) +struct sspt_file *sspt_procs_find_file(struct sspt_procs *procs, struct vm_area_struct *vma) { struct sspt_file *file; diff --git a/driver/sspt/sspt_procs.h b/driver/sspt/sspt_procs.h index fe985c5..f10ca71 100644 --- a/driver/sspt/sspt_procs.h +++ b/driver/sspt/sspt_procs.h @@ -12,15 +12,15 @@ struct sspt_procs { }; -struct sspt_procs *proc_p_create(struct dentry* dentry, pid_t tgid); -struct sspt_procs *proc_p_copy(struct sspt_procs *procs, struct task_struct *task); -void proc_p_free(struct sspt_procs *procs); -void proc_p_free_all(void); +struct sspt_procs *sspt_procs_create(struct dentry* dentry, pid_t tgid); +struct sspt_procs *sspt_procs_copy(struct sspt_procs *procs, struct task_struct *task); +void sspt_procs_free(struct sspt_procs *procs); +void sspt_procs_free_all(void); void proc_p_add_dentry_probes(struct sspt_procs *procs, const char *pach, struct dentry* dentry, struct ip_data *ip_d, int cnt); struct sspt_file *proc_p_find_file_p_by_dentry(struct sspt_procs *procs, const char *pach, struct dentry *dentry); -struct sspt_file *proc_p_find_file_p(struct sspt_procs *procs, struct vm_area_struct *vma); +struct sspt_file *sspt_procs_find_file(struct sspt_procs *procs, struct vm_area_struct *vma); #endif /* __PROC_PROBES__ */ diff --git a/driver/us_proc_inst.c b/driver/us_proc_inst.c index 6708fe7..f680698 100644 --- a/driver/us_proc_inst.c +++ b/driver/us_proc_inst.c @@ -139,7 +139,7 @@ struct sspt_procs *get_proc_probes_by_task_or_new(struct task_struct *task) { struct sspt_procs *procs = get_proc_probes_by_task(task); if (procs == NULL) { - procs = proc_p_copy(us_proc_info.pp, task); + procs = sspt_procs_copy(us_proc_info.pp, task); add_proc_probes(task, procs); } @@ -1117,7 +1117,7 @@ static void install_page_probes(unsigned long page_addr, struct task_struct *tas vma = find_vma(mm, page_addr); if (vma && check_vma(vma)) { - struct sspt_file *file = proc_p_find_file_p(procs, vma); + struct sspt_file *file = sspt_procs_find_file(procs, vma); if (file) { struct page_probes *page; if (!file->loaded) { @@ -1162,7 +1162,7 @@ static void install_proc_probes(struct task_struct *task, struct sspt_procs *pro for (vma = mm->mmap; vma; vma = vma->vm_next) { if (check_vma(vma)) { - struct sspt_file *file = proc_p_find_file_p(procs, vma); + struct sspt_file *file = sspt_procs_find_file(procs, vma); if (file) { if (!file->loaded) { set_mapping_file(file, procs, task, vma); @@ -1396,7 +1396,7 @@ static int remove_unmap_probes(struct task_struct *task, struct sspt_procs *proc struct sspt_file *file; unsigned long end = start + len; - file = proc_p_find_file_p(procs, vma); + file = sspt_procs_find_file(procs, vma); if (file) { if (vma->vm_start == start || vma->vm_end == end) { unregister_us_file_probes(task, file, US_NOT_RP2); -- 2.7.4