Lines Matching refs:table
56 struct priority_table *table; in vdo_make_priority_table() local
64 struct bucket, __func__, &table); in vdo_make_priority_table()
69 struct bucket *bucket = &table->buckets[priority]; in vdo_make_priority_table()
75 table->max_priority = max_priority; in vdo_make_priority_table()
76 table->search_vector = 0; in vdo_make_priority_table()
78 *table_ptr = table; in vdo_make_priority_table()
88 void vdo_free_priority_table(struct priority_table *table) in vdo_free_priority_table() argument
90 if (table == NULL) in vdo_free_priority_table()
97 vdo_reset_priority_table(table); in vdo_free_priority_table()
99 vdo_free(table); in vdo_free_priority_table()
110 void vdo_reset_priority_table(struct priority_table *table) in vdo_reset_priority_table() argument
114 table->search_vector = 0; in vdo_reset_priority_table()
115 for (priority = 0; priority <= table->max_priority; priority++) in vdo_reset_priority_table()
116 list_del_init(&table->buckets[priority].queue); in vdo_reset_priority_table()
127 void vdo_priority_table_enqueue(struct priority_table *table, unsigned int priority, in vdo_priority_table_enqueue() argument
130 VDO_ASSERT_LOG_ONLY((priority <= table->max_priority), in vdo_priority_table_enqueue()
134 list_move_tail(entry, &table->buckets[priority].queue); in vdo_priority_table_enqueue()
137 table->search_vector |= (1ULL << priority); in vdo_priority_table_enqueue()
140 static inline void mark_bucket_empty(struct priority_table *table, struct bucket *bucket) in mark_bucket_empty() argument
142 table->search_vector &= ~(1ULL << bucket->priority); in mark_bucket_empty()
155 struct list_head *vdo_priority_table_dequeue(struct priority_table *table) in vdo_priority_table_dequeue() argument
161 if (table->search_vector == 0) { in vdo_priority_table_dequeue()
170 top_priority = ilog2(table->search_vector); in vdo_priority_table_dequeue()
173 bucket = &table->buckets[top_priority]; in vdo_priority_table_dequeue()
179 mark_bucket_empty(table, bucket); in vdo_priority_table_dequeue()
189 void vdo_priority_table_remove(struct priority_table *table, struct list_head *entry) in vdo_priority_table_remove() argument
212 mark_bucket_empty(table, list_entry(next_entry, struct bucket, queue)); in vdo_priority_table_remove()
221 bool vdo_is_priority_table_empty(struct priority_table *table) in vdo_is_priority_table_empty() argument
223 return (table->search_vector == 0); in vdo_is_priority_table_empty()