Merge branch 'dev' into kernel
[kernel/swap-modules.git] / driver / sspt / sspt_file.c
index 1c64a43..c8f72d9 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/slab.h>
 #include <linux/list.h>
 #include <linux/hash.h>
+#include <dbi_kprobes_deps.h>
 
 static int calculation_hash_bits(int cnt)
 {
@@ -42,6 +43,8 @@ struct sspt_file *sspt_file_create(char *name, struct dentry *dentry, int page_c
 
        if (obj) {
                int i, table_size;
+               INIT_LIST_HEAD(&obj->list);
+               obj->procs = NULL;
                obj->name = name;
                obj->dentry = dentry;
                obj->loaded = 0;
@@ -82,6 +85,7 @@ void sspt_file_free(struct sspt_file *file)
 
 static void sspt_add_page(struct sspt_file *file, struct sspt_page *page)
 {
+       page->file = file;
        hlist_add_head(&page->hlist, &file->page_probes_table[hash_ptr((void *)page->offset,
                                file->page_probes_hash_bits)]);
 }
@@ -102,6 +106,7 @@ struct sspt_file *sspt_file_copy(const struct sspt_file *file)
                struct hlist_head *head = NULL;
                int i, table_size;
                INIT_LIST_HEAD(&file_out->list);
+               file_out->procs = NULL;
                file_out->dentry = file->dentry;
                file_out->name = file->name;
                file_out->loaded = 0;