parisc: convert cpu_check_affinity to new cpumask api
[safe/jmp/linux-2.6] / drivers / misc / lkdtm.c
index e689ee9..1bfe5d1 100644 (file)
  */
 
 #include <linux/kernel.h>
+#include <linux/fs.h>
 #include <linux/module.h>
+#include <linux/buffer_head.h>
 #include <linux/kprobes.h>
-#include <linux/kallsyms.h>
+#include <linux/list.h>
 #include <linux/init.h>
-#include <linux/irq.h>
 #include <linux/interrupt.h>
+#include <linux/hrtimer.h>
 #include <scsi/scsi_cmnd.h>
 
 #ifdef CONFIG_IDE
@@ -106,8 +108,8 @@ static struct jprobe lkdtm;
 static int lkdtm_parse_commandline(void);
 static void lkdtm_handler(void);
 
-static char* cpoint_name = INVALID;
-static char* cpoint_type = NONE;
+static char* cpoint_name;
+static char* cpoint_type;
 static int cpoint_count = DEFAULT_COUNT;
 static int recur_count = REC_NUM_DEFAULT;
 
@@ -116,39 +118,39 @@ static enum ctype cptype = NONE;
 static int count = DEFAULT_COUNT;
 
 module_param(recur_count, int, 0644);
-MODULE_PARM_DESC(recur_count, "Recurcion level for the stack overflow test,\
-                                default is 10");
+MODULE_PARM_DESC(recur_count, " Recursion level for the stack overflow test, "\
+                                "default is 10");
 module_param(cpoint_name, charp, 0644);
-MODULE_PARM_DESC(cpoint_name, "Crash Point, where kernel is to be crashed");
-module_param(cpoint_type, charp, 06444);
-MODULE_PARM_DESC(cpoint_type, "Crash Point Type, action to be taken on\
-                               hitting the crash point");
-module_param(cpoint_count, int, 06444);
-MODULE_PARM_DESC(cpoint_count, "Crash Point Count, number of times the \
-                               crash point is to be hit to trigger action");
-
-unsigned int jp_do_irq(unsigned int irq, struct pt_regs *regs)
+MODULE_PARM_DESC(cpoint_name, " Crash Point, where kernel is to be crashed");
+module_param(cpoint_type, charp, 0644);
+MODULE_PARM_DESC(cpoint_type, " Crash Point Type, action to be taken on "\
+                               "hitting the crash point");
+module_param(cpoint_count, int, 0644);
+MODULE_PARM_DESC(cpoint_count, " Crash Point Count, number of times the "\
+                               "crash point is to be hit to trigger action");
+
+static unsigned int jp_do_irq(unsigned int irq)
 {
        lkdtm_handler();
        jprobe_return();
        return 0;
 }
 
-irqreturn_t jp_handle_irq_event(unsigned int irq, struct pt_regs *regs,
-                       struct irqaction *action)
+static irqreturn_t jp_handle_irq_event(unsigned int irq,
+                                      struct irqaction *action)
 {
        lkdtm_handler();
        jprobe_return();
        return 0;
 }
 
-void jp_tasklet_action(struct softirq_action *a)
+static void jp_tasklet_action(struct softirq_action *a)
 {
        lkdtm_handler();
        jprobe_return();
 }
 
-void jp_ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
+static void jp_ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
 {
        lkdtm_handler();
        jprobe_return();
@@ -156,23 +158,24 @@ void jp_ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
 
 struct scan_control;
 
-unsigned long jp_shrink_page_list(struct list_head *page_list,
-                                        struct scan_control *sc)
+static unsigned long jp_shrink_inactive_list(unsigned long max_scan,
+                                            struct zone *zone,
+                                            struct scan_control *sc)
 {
        lkdtm_handler();
        jprobe_return();
        return 0;
 }
 
-int jp_hrtimer_start(struct hrtimer *timer, ktime_t tim,
-                               const enum hrtimer_mode mode)
+static int jp_hrtimer_start(struct hrtimer *timer, ktime_t tim,
+                           const enum hrtimer_mode mode)
 {
        lkdtm_handler();
        jprobe_return();
        return 0;
 }
 
-int jp_scsi_dispatch_cmd(struct scsi_cmnd *cmd)
+static int jp_scsi_dispatch_cmd(struct scsi_cmnd *cmd)
 {
        lkdtm_handler();
        jprobe_return();
@@ -194,7 +197,7 @@ static int lkdtm_parse_commandline(void)
 {
        int i;
 
-       if (cpoint_name == INVALID || cpoint_type == NONE ||
+       if (cpoint_name == NULL || cpoint_type == NULL ||
                                        cpoint_count < 1 || recur_count < 1)
                return -EINVAL;
 
@@ -269,7 +272,7 @@ void lkdtm_handler(void)
        }
 }
 
-int lkdtm_module_init(void)
+static int __init lkdtm_module_init(void)
 {
        int ret;
 
@@ -296,8 +299,8 @@ int lkdtm_module_init(void)
                lkdtm.entry = (kprobe_opcode_t*) jp_ll_rw_block;
                break;
        case MEM_SWAPOUT:
-               lkdtm.kp.symbol_name = "shrink_page_list";
-               lkdtm.entry = (kprobe_opcode_t*) jp_shrink_page_list;
+               lkdtm.kp.symbol_name = "shrink_inactive_list";
+               lkdtm.entry = (kprobe_opcode_t*) jp_shrink_inactive_list;
                break;
        case TIMERADD:
                lkdtm.kp.symbol_name = "hrtimer_start";
@@ -330,7 +333,7 @@ int lkdtm_module_init(void)
        return 0;
 }
 
-void lkdtm_module_exit(void)
+static void __exit lkdtm_module_exit(void)
 {
         unregister_jprobe(&lkdtm);
         printk(KERN_INFO "lkdtm : Crash point unregistered\n");