Lines Matching defs:res
54 * needs a spinlock held on entry (res->spinlock) and it is the
55 * only one that holds a lock on exit (res->spinlock).
59 struct dlm_lock_resource *res,
64 struct dlm_lock_resource *res,
72 * taken: takes and drops res->spinlock
77 struct dlm_lock_resource *res,
83 spin_lock(&res->spinlock);
85 __dlm_wait_on_lockres(res);
86 __dlm_lockres_reserve_ast(res);
87 res->state |= DLM_LOCK_RES_IN_PROGRESS;
89 status = __dlmconvert_master(dlm, res, lock, flags, type,
92 res->state &= ~DLM_LOCK_RES_IN_PROGRESS;
93 spin_unlock(&res->spinlock);
94 wake_up(&res->wq);
102 dlm_lockres_release_ast(dlm, res);
105 dlm_kick_thread(dlm, res);
112 * caller needs: res->spinlock
114 * held on exit: res->spinlock
120 struct dlm_lock_resource *res,
129 assert_spin_locked(&res->spinlock);
145 if (!dlm_lock_on_list(&res->granted, lock)) {
188 list_for_each(iter, &res->granted) {
196 list_for_each(iter, &res->converting) {
208 mlog(0, "res %.*s, granting %s lock\n", res->lockname.len,
209 res->lockname.name, dlm_lock_mode_name(type));
216 memcpy(res->lvb, lock->lksb->lvb, DLM_LVB_LEN);
225 "%d to %d...\n", res->lockname.len, res->lockname.name,
230 mlog(0, "res %.*s, queueing...\n", res->lockname.len,
231 res->lockname.name);
235 list_move_tail(&lock->list, &res->converting);
240 __dlm_print_one_lock_resource(res);
247 void dlm_revert_pending_convert(struct dlm_lock_resource *res,
251 list_move_tail(&lock->list, &res->granted);
259 * taken: takes and drops res->spinlock, uses DLM_LOCK_RES_IN_PROGRESS
264 struct dlm_lock_resource *res,
270 lock->ml.convert_type, res->state & DLM_LOCK_RES_IN_PROGRESS);
272 spin_lock(&res->spinlock);
273 if (res->state & DLM_LOCK_RES_RECOVERING) {
274 mlog(0, "bailing out early since res is RECOVERING "
276 /* __dlm_print_one_lock_resource(res); */
281 __dlm_wait_on_lockres(res);
284 __dlm_print_one_lock_resource(res);
293 res->state |= DLM_LOCK_RES_IN_PROGRESS;
296 list_move_tail(&lock->list, &res->converting);
313 spin_unlock(&res->spinlock);
317 status = dlm_send_remote_convert_request(dlm, res, lock, flags, type);
319 spin_lock(&res->spinlock);
320 res->state &= ~DLM_LOCK_RES_IN_PROGRESS;
326 dlm_revert_pending_convert(res, lock);
329 spin_unlock(&res->spinlock);
333 wake_up(&res->wq);
346 struct dlm_lock_resource *res,
356 mlog_entry("%.*s\n", res->lockname.len, res->lockname.name);
362 convert.namelen = res->lockname.len;
364 memcpy(convert.name, res->lockname.name, convert.namelen);
377 vec, veclen, res->owner, &status);
383 "message!\n", res->owner);
386 "message!\n", res->owner);
389 "message!\n", res->owner);
395 res->owner);
400 dlm_wait_for_node_death(dlm, res->owner,
404 "from convert message!\n", res->owner);
416 * taken: takes and drop res->spinlock
426 struct dlm_lock_resource *res = NULL;
461 res = dlm_lookup_lockres(dlm, cnv->name, cnv->namelen);
462 if (!res) {
467 spin_lock(&res->spinlock);
468 status = __dlm_lockres_state_to_status(res);
470 spin_unlock(&res->spinlock);
474 list_for_each(iter, &res->granted) {
483 spin_unlock(&res->spinlock);
490 dlm_print_one_lock_resource(res);
507 spin_lock(&res->spinlock);
508 status = __dlm_lockres_state_to_status(res);
510 __dlm_lockres_reserve_ast(res);
512 res->state |= DLM_LOCK_RES_IN_PROGRESS;
513 status = __dlmconvert_master(dlm, res, lock, flags,
516 res->state &= ~DLM_LOCK_RES_IN_PROGRESS;
519 spin_unlock(&res->spinlock);
521 wake_up(&res->wq);
537 dlm_lockres_release_ast(dlm, res);
540 dlm_kick_thread(dlm, res);
542 if (res)
543 dlm_lockres_put(res);