aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/dlm/dlmthread.c')
-rw-r--r--fs/ocfs2/dlm/dlmthread.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c
index e73c833fc2a1..9db869de829d 100644
--- a/fs/ocfs2/dlm/dlmthread.c
+++ b/fs/ocfs2/dlm/dlmthread.c
@@ -286,8 +286,6 @@ static void dlm_shuffle_lists(struct dlm_ctxt *dlm,
286 struct dlm_lock_resource *res) 286 struct dlm_lock_resource *res)
287{ 287{
288 struct dlm_lock *lock, *target; 288 struct dlm_lock *lock, *target;
289 struct list_head *iter;
290 struct list_head *head;
291 int can_grant = 1; 289 int can_grant = 1;
292 290
293 /* 291 /*
@@ -314,9 +312,7 @@ converting:
314 dlm->name, res->lockname.len, res->lockname.name); 312 dlm->name, res->lockname.len, res->lockname.name);
315 BUG(); 313 BUG();
316 } 314 }
317 head = &res->granted; 315 list_for_each_entry(lock, &res->granted, list) {
318 list_for_each(iter, head) {
319 lock = list_entry(iter, struct dlm_lock, list);
320 if (lock==target) 316 if (lock==target)
321 continue; 317 continue;
322 if (!dlm_lock_compatible(lock->ml.type, 318 if (!dlm_lock_compatible(lock->ml.type,
@@ -333,9 +329,8 @@ converting:
333 target->ml.convert_type; 329 target->ml.convert_type;
334 } 330 }
335 } 331 }
336 head = &res->converting; 332
337 list_for_each(iter, head) { 333 list_for_each_entry(lock, &res->converting, list) {
338 lock = list_entry(iter, struct dlm_lock, list);
339 if (lock==target) 334 if (lock==target)
340 continue; 335 continue;
341 if (!dlm_lock_compatible(lock->ml.type, 336 if (!dlm_lock_compatible(lock->ml.type,
@@ -384,9 +379,7 @@ blocked:
384 goto leave; 379 goto leave;
385 target = list_entry(res->blocked.next, struct dlm_lock, list); 380 target = list_entry(res->blocked.next, struct dlm_lock, list);
386 381
387 head = &res->granted; 382 list_for_each_entry(lock, &res->granted, list) {
388 list_for_each(iter, head) {
389 lock = list_entry(iter, struct dlm_lock, list);
390 if (lock==target) 383 if (lock==target)
391 continue; 384 continue;
392 if (!dlm_lock_compatible(lock->ml.type, target->ml.type)) { 385 if (!dlm_lock_compatible(lock->ml.type, target->ml.type)) {
@@ -400,9 +393,7 @@ blocked:
400 } 393 }
401 } 394 }
402 395
403 head = &res->converting; 396 list_for_each_entry(lock, &res->converting, list) {
404 list_for_each(iter, head) {
405 lock = list_entry(iter, struct dlm_lock, list);
406 if (lock==target) 397 if (lock==target)
407 continue; 398 continue;
408 if (!dlm_lock_compatible(lock->ml.type, target->ml.type)) { 399 if (!dlm_lock_compatible(lock->ml.type, target->ml.type)) {