]> err.no Git - linux-2.6/blobdiff - fs/dlm/lockspace.c
Pull error-inject into release branch
[linux-2.6] / fs / dlm / lockspace.c
index f8842ca443c24dda7e24344ee38a5a61e560acf3..f40817b53c6fc33fd39e112a7b3d2a07e7089c16 100644 (file)
@@ -22,6 +22,7 @@
 #include "memory.h"
 #include "lock.h"
 #include "recover.h"
+#include "requestqueue.h"
 
 #ifdef CONFIG_DLM_DEBUG
 int dlm_create_debug_file(struct dlm_ls *ls);
@@ -235,7 +236,7 @@ static int dlm_scand(void *data)
        while (!kthread_should_stop()) {
                list_for_each_entry(ls, &lslist, ls_list)
                        dlm_scan_rsbs(ls);
-               schedule_timeout_interruptible(dlm_config.scan_secs * HZ);
+               schedule_timeout_interruptible(dlm_config.ci_scan_secs * HZ);
        }
        return 0;
 }
@@ -421,7 +422,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
        ls->ls_count = 0;
        ls->ls_flags = 0;
 
-       size = dlm_config.rsbtbl_size;
+       size = dlm_config.ci_rsbtbl_size;
        ls->ls_rsbtbl_size = size;
 
        ls->ls_rsbtbl = kmalloc(sizeof(struct dlm_rsbtable) * size, GFP_KERNEL);
@@ -433,7 +434,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
                rwlock_init(&ls->ls_rsbtbl[i].lock);
        }
 
-       size = dlm_config.lkbtbl_size;
+       size = dlm_config.ci_lkbtbl_size;
        ls->ls_lkbtbl_size = size;
 
        ls->ls_lkbtbl = kmalloc(sizeof(struct dlm_lkbtable) * size, GFP_KERNEL);
@@ -445,7 +446,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
                ls->ls_lkbtbl[i].counter = 1;
        }
 
-       size = dlm_config.dirtbl_size;
+       size = dlm_config.ci_dirtbl_size;
        ls->ls_dirtbl_size = size;
 
        ls->ls_dirtbl = kmalloc(sizeof(struct dlm_dirtable) * size, GFP_KERNEL);
@@ -478,6 +479,8 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
        ls->ls_recoverd_task = NULL;
        mutex_init(&ls->ls_recoverd_active);
        spin_lock_init(&ls->ls_recover_lock);
+       spin_lock_init(&ls->ls_rcom_spin);
+       get_random_bytes(&ls->ls_rcom_seq, sizeof(uint64_t));
        ls->ls_recover_status = 0;
        ls->ls_recover_seq = 0;
        ls->ls_recover_args = NULL;
@@ -486,7 +489,7 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
        mutex_init(&ls->ls_requestqueue_mutex);
        mutex_init(&ls->ls_clear_proc_locks);
 
-       ls->ls_recover_buf = kmalloc(dlm_config.buffer_size, GFP_KERNEL);
+       ls->ls_recover_buf = kmalloc(dlm_config.ci_buffer_size, GFP_KERNEL);
        if (!ls->ls_recover_buf)
                goto out_dirfree;
 
@@ -684,6 +687,7 @@ static int release_lockspace(struct dlm_ls *ls, int force)
         * Free structures on any other lists
         */
 
+       dlm_purge_requestqueue(ls);
        kfree(ls->ls_recover_args);
        dlm_clear_free_entries(ls);
        dlm_clear_members(ls);