Lines Matching refs:lock

72  * the first lock), and has no bits in its refmap.
343 struct dlm_lock *lock, *target;
366 mlog(ML_ERROR, "%s: res %.*s converting lock to invalid mode\n",
370 list_for_each_entry(lock, &res->granted, list) {
371 if (lock==target)
373 if (!dlm_lock_compatible(lock->ml.type,
377 if (lock->ml.highest_blocked == LKM_IVMODE) {
379 __dlm_queue_bast(dlm, lock);
382 if (lock->ml.highest_blocked < target->ml.convert_type)
383 lock->ml.highest_blocked =
388 list_for_each_entry(lock, &res->converting, list) {
389 if (lock==target)
391 if (!dlm_lock_compatible(lock->ml.type,
394 if (lock->ml.highest_blocked == LKM_IVMODE) {
396 __dlm_queue_bast(dlm, lock);
398 if (lock->ml.highest_blocked < target->ml.convert_type)
399 lock->ml.highest_blocked =
404 /* we can convert the lock */
409 mlog(0, "%s: res %.*s, AST for Converting lock %u:%llu, type "
437 list_for_each_entry(lock, &res->granted, list) {
438 if (lock==target)
440 if (!dlm_lock_compatible(lock->ml.type, target->ml.type)) {
442 if (lock->ml.highest_blocked == LKM_IVMODE) {
444 __dlm_queue_bast(dlm, lock);
446 if (lock->ml.highest_blocked < target->ml.type)
447 lock->ml.highest_blocked = target->ml.type;
451 list_for_each_entry(lock, &res->converting, list) {
452 if (lock==target)
454 if (!dlm_lock_compatible(lock->ml.type, target->ml.type)) {
456 if (lock->ml.highest_blocked == LKM_IVMODE) {
458 __dlm_queue_bast(dlm, lock);
460 if (lock->ml.highest_blocked < target->ml.type)
461 lock->ml.highest_blocked = target->ml.type;
465 /* we can grant the blocked lock (only
471 mlog(0, "%s: res %.*s, AST for Blocked lock %u:%llu, type %d, "
572 struct dlm_lock *lock;
578 lock = list_entry(dlm->pending_asts.next,
580 /* get an extra ref on lock */
581 dlm_lock_get(lock);
582 res = lock->lockres;
583 mlog(0, "%s: res %.*s, Flush AST for lock %u:%llu, type %d, "
586 dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
587 dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
588 lock->ml.type, lock->ml.node);
590 BUG_ON(!lock->ast_pending);
593 list_del_init(&lock->ast_list);
594 dlm_lock_put(lock);
597 if (lock->ml.node != dlm->node_num) {
598 ret = dlm_do_remote_ast(dlm, res, lock);
602 dlm_do_local_ast(dlm, res, lock);
608 if (!list_empty(&lock->ast_list)) {
613 lock->ast_pending = 0;
617 dlm_lock_put(lock);
622 lock = list_entry(dlm->pending_basts.next,
624 /* get an extra ref on lock */
625 dlm_lock_get(lock);
626 res = lock->lockres;
628 BUG_ON(!lock->bast_pending);
630 /* get the highest blocked lock, and reset */
631 spin_lock(&lock->spinlock);
632 BUG_ON(lock->ml.highest_blocked <= LKM_IVMODE);
633 hi = lock->ml.highest_blocked;
634 lock->ml.highest_blocked = LKM_IVMODE;
635 spin_unlock(&lock->spinlock);
638 list_del_init(&lock->bast_list);
639 dlm_lock_put(lock);
642 mlog(0, "%s: res %.*s, Flush BAST for lock %u:%llu, "
645 dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
646 dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
647 hi, lock->ml.node);
649 if (lock->ml.node != dlm->node_num) {
650 ret = dlm_send_proxy_bast(dlm, res, lock, hi);
654 dlm_do_local_bast(dlm, res, lock, hi);
660 if (!list_empty(&lock->bast_list)) {
665 lock->bast_pending = 0;
669 dlm_lock_put(lock);
711 * unset the dirty flag and drop the dlm lock */
760 * spinlock and do NOT have the dlm lock.
763 /* called while holding lockres lock */
774 /* if the lock was in-progress, stick