Lines Matching defs:lkb

149 void dlm_purge_lkb_callbacks(struct dlm_lkb *lkb)
153 list_for_each_entry_safe(cb, safe, &lkb->lkb_callbacks, list) {
158 clear_bit(DLM_IFL_CB_PENDING_BIT, &lkb->lkb_iflags);
161 dlm_callback_set_last_ptr(&lkb->lkb_last_cast, NULL);
162 dlm_callback_set_last_ptr(&lkb->lkb_last_cb, NULL);
163 lkb->lkb_last_bast_mode = -1;
167 available for the application to use. The lkb still exists until
174 not related to the lifetime of the lkb struct which is managed
193 /* we could possibly check if the cancel of an orphan has resulted in the lkb
194 being removed and then remove that lkb from the orphans list and free it */
196 void dlm_user_add_ast(struct dlm_lkb *lkb, uint32_t flags, int mode,
204 if (test_bit(DLM_DFL_ORPHAN_BIT, &lkb->lkb_dflags) ||
205 test_bit(DLM_IFL_DEAD_BIT, &lkb->lkb_iflags))
208 ls = lkb->lkb_resource->res_ls;
213 lkb->ua so we can't try to use it. This second check is necessary
217 if (test_bit(DLM_DFL_ORPHAN_BIT, &lkb->lkb_dflags) ||
218 test_bit(DLM_IFL_DEAD_BIT, &lkb->lkb_iflags))
221 DLM_ASSERT(lkb->lkb_ua, dlm_print_lkb(lkb););
222 ua = lkb->lkb_ua;
229 set_bit(DLM_IFL_ENDOFLIFE_BIT, &lkb->lkb_iflags);
233 rv = dlm_enqueue_lkb_callback(lkb, flags, mode, status, sbflags);
240 kref_get(&lkb->lkb_ref);
241 list_add_tail(&lkb->lkb_cb_list, &proc->asts);
252 if (test_bit(DLM_IFL_ENDOFLIFE_BIT, &lkb->lkb_iflags)) {
255 if (!list_empty(&lkb->lkb_ownqueue)) {
256 list_del_init(&lkb->lkb_ownqueue);
257 dlm_put_lkb(lkb);
696 /* at this point no more lkb's should exist for this lockspace,
698 looking for lkb->ua->proc */
806 struct dlm_lkb *lkb;
865 lkb = list_first_entry(&proc->asts, struct dlm_lkb, lkb_cb_list);
868 old_mode = lkb->lkb_last_cast->mode;
870 rv = dlm_dequeue_lkb_callback(lkb, &cb);
873 /* this shouldn't happen; lkb should have been removed from
876 log_print("dlm_rem_lkb_callback empty %x", lkb->lkb_id);
877 list_del_init(&lkb->lkb_cb_list);
879 /* removes ref for proc->asts, may cause lkb to be freed */
880 dlm_put_lkb(lkb);
884 list_del_init(&lkb->lkb_cb_list);
885 clear_bit(DLM_IFL_CB_PENDING_BIT, &lkb->lkb_iflags);
896 trace_dlm_bast(lkb->lkb_resource->res_ls, lkb, cb->mode);
900 if (!cb->sb_status && lkb->lkb_lksb->sb_lvbptr &&
904 lkb->lkb_lksb->sb_status = cb->sb_status;
905 lkb->lkb_lksb->sb_flags = cb->sb_flags;
906 trace_dlm_ast(lkb->lkb_resource->res_ls, lkb);
909 ret = copy_result_to_user(lkb->lkb_ua,
915 /* removes ref for proc->asts, may cause lkb to be freed */
917 dlm_put_lkb(lkb);