[Ocfs2-commits] khackel commits r1941 -
branches/dlm-reco-mig/fs/ocfs2/dlm
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Mar 4 19:26:46 CST 2005
Author: khackel
Date: 2005-03-04 19:26:45 -0600 (Fri, 04 Mar 2005)
New Revision: 1941
Modified:
branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmaster.c
branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c
Log:
* add in quite a few assert_spin_locked calls in dlmmaster and dlmmod
Modified: branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmaster.c 2005-03-05 00:42:02 UTC (rev 1940)
+++ branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmaster.c 2005-03-05 01:26:45 UTC (rev 1941)
@@ -195,7 +195,9 @@
static inline void __dlm_mle_attach_hb_events(dlm_ctxt *dlm,
dlm_master_list_entry *mle)
{
- list_add_tail(&mle->hb_events, &dlm->mle_hb_events);
+ assert_spin_locked(&dlm->spinlock);
+
+ list_add_tail(&mle->hb_events, &dlm->mle_hb_events);
}
@@ -242,6 +244,8 @@
const char *name,
unsigned int namelen)
{
+ assert_spin_locked(&dlm->spinlock);
+
mle->dlm = dlm;
mle->type = type;
INIT_LIST_HEAD(&mle->list);
@@ -281,6 +285,8 @@
dlm_master_list_entry *tmpmle;
struct list_head *iter;
+ assert_spin_locked(&dlm->master_lock);
+
list_for_each(iter, &dlm->master_list) {
tmpmle = list_entry(iter, dlm_master_list_entry, list);
if (!dlm_mle_equal(dlm, tmpmle, name, namelen))
@@ -354,6 +360,8 @@
dlm_lock_resource *res,
u8 owner)
{
+ assert_spin_locked(&res->spinlock);
+
if (owner == dlm->group_index)
atomic_inc(&dlm->local_resources);
else if (owner == DLM_LOCK_RES_OWNER_UNKNOWN)
@@ -368,6 +376,8 @@
dlm_lock_resource *res,
u8 owner)
{
+ assert_spin_locked(&res->spinlock);
+
if (owner == res->owner)
return;
@@ -452,7 +462,11 @@
kref_init(&res->refs, dlm_lockres_release);
+ /* just for consistency */
+ spin_lock(&res->spinlock);
dlm_set_lockres_owner(dlm, res, DLM_LOCK_RES_OWNER_UNKNOWN);
+ spin_unlock(&res->spinlock);
+
res->state = DLM_LOCK_RES_IN_PROGRESS;
memset(res->lvb, 0, DLM_LVB_LEN);
@@ -552,8 +566,10 @@
if (flags & LKM_LOCAL) {
/* caller knows it's safe to assume it's not mastered elsewhere
* DONE! return right away */
+ spin_lock(&res->spinlock);
dlm_change_lockres_owner(dlm, res, dlm->group_index);
__dlm_insert_lock(dlm, res);
+ spin_unlock(&res->spinlock);
spin_unlock(&dlm->spinlock);
/* lockres still marked IN_PROGRESS */
goto wake_waiters;
Modified: branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c
===================================================================
--- branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c 2005-03-05 00:42:02 UTC (rev 1940)
+++ branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c 2005-03-05 01:26:45 UTC (rev 1941)
@@ -367,6 +367,8 @@
struct list_head *bucket;
struct qstr *q;
+ assert_spin_locked(&dlm->spinlock);
+
q = &res->lockname;
q->hash = full_name_hash(q->name, q->len);
bucket = &(dlm->resources[q->hash & DLM_HASH_MASK]);
@@ -390,6 +392,8 @@
dlmprintk0("\n");
+ assert_spin_locked(&dlm->spinlock);
+
hash = full_name_hash(name, len);
bucket = &(dlm->resources[hash & DLM_HASH_MASK]);
@@ -876,6 +880,8 @@
{
DECLARE_WAITQUEUE(wait, current);
+ assert_spin_locked(&res->spinlock);
+
add_wait_queue(&res->wq, &wait);
repeat:
set_current_state(TASK_UNINTERRUPTIBLE);
More information about the Ocfs2-commits
mailing list