Lines Matching refs:dlm
43 static enum dlm_status dlm_send_remote_lock_request(struct dlm_ctxt *dlm,
101 static enum dlm_status dlmlock_master(struct dlm_ctxt *dlm, in dlmlock_master() argument
115 lock->ml.node != dlm->node_num) { in dlmlock_master()
143 "node %u for reco lock\n", dlm->name, in dlmlock_master()
154 "node %u for reco lock\n", dlm->name, in dlmlock_master()
170 dlm_queue_ast(dlm, lock); in dlmlock_master()
172 dlm_lockres_release_ast(dlm, res); in dlmlock_master()
174 dlm_lockres_calc_usage(dlm, res); in dlmlock_master()
176 dlm_kick_thread(dlm, res); in dlmlock_master()
197 static enum dlm_status dlmlock_remote(struct dlm_ctxt *dlm, in dlmlock_remote() argument
214 if (res->owner == dlm->node_num) { in dlmlock_remote()
228 status = dlm_send_remote_lock_request(dlm, res, lock, flags); in dlmlock_remote()
242 dlm->name, res->owner); in dlmlock_remote()
263 dlm->name, dlm->node_num, res->owner); in dlmlock_remote()
269 dlm_lockres_calc_usage(dlm, res); in dlmlock_remote()
283 static enum dlm_status dlm_send_remote_lock_request(struct dlm_ctxt *dlm, in dlm_send_remote_lock_request() argument
292 create.node_idx = dlm->node_num; in dlm_send_remote_lock_request()
299 tmpret = o2net_send_message(DLM_CREATE_LOCK_MSG, dlm->key, &create, in dlm_send_remote_lock_request()
306 "currently.\n", dlm->name, create.namelen, in dlm_send_remote_lock_request()
313 "node %u\n", dlm->name, create.namelen, create.name, in dlm_send_remote_lock_request()
443 struct dlm_ctxt *dlm = data; in dlm_create_lock_handler() local
452 BUG_ON(!dlm); in dlm_create_lock_handler()
454 if (!dlm_grab(dlm)) in dlm_create_lock_handler()
460 if (!dlm_domain_fully_joined(dlm)) { in dlm_create_lock_handler()
463 dlm->name, create->node_idx, namelen, name); in dlm_create_lock_handler()
491 res = dlm_lookup_lockres(dlm, name, namelen); in dlm_create_lock_handler()
508 status = dlmlock_master(dlm, res, newlock, be32_to_cpu(create->flags)); in dlm_create_lock_handler()
517 dlm_put(dlm); in dlm_create_lock_handler()
540 enum dlm_status dlmlock(struct dlm_ctxt *dlm, int mode, in dlmlock() argument
617 dlm_wait_for_recovery(dlm); in dlmlock()
619 if (res->owner == dlm->node_num) in dlmlock()
620 status = dlmconvert_master(dlm, res, lock, flags, mode); in dlmlock()
622 status = dlmconvert_remote(dlm, res, lock, flags, mode); in dlmlock()
650 dlm_get_next_cookie(dlm->node_num, &tmpcookie); in dlmlock()
651 lock = dlm_new_lock(mode, dlm->node_num, tmpcookie, lksb); in dlmlock()
658 dlm_wait_for_recovery(dlm); in dlmlock()
661 res = dlm_get_lock_resource(dlm, name, namelen, flags); in dlmlock()
690 if (res->owner == dlm->node_num) in dlmlock()
691 status = dlmlock_master(dlm, res, lock, flags); in dlmlock()
693 status = dlmlock_remote(dlm, res, lock, flags); in dlmlock()
704 dlm_wait_for_node_death(dlm, res->owner, in dlmlock()
707 dlm_wait_for_recovery(dlm); in dlmlock()
714 dlm_lockres_drop_inflight_ref(dlm, res); in dlmlock()
717 dlm_lockres_calc_usage(dlm, res); in dlmlock()
718 dlm_kick_thread(dlm, res); in dlmlock()