Lines Matching refs:lkb
148 void dlm_purge_lkb_callbacks(struct dlm_lkb *lkb) in dlm_purge_lkb_callbacks() argument
152 list_for_each_entry_safe(cb, safe, &lkb->lkb_callbacks, list) { in dlm_purge_lkb_callbacks()
157 clear_bit(DLM_IFL_CB_PENDING_BIT, &lkb->lkb_iflags); in dlm_purge_lkb_callbacks()
160 dlm_callback_set_last_ptr(&lkb->lkb_last_cast, NULL); in dlm_purge_lkb_callbacks()
161 dlm_callback_set_last_ptr(&lkb->lkb_last_cb, NULL); in dlm_purge_lkb_callbacks()
162 lkb->lkb_last_bast_mode = -1; in dlm_purge_lkb_callbacks()
195 void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode, in dlm_user_add_ast() argument
203 if (test_bit(DLM_DFL_ORPHAN_BIT, &lkb->lkb_dflags) || in dlm_user_add_ast()
204 test_bit(DLM_IFL_DEAD_BIT, &lkb->lkb_iflags)) in dlm_user_add_ast()
207 ls = lkb->lkb_resource->res_ls; in dlm_user_add_ast()
216 if (test_bit(DLM_DFL_ORPHAN_BIT, &lkb->lkb_dflags) || in dlm_user_add_ast()
217 test_bit(DLM_IFL_DEAD_BIT, &lkb->lkb_iflags)) in dlm_user_add_ast()
220 DLM_ASSERT(lkb->lkb_ua, dlm_print_lkb(lkb);); in dlm_user_add_ast()
221 ua = lkb->lkb_ua; in dlm_user_add_ast()
228 set_bit(DLM_IFL_ENDOFLIFE_BIT, &lkb->lkb_iflags); in dlm_user_add_ast()
232 rv = dlm_enqueue_lkb_callback(lkb, flags, mode, status, sbflags); in dlm_user_add_ast()
239 kref_get(&lkb->lkb_ref); in dlm_user_add_ast()
240 list_add_tail(&lkb->lkb_cb_list, &proc->asts); in dlm_user_add_ast()
251 if (test_bit(DLM_IFL_ENDOFLIFE_BIT, &lkb->lkb_iflags)) { in dlm_user_add_ast()
254 if (!list_empty(&lkb->lkb_ownqueue)) { in dlm_user_add_ast()
255 list_del_init(&lkb->lkb_ownqueue); in dlm_user_add_ast()
256 dlm_put_lkb(lkb); in dlm_user_add_ast()
805 struct dlm_lkb *lkb; in device_read() local
863 lkb = list_first_entry(&proc->asts, struct dlm_lkb, lkb_cb_list); in device_read()
865 rv = dlm_dequeue_lkb_callback(lkb, &cb); in device_read()
871 log_print("dlm_rem_lkb_callback empty %x", lkb->lkb_id); in device_read()
872 list_del_init(&lkb->lkb_cb_list); in device_read()
875 dlm_put_lkb(lkb); in device_read()
879 list_del_init(&lkb->lkb_cb_list); in device_read()
880 clear_bit(DLM_IFL_CB_PENDING_BIT, &lkb->lkb_iflags); in device_read()
891 trace_dlm_bast(lkb->lkb_resource->res_ls, lkb, cb->mode); in device_read()
893 lkb->lkb_lksb->sb_status = cb->sb_status; in device_read()
894 lkb->lkb_lksb->sb_flags = cb->sb_flags; in device_read()
895 trace_dlm_ast(lkb->lkb_resource->res_ls, lkb); in device_read()
898 ret = copy_result_to_user(lkb->lkb_ua, in device_read()
906 dlm_put_lkb(lkb); in device_read()