public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: [patch 5/9] dlm: timer can't be global
Date: Thu, 2 Jun 2005 16:02:54 +0800	[thread overview]
Message-ID: <20050602080254.GE21570@redhat.com> (raw)

[-- Attachment #1: global-recovery-timer.patch --]
[-- Type: text/plain, Size: 1981 bytes --]

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

Signed-off-by: David Teigland <teigland@redhat.com>

Index: linux/drivers/dlm/dlm_internal.h
===================================================================
--- linux.orig/drivers/dlm/dlm_internal.h	2005-06-02 12:28:30.000000000 +0800
+++ linux/drivers/dlm/dlm_internal.h	2005-06-02 13:04:51.696074128 +0800
@@ -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;
Index: linux/drivers/dlm/recover.c
===================================================================
--- linux.orig/drivers/dlm/recover.c	2005-06-02 12:28:30.000000000 +0800
+++ linux/drivers/dlm/recover.c	2005-06-02 13:04:00.372876440 +0800
@@ -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;

--


                 reply	other threads:[~2005-06-02  8:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050602080254.GE21570@redhat.com \
    --to=teigland@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox