Lines Matching refs:res

59 					      struct dlm_lock_resource *res,
64 struct dlm_lock_resource *res,
70 struct dlm_lock_resource *res,
99 struct dlm_lock_resource *res, in dlmunlock_common() argument
114 BUG_ON(res->owner != dlm->node_num); in dlmunlock_common()
116 BUG_ON(res->owner == dlm->node_num); in dlmunlock_common()
125 "while waiting for an ast!", res->lockname.len, in dlmunlock_common()
126 res->lockname.name); in dlmunlock_common()
130 spin_lock(&res->spinlock); in dlmunlock_common()
131 if (res->state & DLM_LOCK_RES_IN_PROGRESS) { in dlmunlock_common()
134 spin_unlock(&res->spinlock); in dlmunlock_common()
138 __dlm_wait_on_lockres(res); in dlmunlock_common()
139 res->state |= DLM_LOCK_RES_IN_PROGRESS; in dlmunlock_common()
143 if (res->state & DLM_LOCK_RES_RECOVERING) { in dlmunlock_common()
148 if (res->state & DLM_LOCK_RES_MIGRATING) { in dlmunlock_common()
156 status = dlm_get_cancel_actions(dlm, res, lock, lksb, &actions); in dlmunlock_common()
158 status = dlm_get_unlock_actions(dlm, res, lock, lksb, &actions); in dlmunlock_common()
167 memcpy(res->lvb, lksb->lvb, DLM_LVB_LEN); in dlmunlock_common()
174 owner = res->owner; in dlmunlock_common()
181 spin_unlock(&res->spinlock); in dlmunlock_common()
182 status = dlm_send_remote_unlock_request(dlm, res, lock, lksb, in dlmunlock_common()
184 spin_lock(&res->spinlock); in dlmunlock_common()
201 dlm->name, res->lockname.len, in dlmunlock_common()
202 res->lockname.name, in dlmunlock_common()
226 list_add_tail(&lock->list, &res->granted); in dlmunlock_common()
238 res->state &= ~DLM_LOCK_RES_IN_PROGRESS; in dlmunlock_common()
239 if (!dlm_lock_on_list(&res->converting, lock)) in dlmunlock_common()
244 spin_unlock(&res->spinlock); in dlmunlock_common()
245 wake_up(&res->wq); in dlmunlock_common()
267 void dlm_commit_pending_unlock(struct dlm_lock_resource *res, in dlm_commit_pending_unlock() argument
275 void dlm_commit_pending_cancel(struct dlm_lock_resource *res, in dlm_commit_pending_cancel() argument
278 list_move_tail(&lock->list, &res->granted); in dlm_commit_pending_cancel()
284 struct dlm_lock_resource *res, in dlmunlock_master() argument
290 return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 1); in dlmunlock_master()
294 struct dlm_lock_resource *res, in dlmunlock_remote() argument
299 return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 0); in dlmunlock_remote()
310 struct dlm_lock_resource *res, in dlm_send_remote_unlock_request() argument
323 mlog(0, "%.*s\n", res->lockname.len, res->lockname.name); in dlm_send_remote_unlock_request()
331 res->lockname.len, res->lockname.name); in dlm_send_remote_unlock_request()
339 unlock.namelen = res->lockname.len; in dlm_send_remote_unlock_request()
340 memcpy(unlock.name, res->lockname.name, unlock.namelen); in dlm_send_remote_unlock_request()
396 struct dlm_lock_resource *res = NULL; in dlm_unlock_lock_handler() local
431 res = dlm_lookup_lockres(dlm, unlock->name, unlock->namelen); in dlm_unlock_lock_handler()
432 if (!res) { in dlm_unlock_lock_handler()
441 queue=&res->granted; in dlm_unlock_lock_handler()
443 spin_lock(&res->spinlock); in dlm_unlock_lock_handler()
444 if (res->state & DLM_LOCK_RES_RECOVERING) { in dlm_unlock_lock_handler()
445 spin_unlock(&res->spinlock); in dlm_unlock_lock_handler()
451 if (res->state & DLM_LOCK_RES_MIGRATING) { in dlm_unlock_lock_handler()
452 spin_unlock(&res->spinlock); in dlm_unlock_lock_handler()
458 if (res->owner != dlm->node_num) { in dlm_unlock_lock_handler()
459 spin_unlock(&res->spinlock); in dlm_unlock_lock_handler()
479 spin_unlock(&res->spinlock); in dlm_unlock_lock_handler()
499 status = dlmunlock_master(dlm, res, lock, lksb, flags, &ignore); in dlm_unlock_lock_handler()
506 dlm_lockres_calc_usage(dlm, res); in dlm_unlock_lock_handler()
507 dlm_kick_thread(dlm, res); in dlm_unlock_lock_handler()
519 if (res) in dlm_unlock_lock_handler()
520 dlm_lockres_put(res); in dlm_unlock_lock_handler()
529 struct dlm_lock_resource *res, in dlm_get_cancel_actions() argument
536 if (dlm_lock_on_list(&res->blocked, lock)) { in dlm_get_cancel_actions()
541 } else if (dlm_lock_on_list(&res->converting, lock)) { in dlm_get_cancel_actions()
548 } else if (dlm_lock_on_list(&res->granted, lock)) { in dlm_get_cancel_actions()
561 struct dlm_lock_resource *res, in dlm_get_unlock_actions() argument
569 if (!dlm_lock_on_list(&res->granted, lock)) { in dlm_get_unlock_actions()
591 struct dlm_lock_resource *res; in dlmunlock() local
619 res = lock->lockres; in dlmunlock()
620 BUG_ON(!res); in dlmunlock()
621 dlm_lockres_get(res); in dlmunlock()
625 mlog(0, "lock=%p res=%p\n", lock, res); in dlmunlock()
627 spin_lock(&res->spinlock); in dlmunlock()
628 is_master = (res->owner == dlm->node_num); in dlmunlock()
631 spin_unlock(&res->spinlock); in dlmunlock()
634 status = dlmunlock_master(dlm, res, lock, lksb, flags, in dlmunlock()
639 status = dlmunlock_remote(dlm, res, lock, lksb, flags, in dlmunlock()
686 dlm_kick_thread(dlm, res); in dlmunlock()
690 dlm_lockres_calc_usage(dlm, res); in dlmunlock()
691 dlm_lockres_put(res); in dlmunlock()