Lines Matching refs:lock
45 struct dlm_lock *lock, int flags,
50 struct dlm_lock *lock, int flags, int type);
63 struct dlm_lock *lock, int flags, int type) in dlmconvert_master() argument
74 status = __dlmconvert_master(dlm, res, lock, flags, type, in dlmconvert_master()
85 dlm_queue_ast(dlm, lock); in dlmconvert_master()
106 struct dlm_lock *lock, int flags, in __dlmconvert_master() argument
116 lock->ml.type, lock->ml.convert_type, type); in __dlmconvert_master()
118 spin_lock(&lock->spinlock); in __dlmconvert_master()
121 if (lock->ml.convert_type != LKM_IVMODE) { in __dlmconvert_master()
129 if (!dlm_lock_on_list(&res->granted, lock)) { in __dlmconvert_master()
137 switch (lock->ml.type) { in __dlmconvert_master()
141 dlm_lock_mode_name(lock->ml.type), in __dlmconvert_master()
143 lock->lksb->flags |= DLM_LKSB_PUT_LVB; in __dlmconvert_master()
151 dlm_lock_mode_name(lock->ml.type), in __dlmconvert_master()
153 lock->lksb->flags |= DLM_LKSB_GET_LVB; in __dlmconvert_master()
157 dlm_lock_mode_name(lock->ml.type), in __dlmconvert_master()
167 if (type <= lock->ml.type) in __dlmconvert_master()
173 if (tmplock == lock) in __dlmconvert_master()
193 lock->lksb->status = DLM_NORMAL; in __dlmconvert_master()
194 if (lock->ml.node == dlm->node_num) in __dlmconvert_master()
196 lock->ml.type = type; in __dlmconvert_master()
197 if (lock->lksb->flags & DLM_LKSB_PUT_LVB) in __dlmconvert_master()
198 memcpy(res->lvb, lock->lksb->lvb, DLM_LVB_LEN); in __dlmconvert_master()
204 list_move_tail(&lock->list, &res->granted); in __dlmconvert_master()
214 lock->ml.type, type); in __dlmconvert_master()
221 lock->ml.convert_type = type; in __dlmconvert_master()
223 list_move_tail(&lock->list, &res->converting); in __dlmconvert_master()
226 spin_unlock(&lock->spinlock); in __dlmconvert_master()
236 struct dlm_lock *lock) in dlm_revert_pending_convert() argument
239 list_move_tail(&lock->list, &res->granted); in dlm_revert_pending_convert()
240 lock->ml.convert_type = LKM_IVMODE; in dlm_revert_pending_convert()
241 lock->lksb->flags &= ~(DLM_LKSB_GET_LVB|DLM_LKSB_PUT_LVB); in dlm_revert_pending_convert()
253 struct dlm_lock *lock, int flags, int type) in dlmconvert_remote() argument
257 mlog(0, "type=%d, convert_type=%d, busy=%d\n", lock->ml.type, in dlmconvert_remote()
258 lock->ml.convert_type, res->state & DLM_LOCK_RES_IN_PROGRESS); in dlmconvert_remote()
271 if (lock->ml.convert_type != LKM_IVMODE) { in dlmconvert_remote()
275 dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)), in dlmconvert_remote()
276 dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)), in dlmconvert_remote()
277 lock->ml.convert_type); in dlmconvert_remote()
282 if (lock->ml.type == type && lock->ml.convert_type == LKM_IVMODE) { in dlmconvert_remote()
287 dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)), in dlmconvert_remote()
288 dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)), in dlmconvert_remote()
289 lock->ml.type, lock->ml.convert_type); in dlmconvert_remote()
297 list_move_tail(&lock->list, &res->converting); in dlmconvert_remote()
298 lock->convert_pending = 1; in dlmconvert_remote()
299 lock->ml.convert_type = type; in dlmconvert_remote()
302 if (lock->ml.type == LKM_EXMODE) { in dlmconvert_remote()
304 lock->lksb->flags |= DLM_LKSB_PUT_LVB; in dlmconvert_remote()
306 if (lock->ml.convert_type == LKM_NLMODE) in dlmconvert_remote()
310 lock->lksb->flags |= DLM_LKSB_GET_LVB; in dlmconvert_remote()
318 status = dlm_send_remote_convert_request(dlm, res, lock, flags, type); in dlmconvert_remote()
329 dlm_revert_pending_convert(res, lock); in dlmconvert_remote()
330 } else if (!lock->convert_pending) { in dlmconvert_remote()
337 lock->convert_pending = 0; in dlmconvert_remote()
357 struct dlm_lock *lock, int flags, int type) in dlm_send_remote_convert_request() argument
371 convert.cookie = lock->ml.cookie; in dlm_send_remote_convert_request()
382 vec[1].iov_base = lock->lksb->lvb; in dlm_send_remote_convert_request()
437 struct dlm_lock *lock = NULL; in dlm_convert_lock_handler() local
487 lock = tmp_lock; in dlm_convert_lock_handler()
488 dlm_lock_get(lock); in dlm_convert_lock_handler()
493 if (!lock) { in dlm_convert_lock_handler()
504 lksb = lock->lksb; in dlm_convert_lock_handler()
522 status = __dlmconvert_master(dlm, res, lock, flags, in dlm_convert_lock_handler()
539 if (lock) in dlm_convert_lock_handler()
540 dlm_lock_put(lock); in dlm_convert_lock_handler()
544 dlm_queue_ast(dlm, lock); in dlm_convert_lock_handler()