From 9e3bc7a235af21df148b45f5c0a22c3419f2c2da Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Wed, 24 Apr 2013 19:51:33 +0400 Subject: [PATCH] [REFACTOR] move probes_manager_/init/down() from src/modules/driver/probes_manager.c to src/modules/driver/module.c --- driver/module.c | 21 +++++++++++++++++++++ driver/probes_manager.c | 23 ----------------------- driver/probes_manager.h | 3 --- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/driver/module.c b/driver/module.c index 9261bcc..e697269 100644 --- a/driver/module.c +++ b/driver/module.c @@ -63,6 +63,27 @@ void __put_task_struct(struct task_struct *tsk) void (*flush_cache_page) (struct vm_area_struct * vma, unsigned long page); #endif +static int probes_manager_init(void) +{ + int ret; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38) + spin_lock_init(&ec_spinlock); +#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38) */ + + ret = init_helper(); + if (ret) + return ret; + + return storage_init(); +} + +static void probes_manager_down(void) +{ + unset_kernel_probes(); + uninit_helper(); + storage_down(); +} + static int __init InitializeModule(void) { if(device_name == NULL) { diff --git a/driver/probes_manager.c b/driver/probes_manager.c index ce7c625..02310dd 100644 --- a/driver/probes_manager.c +++ b/driver/probes_manager.c @@ -24,29 +24,6 @@ /* list of selected non-predefined kernel probes */ static HLIST_HEAD(kernel_probes); -int -probes_manager_init (void) -{ - int ret; -#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38) - spin_lock_init(&ec_spinlock); -#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38) */ - - ret = init_helper(); - if (ret) - return ret; - - return storage_init (); -} - -void -probes_manager_down (void) -{ - unset_kernel_probes(); - uninit_helper(); - storage_down (); -} - static int register_kernel_probe(kernel_probe_t *p) { int ret; diff --git a/driver/probes_manager.h b/driver/probes_manager.h index 8b32f45..15ef0a8 100644 --- a/driver/probes_manager.h +++ b/driver/probes_manager.h @@ -28,9 +28,6 @@ typedef struct struct hlist_node hlist; } kernel_probe_t; -extern int probes_manager_init (void); -extern void probes_manager_down (void); - extern int add_probe (unsigned long addr); extern int reset_probes(void); -- 2.7.4