Skip to contentSkip to conversation

dlm: timer can't be global

PATCH In review David Teigland 1 participant 1 message Jun 2, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 5/9 dlm: timer can't be global

The dlm_recoverd thread for each lockspace uses a recovery timer, so that timer must be per-lockspace, not global.

drivers/dlm/dlm_internal.h +1 -0
Index: linux/drivers/dlm/dlm_internal.h
===================================================================
@@ -477,6 +477,7 @@
 
 	/* recovery related */
 
+	struct timer_list	ls_timer;
 	wait_queue_head_t	ls_wait_member;
 	struct task_struct	*ls_recoverd_task;
 	struct semaphore	ls_recoverd_active;
drivers/dlm/recover.c +7 -9
Index: linux/drivers/dlm/recover.c
===================================================================
@@ -22,8 +22,6 @@
 #include "lowcomms.h"
 #include "member.h"
 
-static struct timer_list dlm_timer;
-
 
 /*
  * Recovery waiting routines: these functions wait for a particular reply from
@@ -50,7 +48,7 @@
 static void dlm_wait_timer_fn(unsigned long data)
 {
 	struct dlm_ls *ls = (struct dlm_ls *) data;
-	mod_timer(&dlm_timer, jiffies + (dlm_config.recover_timer * HZ));
+	mod_timer(&ls->ls_timer, jiffies + (dlm_config.recover_timer * HZ));
 	wake_up(&ls->ls_wait_general);
 }
 
@@ -58,14 +56,14 @@
 {
 	int error = 0;
 
-	init_timer(&dlm_timer);
-	dlm_timer.function = dlm_wait_timer_fn;
-	dlm_timer.data = (long) ls;
-	dlm_timer.expires = jiffies + (dlm_config.recover_timer * HZ);
-	add_timer(&dlm_timer);
+	init_timer(&ls->ls_timer);
+	ls->ls_timer.function = dlm_wait_timer_fn;
+	ls->ls_timer.data = (long) ls;
+	ls->ls_timer.expires = jiffies + (dlm_config.recover_timer * HZ);
+	add_timer(&ls->ls_timer);
 
 	wait_event(ls->ls_wait_general, testfn(ls) || dlm_recovery_stopped(ls));
-	del_timer_sync(&dlm_timer);
+	del_timer_sync(&ls->ls_timer);
 
 	if (dlm_recovery_stopped(ls))
 		error = -EINTR;

--