Lines Matching refs:tl
775 txg_list_create(txg_list_t *tl, spa_t *spa, size_t offset) in txg_list_create() argument
779 mutex_init(&tl->tl_lock, NULL, MUTEX_DEFAULT, NULL); in txg_list_create()
781 tl->tl_offset = offset; in txg_list_create()
782 tl->tl_spa = spa; in txg_list_create()
785 tl->tl_head[t] = NULL; in txg_list_create()
789 txg_list_destroy(txg_list_t *tl) in txg_list_destroy() argument
794 ASSERT(txg_list_empty(tl, t)); in txg_list_destroy()
796 mutex_destroy(&tl->tl_lock); in txg_list_destroy()
800 txg_list_empty(txg_list_t *tl, uint64_t txg) in txg_list_empty() argument
802 txg_verify(tl->tl_spa, txg); in txg_list_empty()
803 return (tl->tl_head[txg & TXG_MASK] == NULL); in txg_list_empty()
814 txg_all_lists_empty(txg_list_t *tl) in txg_all_lists_empty() argument
817 if (!txg_list_empty(tl, i)) { in txg_all_lists_empty()
829 txg_list_add(txg_list_t *tl, void *p, uint64_t txg) in txg_list_add() argument
832 txg_node_t *tn = (txg_node_t *)((char *)p + tl->tl_offset); in txg_list_add()
835 txg_verify(tl->tl_spa, txg); in txg_list_add()
836 mutex_enter(&tl->tl_lock); in txg_list_add()
840 tn->tn_next[t] = tl->tl_head[t]; in txg_list_add()
841 tl->tl_head[t] = tn; in txg_list_add()
843 mutex_exit(&tl->tl_lock); in txg_list_add()
854 txg_list_add_tail(txg_list_t *tl, void *p, uint64_t txg) in txg_list_add_tail() argument
857 txg_node_t *tn = (txg_node_t *)((char *)p + tl->tl_offset); in txg_list_add_tail()
860 txg_verify(tl->tl_spa, txg); in txg_list_add_tail()
861 mutex_enter(&tl->tl_lock); in txg_list_add_tail()
866 for (tp = &tl->tl_head[t]; *tp != NULL; tp = &(*tp)->tn_next[t]) in txg_list_add_tail()
873 mutex_exit(&tl->tl_lock); in txg_list_add_tail()
882 txg_list_remove(txg_list_t *tl, uint64_t txg) in txg_list_remove() argument
888 txg_verify(tl->tl_spa, txg); in txg_list_remove()
889 mutex_enter(&tl->tl_lock); in txg_list_remove()
890 if ((tn = tl->tl_head[t]) != NULL) { in txg_list_remove()
893 p = (char *)tn - tl->tl_offset; in txg_list_remove()
894 tl->tl_head[t] = tn->tn_next[t]; in txg_list_remove()
898 mutex_exit(&tl->tl_lock); in txg_list_remove()
907 txg_list_remove_this(txg_list_t *tl, void *p, uint64_t txg) in txg_list_remove_this() argument
912 txg_verify(tl->tl_spa, txg); in txg_list_remove_this()
913 mutex_enter(&tl->tl_lock); in txg_list_remove_this()
915 for (tp = &tl->tl_head[t]; (tn = *tp) != NULL; tp = &tn->tn_next[t]) { in txg_list_remove_this()
916 if ((char *)tn - tl->tl_offset == p) { in txg_list_remove_this()
920 mutex_exit(&tl->tl_lock); in txg_list_remove_this()
925 mutex_exit(&tl->tl_lock); in txg_list_remove_this()
931 txg_list_member(txg_list_t *tl, void *p, uint64_t txg) in txg_list_member() argument
934 txg_node_t *tn = (txg_node_t *)((char *)p + tl->tl_offset); in txg_list_member()
936 txg_verify(tl->tl_spa, txg); in txg_list_member()
944 txg_list_head(txg_list_t *tl, uint64_t txg) in txg_list_head() argument
947 txg_node_t *tn = tl->tl_head[t]; in txg_list_head()
949 txg_verify(tl->tl_spa, txg); in txg_list_head()
950 return (tn == NULL ? NULL : (char *)tn - tl->tl_offset); in txg_list_head()
954 txg_list_next(txg_list_t *tl, void *p, uint64_t txg) in txg_list_next() argument
957 txg_node_t *tn = (txg_node_t *)((char *)p + tl->tl_offset); in txg_list_next()
959 txg_verify(tl->tl_spa, txg); in txg_list_next()
962 return (tn == NULL ? NULL : (char *)tn - tl->tl_offset); in txg_list_next()