Lines Matching refs:tl

855 txg_list_create(txg_list_t *tl, spa_t *spa, size_t offset)  in txg_list_create()  argument
859 mutex_init(&tl->tl_lock, NULL, MUTEX_DEFAULT, NULL); in txg_list_create()
861 tl->tl_offset = offset; in txg_list_create()
862 tl->tl_spa = spa; in txg_list_create()
865 tl->tl_head[t] = NULL; in txg_list_create()
869 txg_list_empty_impl(txg_list_t *tl, uint64_t txg) in txg_list_empty_impl() argument
871 ASSERT(MUTEX_HELD(&tl->tl_lock)); in txg_list_empty_impl()
872 TXG_VERIFY(tl->tl_spa, txg); in txg_list_empty_impl()
873 return (tl->tl_head[txg & TXG_MASK] == NULL); in txg_list_empty_impl()
877 txg_list_empty(txg_list_t *tl, uint64_t txg) in txg_list_empty() argument
879 mutex_enter(&tl->tl_lock); in txg_list_empty()
880 boolean_t ret = txg_list_empty_impl(tl, txg); in txg_list_empty()
881 mutex_exit(&tl->tl_lock); in txg_list_empty()
887 txg_list_destroy(txg_list_t *tl) in txg_list_destroy() argument
891 mutex_enter(&tl->tl_lock); in txg_list_destroy()
893 ASSERT(txg_list_empty_impl(tl, t)); in txg_list_destroy()
894 mutex_exit(&tl->tl_lock); in txg_list_destroy()
896 mutex_destroy(&tl->tl_lock); in txg_list_destroy()
906 txg_all_lists_empty(txg_list_t *tl) in txg_all_lists_empty() argument
910 res &= (tl->tl_head[i] == NULL); in txg_all_lists_empty()
919 txg_list_add(txg_list_t *tl, void *p, uint64_t txg) in txg_list_add() argument
922 txg_node_t *tn = (txg_node_t *)((char *)p + tl->tl_offset); in txg_list_add()
925 TXG_VERIFY(tl->tl_spa, txg); in txg_list_add()
926 mutex_enter(&tl->tl_lock); in txg_list_add()
930 tn->tn_next[t] = tl->tl_head[t]; in txg_list_add()
931 tl->tl_head[t] = tn; in txg_list_add()
933 mutex_exit(&tl->tl_lock); in txg_list_add()
944 txg_list_add_tail(txg_list_t *tl, void *p, uint64_t txg) in txg_list_add_tail() argument
947 txg_node_t *tn = (txg_node_t *)((char *)p + tl->tl_offset); in txg_list_add_tail()
950 TXG_VERIFY(tl->tl_spa, txg); in txg_list_add_tail()
951 mutex_enter(&tl->tl_lock); in txg_list_add_tail()
956 for (tp = &tl->tl_head[t]; *tp != NULL; tp = &(*tp)->tn_next[t]) in txg_list_add_tail()
963 mutex_exit(&tl->tl_lock); in txg_list_add_tail()
972 txg_list_remove(txg_list_t *tl, uint64_t txg) in txg_list_remove() argument
978 TXG_VERIFY(tl->tl_spa, txg); in txg_list_remove()
979 mutex_enter(&tl->tl_lock); in txg_list_remove()
980 if ((tn = tl->tl_head[t]) != NULL) { in txg_list_remove()
983 p = (char *)tn - tl->tl_offset; in txg_list_remove()
984 tl->tl_head[t] = tn->tn_next[t]; in txg_list_remove()
988 mutex_exit(&tl->tl_lock); in txg_list_remove()
997 txg_list_remove_this(txg_list_t *tl, void *p, uint64_t txg) in txg_list_remove_this() argument
1002 TXG_VERIFY(tl->tl_spa, txg); in txg_list_remove_this()
1003 mutex_enter(&tl->tl_lock); in txg_list_remove_this()
1005 for (tp = &tl->tl_head[t]; (tn = *tp) != NULL; tp = &tn->tn_next[t]) { in txg_list_remove_this()
1006 if ((char *)tn - tl->tl_offset == p) { in txg_list_remove_this()
1010 mutex_exit(&tl->tl_lock); in txg_list_remove_this()
1015 mutex_exit(&tl->tl_lock); in txg_list_remove_this()
1021 txg_list_member(txg_list_t *tl, void *p, uint64_t txg) in txg_list_member() argument
1024 txg_node_t *tn = (txg_node_t *)((char *)p + tl->tl_offset); in txg_list_member()
1026 TXG_VERIFY(tl->tl_spa, txg); in txg_list_member()
1034 txg_list_head(txg_list_t *tl, uint64_t txg) in txg_list_head() argument
1039 mutex_enter(&tl->tl_lock); in txg_list_head()
1040 tn = tl->tl_head[t]; in txg_list_head()
1041 mutex_exit(&tl->tl_lock); in txg_list_head()
1043 TXG_VERIFY(tl->tl_spa, txg); in txg_list_head()
1044 return (tn == NULL ? NULL : (char *)tn - tl->tl_offset); in txg_list_head()
1048 txg_list_next(txg_list_t *tl, void *p, uint64_t txg) in txg_list_next() argument
1051 txg_node_t *tn = (txg_node_t *)((char *)p + tl->tl_offset); in txg_list_next()
1053 TXG_VERIFY(tl->tl_spa, txg); in txg_list_next()
1055 mutex_enter(&tl->tl_lock); in txg_list_next()
1057 mutex_exit(&tl->tl_lock); in txg_list_next()
1059 return (tn == NULL ? NULL : (char *)tn - tl->tl_offset); in txg_list_next()