Lines Matching refs:lhp
357 struct ldi_handle *lhp, **lhpp, *retlhp; in handle_alloc() local
363 lhp = kmem_zalloc(sizeof (*lhp), KM_SLEEP); in handle_alloc()
382 kmem_free(lhp, sizeof (struct ldi_handle)); in handle_alloc()
387 lhp->lh_ref = 1; in handle_alloc()
388 lhp->lh_vp = vp; in handle_alloc()
389 lhp->lh_ident = ident; in handle_alloc()
391 mutex_init(lhp->lh_lock, NULL, MUTEX_DEFAULT, NULL); in handle_alloc()
395 lhp->lh_type = 0; in handle_alloc()
398 lhp->lh_type |= LH_STREAM; in handle_alloc()
400 lhp->lh_type |= LH_CBDEV; in handle_alloc()
409 lhp->lh_next = ldi_handle_hash[index]; in handle_alloc()
410 ldi_handle_hash[index] = lhp; in handle_alloc()
415 (void *)lhp, (void *)ident, (void *)vp, in handle_alloc()
420 return (lhp); in handle_alloc()
424 handle_release(struct ldi_handle *lhp) in handle_release() argument
429 ASSERT(lhp != NULL); in handle_release()
431 index = LH_HASH(lhp->lh_vp); in handle_release()
436 (void *)lhp, (void *)lhp->lh_ident, (void *)lhp->lh_vp, in handle_release()
437 mod_major_to_name(getmajor(lhp->lh_vp->v_rdev)), in handle_release()
438 getminor(lhp->lh_vp->v_rdev))); in handle_release()
440 ASSERT(lhp->lh_ref > 0); in handle_release()
441 if (--lhp->lh_ref > 0) { in handle_release()
448 lhpp = handle_find_ref_nolock(lhp->lh_vp, lhp->lh_ident); in handle_release()
450 *lhpp = lhp->lh_next; in handle_release()
454 VN_RELE(lhp->lh_vp); in handle_release()
455 ident_release(lhp->lh_ident); in handle_release()
457 mutex_destroy(lhp->lh_lock); in handle_release()
459 kmem_free(lhp, sizeof (struct ldi_handle)); in handle_release()
469 struct ldi_handle *lhp = lep->le_lhp; in handle_event_add() local
471 ASSERT(lhp != NULL); in handle_event_add()
473 mutex_enter(lhp->lh_lock); in handle_event_add()
474 if (lhp->lh_events == NULL) { in handle_event_add()
475 lhp->lh_events = lep; in handle_event_add()
476 mutex_exit(lhp->lh_lock); in handle_event_add()
480 lep->le_next = lhp->lh_events; in handle_event_add()
481 lhp->lh_events->le_prev = lep; in handle_event_add()
482 lhp->lh_events = lep; in handle_event_add()
483 mutex_exit(lhp->lh_lock); in handle_event_add()
489 struct ldi_handle *lhp = lep->le_lhp; in handle_event_remove() local
491 ASSERT(lhp != NULL); in handle_event_remove()
493 mutex_enter(lhp->lh_lock); in handle_event_remove()
498 if (lhp->lh_events == lep) in handle_event_remove()
499 lhp->lh_events = lep->le_next; in handle_event_remove()
500 mutex_exit(lhp->lh_lock); in handle_event_remove()
741 ldi_handle_t *lhp, struct ldi_ident *li) in ldi_open_by_vp() argument
748 ASSERT((lhp != NULL) && (li != NULL)); in ldi_open_by_vp()
786 *lhp = (ldi_handle_t)nlhp; in ldi_open_by_vp()
1171 struct ldi_handle *lhp; in ldi_usage_walker() local
1180 lhp = ldi_handle_hash[i]; in ldi_usage_walker()
1181 while ((lhp != NULL) && (ret == LDI_USAGE_CONTINUE)) { in ldi_usage_walker()
1182 lip = lhp->lh_ident; in ldi_usage_walker()
1183 vp = lhp->lh_vp; in ldi_usage_walker()
1188 lhp = lhp->lh_next; in ldi_usage_walker()
1221 struct ldi_handle *lhp = (struct ldi_handle *)arg; in ldi_mlink_lh() local
1226 if (lhp == NULL) in ldi_mlink_lh()
1229 vpdown = lhp->lh_vp; in ldi_mlink_lh()
1387 struct ldi_handle *lhp; in ldi_munlink_fp() local
1437 lhp = handle_find(vp, (struct ldi_ident *)li); in ldi_munlink_fp()
1438 handle_release(lhp); in ldi_munlink_fp()
1614 ldi_handle_t *lhp, ldi_ident_t li) in ldi_open_by_dev() argument
1622 (lhp == NULL) || (lip == NULL)) in ldi_open_by_dev()
1630 if ((ret = ldi_open_by_vp(&vp, flag, cr, lhp, lip)) == 0) { in ldi_open_by_dev()
1641 ldi_handle_t *lhp, ldi_ident_t li) in ldi_open_by_name() argument
1649 (cr == NULL) || (lhp == NULL) || (lip == NULL)) in ldi_open_by_name()
1657 ret = ldi_open_by_vp(&vp, flag, cr, lhp, lip); in ldi_open_by_name()
1666 int flag, cred_t *cr, ldi_handle_t *lhp, ldi_ident_t li) in ldi_open_by_devid() argument
1674 (lhp == NULL) || (lip == NULL)) in ldi_open_by_devid()
1682 ret = ldi_open_by_vp(&vp, flag, cr, lhp, lip); in ldi_open_by_devid()
3186 struct ldi_handle *lhp = (struct ldi_handle *)lh; in ldi_ev_register_callbacks() local
3212 dev = lhp->lh_vp->v_rdev; in ldi_ev_register_callbacks()
3213 csp = VTOCS(lhp->lh_vp); in ldi_ev_register_callbacks()
3223 "LDI handle: %p", (void *)lhp); in ldi_ev_register_callbacks()
3239 lhp->lh_ident->li_modname); in ldi_ev_register_callbacks()
3267 lecp->lec_lhp = lhp; in ldi_ev_register_callbacks()
3268 lecp->lec_dev = lhp->lh_vp->v_rdev; in ldi_ev_register_callbacks()
3269 lecp->lec_spec = VTYP_TO_STYP(lhp->lh_vp->v_type); in ldi_ev_register_callbacks()