Lines Matching refs:ll
612 smb_llist_t *ll, in smb_llist_constructor() argument
616 rw_init(&ll->ll_lock, NULL, RW_DEFAULT, NULL); in smb_llist_constructor()
617 mutex_init(&ll->ll_mutex, NULL, MUTEX_DEFAULT, NULL); in smb_llist_constructor()
618 list_create(&ll->ll_list, size, offset); in smb_llist_constructor()
619 list_create(&ll->ll_deleteq, sizeof (smb_dtor_t), in smb_llist_constructor()
621 ll->ll_count = 0; in smb_llist_constructor()
622 ll->ll_wrop = 0; in smb_llist_constructor()
623 ll->ll_deleteq_count = 0; in smb_llist_constructor()
624 ll->ll_flushing = B_FALSE; in smb_llist_constructor()
632 smb_llist_t *ll) in smb_llist_destructor() argument
634 smb_llist_flush(ll); in smb_llist_destructor()
636 ASSERT(ll->ll_count == 0); in smb_llist_destructor()
637 ASSERT(ll->ll_deleteq_count == 0); in smb_llist_destructor()
639 rw_destroy(&ll->ll_lock); in smb_llist_destructor()
640 list_destroy(&ll->ll_list); in smb_llist_destructor()
641 list_destroy(&ll->ll_deleteq); in smb_llist_destructor()
642 mutex_destroy(&ll->ll_mutex); in smb_llist_destructor()
650 smb_llist_enter(smb_llist_t *ll, krw_t mode) in smb_llist_enter() argument
652 rw_enter(&ll->ll_lock, mode); in smb_llist_enter()
662 smb_llist_post(smb_llist_t *ll, void *object, smb_dtorproc_t dtorproc) in smb_llist_post() argument
674 mutex_enter(&ll->ll_mutex); in smb_llist_post()
675 list_insert_tail(&ll->ll_deleteq, dtor); in smb_llist_post()
676 ++ll->ll_deleteq_count; in smb_llist_post()
677 mutex_exit(&ll->ll_mutex); in smb_llist_post()
684 smb_llist_exit(smb_llist_t *ll) in smb_llist_exit() argument
686 rw_exit(&ll->ll_lock); in smb_llist_exit()
687 smb_llist_flush(ll); in smb_llist_exit()
696 smb_llist_flush(smb_llist_t *ll) in smb_llist_flush() argument
700 mutex_enter(&ll->ll_mutex); in smb_llist_flush()
701 if (ll->ll_flushing) { in smb_llist_flush()
702 mutex_exit(&ll->ll_mutex); in smb_llist_flush()
705 ll->ll_flushing = B_TRUE; in smb_llist_flush()
707 dtor = list_head(&ll->ll_deleteq); in smb_llist_flush()
711 list_remove(&ll->ll_deleteq, dtor); in smb_llist_flush()
712 --ll->ll_deleteq_count; in smb_llist_flush()
713 mutex_exit(&ll->ll_mutex); in smb_llist_flush()
719 mutex_enter(&ll->ll_mutex); in smb_llist_flush()
720 dtor = list_head(&ll->ll_deleteq); in smb_llist_flush()
722 ll->ll_flushing = B_FALSE; in smb_llist_flush()
724 mutex_exit(&ll->ll_mutex); in smb_llist_flush()
738 smb_llist_t *ll) in smb_llist_upgrade() argument
742 if (rw_tryupgrade(&ll->ll_lock) != 0) { in smb_llist_upgrade()
745 wrop = ll->ll_wrop; in smb_llist_upgrade()
746 rw_exit(&ll->ll_lock); in smb_llist_upgrade()
747 rw_enter(&ll->ll_lock, RW_WRITER); in smb_llist_upgrade()
748 return (wrop != ll->ll_wrop); in smb_llist_upgrade()
759 smb_llist_t *ll, in smb_llist_insert_head() argument
762 list_insert_head(&ll->ll_list, obj); in smb_llist_insert_head()
763 ++ll->ll_wrop; in smb_llist_insert_head()
764 ++ll->ll_count; in smb_llist_insert_head()
776 smb_llist_t *ll, in smb_llist_insert_tail() argument
779 list_insert_tail(&ll->ll_list, obj); in smb_llist_insert_tail()
780 ++ll->ll_wrop; in smb_llist_insert_tail()
781 ++ll->ll_count; in smb_llist_insert_tail()
792 smb_llist_t *ll, in smb_llist_remove() argument
795 list_remove(&ll->ll_list, obj); in smb_llist_remove()
796 ++ll->ll_wrop; in smb_llist_remove()
797 --ll->ll_count; in smb_llist_remove()
807 smb_llist_t *ll) in smb_llist_get_count() argument
809 return (ll->ll_count); in smb_llist_get_count()