Lines Matching refs:lock

43 					      struct dlm_lock *lock,
48 struct dlm_lock *lock,
54 struct dlm_lock *lock,
67 * So to unlock a converting lock, you must first cancel the
76 * taken: res->spinlock and lock->spinlock taken and dropped
79 * all callers should have taken an extra ref on lock coming in
83 struct dlm_lock *lock,
103 /* We want to be sure that we're not freeing a lock
105 in_use = !list_empty(&lock->ast_list);
125 spin_lock(&lock->spinlock);
138 * LKM_CANCEL and the lock queue state */
140 status = dlm_get_cancel_actions(dlm, res, lock, lksb, &actions);
142 status = dlm_get_unlock_actions(dlm, res, lock, lksb, &actions);
161 lock->cancel_pending = 1;
163 lock->unlock_pending = 1;
164 spin_unlock(&lock->spinlock);
166 status = dlm_send_remote_unlock_request(dlm, res, lock, lksb,
169 spin_lock(&lock->spinlock);
170 /* if the master told us the lock was already granted,
194 lock->cancel_pending = 0;
196 if (!lock->unlock_pending)
199 lock->unlock_pending = 0;
203 /* get an extra ref on lock. if we are just switching
204 * lists here, we dont want the lock to go away. */
205 dlm_lock_get(lock);
208 list_del_init(&lock->list);
209 dlm_lock_put(lock);
212 dlm_lock_get(lock);
213 list_add_tail(&lock->list, &res->granted);
218 lock->ml.convert_type = LKM_IVMODE;
221 /* remove the extra ref on lock */
222 dlm_lock_put(lock);
226 if (!dlm_lock_on_list(&res->converting, lock))
227 BUG_ON(lock->ml.convert_type != LKM_IVMODE);
229 BUG_ON(lock->ml.convert_type == LKM_IVMODE);
230 spin_unlock(&lock->spinlock);
237 * and the lock is already removed from grant list. We have to
249 mlog(0, "lock %u:%llu should be gone now! refs=%d\n",
250 dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
251 dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
252 kref_read(&lock->lock_refs)-1);
253 dlm_lock_put(lock);
266 struct dlm_lock *lock)
270 list_del_init(&lock->list);
274 struct dlm_lock *lock)
276 list_move_tail(&lock->list, &res->granted);
277 lock->ml.convert_type = LKM_IVMODE;
283 struct dlm_lock *lock,
288 return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 1);
293 struct dlm_lock *lock,
297 return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 0);
309 struct dlm_lock *lock,
336 unlock.cookie = lock->ml.cookie;
346 vec[1].iov_base = lock->lksb->lvb;
395 struct dlm_lock *lock = NULL, *iter;
431 /* We assume here that a no lock resource simply means
467 lock = iter;
471 if (lock)
477 if (!lock) {
482 /* lock was found on queue */
483 lksb = lock->lksb;
485 lock->ml.type != LKM_EXMODE)
496 status = dlmunlock_master(dlm, res, lock, lksb, flags, &ignore);
507 if (!lock)
508 mlog(ML_ERROR, "failed to find lock to unlock! "
513 dlm_lock_put(lock);
527 struct dlm_lock *lock,
533 if (dlm_lock_on_list(&res->blocked, lock)) {
538 } else if (dlm_lock_on_list(&res->converting, lock)) {
545 } else if (dlm_lock_on_list(&res->granted, lock)) {
550 mlog(ML_ERROR, "lock to cancel is not on any list!\n");
559 struct dlm_lock *lock,
566 if (!dlm_lock_on_list(&res->granted, lock)) {
571 /* unlock granted lock */
589 struct dlm_lock *lock = NULL;
612 lock = lksb->lockid;
613 BUG_ON(!lock);
614 dlm_lock_get(lock);
616 res = lock->lockres;
622 mlog(0, "lock=%p res=%p\n", lock, res);
626 if (flags & LKM_VALBLK && lock->ml.type != LKM_EXMODE)
631 status = dlmunlock_master(dlm, res, lock, lksb, flags,
636 status = dlmunlock_remote(dlm, res, lock, lksb, flags,
669 * since this lock has been removed from the
673 dlm_lock_basts_flushed(dlm, lock));
689 dlm_lock_put(lock);