Lines Matching refs:res

42 					      struct dlm_lock_resource *res,
47 struct dlm_lock_resource *res,
53 struct dlm_lock_resource *res,
82 struct dlm_lock_resource *res, in dlmunlock_common() argument
98 BUG_ON(res->owner != dlm->node_num); in dlmunlock_common()
100 BUG_ON(res->owner == dlm->node_num); in dlmunlock_common()
109 "while waiting for an ast!", res->lockname.len, in dlmunlock_common()
110 res->lockname.name); in dlmunlock_common()
114 spin_lock(&res->spinlock); in dlmunlock_common()
115 if (res->state & DLM_LOCK_RES_IN_PROGRESS) { in dlmunlock_common()
118 spin_unlock(&res->spinlock); in dlmunlock_common()
122 __dlm_wait_on_lockres(res); in dlmunlock_common()
123 res->state |= DLM_LOCK_RES_IN_PROGRESS; in dlmunlock_common()
127 if (res->state & DLM_LOCK_RES_RECOVERING) { in dlmunlock_common()
132 if (res->state & DLM_LOCK_RES_MIGRATING) { in dlmunlock_common()
140 status = dlm_get_cancel_actions(dlm, res, lock, lksb, &actions); in dlmunlock_common()
142 status = dlm_get_unlock_actions(dlm, res, lock, lksb, &actions); in dlmunlock_common()
151 memcpy(res->lvb, lksb->lvb, DLM_LVB_LEN); in dlmunlock_common()
158 owner = res->owner; in dlmunlock_common()
165 spin_unlock(&res->spinlock); in dlmunlock_common()
166 status = dlm_send_remote_unlock_request(dlm, res, lock, lksb, in dlmunlock_common()
168 spin_lock(&res->spinlock); in dlmunlock_common()
185 dlm->name, res->lockname.len, in dlmunlock_common()
186 res->lockname.name, in dlmunlock_common()
213 list_add_tail(&lock->list, &res->granted); in dlmunlock_common()
225 res->state &= ~DLM_LOCK_RES_IN_PROGRESS; in dlmunlock_common()
226 if (!dlm_lock_on_list(&res->converting, lock)) in dlmunlock_common()
231 spin_unlock(&res->spinlock); in dlmunlock_common()
232 wake_up(&res->wq); in dlmunlock_common()
235 spin_lock(&res->spinlock); in dlmunlock_common()
241 __dlm_wait_on_lockres_flags(res, DLM_LOCK_RES_RECOVERING); in dlmunlock_common()
242 spin_unlock(&res->spinlock); in dlmunlock_common()
265 void dlm_commit_pending_unlock(struct dlm_lock_resource *res, in dlm_commit_pending_unlock() argument
273 void dlm_commit_pending_cancel(struct dlm_lock_resource *res, in dlm_commit_pending_cancel() argument
276 list_move_tail(&lock->list, &res->granted); in dlm_commit_pending_cancel()
282 struct dlm_lock_resource *res, in dlmunlock_master() argument
288 return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 1); in dlmunlock_master()
292 struct dlm_lock_resource *res, in dlmunlock_remote() argument
297 return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 0); in dlmunlock_remote()
308 struct dlm_lock_resource *res, in dlm_send_remote_unlock_request() argument
321 mlog(0, "%.*s\n", res->lockname.len, res->lockname.name); in dlm_send_remote_unlock_request()
329 res->lockname.len, res->lockname.name); in dlm_send_remote_unlock_request()
337 unlock.namelen = res->lockname.len; in dlm_send_remote_unlock_request()
338 memcpy(unlock.name, res->lockname.name, unlock.namelen); in dlm_send_remote_unlock_request()
394 struct dlm_lock_resource *res = NULL; in dlm_unlock_lock_handler() local
429 res = dlm_lookup_lockres(dlm, unlock->name, unlock->namelen); in dlm_unlock_lock_handler()
430 if (!res) { in dlm_unlock_lock_handler()
439 queue=&res->granted; in dlm_unlock_lock_handler()
441 spin_lock(&res->spinlock); in dlm_unlock_lock_handler()
442 if (res->state & DLM_LOCK_RES_RECOVERING) { in dlm_unlock_lock_handler()
443 spin_unlock(&res->spinlock); in dlm_unlock_lock_handler()
449 if (res->state & DLM_LOCK_RES_MIGRATING) { in dlm_unlock_lock_handler()
450 spin_unlock(&res->spinlock); in dlm_unlock_lock_handler()
456 if (res->owner != dlm->node_num) { in dlm_unlock_lock_handler()
457 spin_unlock(&res->spinlock); in dlm_unlock_lock_handler()
477 spin_unlock(&res->spinlock); in dlm_unlock_lock_handler()
497 status = dlmunlock_master(dlm, res, lock, lksb, flags, &ignore); in dlm_unlock_lock_handler()
504 dlm_lockres_calc_usage(dlm, res); in dlm_unlock_lock_handler()
505 dlm_kick_thread(dlm, res); in dlm_unlock_lock_handler()
517 if (res) in dlm_unlock_lock_handler()
518 dlm_lockres_put(res); in dlm_unlock_lock_handler()
527 struct dlm_lock_resource *res, in dlm_get_cancel_actions() argument
534 if (dlm_lock_on_list(&res->blocked, lock)) { in dlm_get_cancel_actions()
539 } else if (dlm_lock_on_list(&res->converting, lock)) { in dlm_get_cancel_actions()
546 } else if (dlm_lock_on_list(&res->granted, lock)) { in dlm_get_cancel_actions()
559 struct dlm_lock_resource *res, in dlm_get_unlock_actions() argument
567 if (!dlm_lock_on_list(&res->granted, lock)) { in dlm_get_unlock_actions()
589 struct dlm_lock_resource *res; in dlmunlock() local
617 res = lock->lockres; in dlmunlock()
618 BUG_ON(!res); in dlmunlock()
619 dlm_lockres_get(res); in dlmunlock()
623 mlog(0, "lock=%p res=%p\n", lock, res); in dlmunlock()
625 spin_lock(&res->spinlock); in dlmunlock()
626 is_master = (res->owner == dlm->node_num); in dlmunlock()
629 spin_unlock(&res->spinlock); in dlmunlock()
632 status = dlmunlock_master(dlm, res, lock, lksb, flags, in dlmunlock()
637 status = dlmunlock_remote(dlm, res, lock, lksb, flags, in dlmunlock()
684 dlm_kick_thread(dlm, res); in dlmunlock()
688 dlm_lockres_calc_usage(dlm, res); in dlmunlock()
689 dlm_lockres_put(res); in dlmunlock()