Exemplo n.º 1
0
int variant_rm(struct variant *variant)
{
	/* Just disable the variant and remove it from the structures, since
	 * some tup_entrys may already point to us.
	 */
	variant->enabled = 0;
	tupid_tree_rm(&variant_dt_root, &variant->dtnode);
	tupid_tree_rm(&variant_root, &variant->tnode);
	LIST_REMOVE(variant, list);
	vardb_close(&variant->vdb);
	LIST_INSERT_HEAD(&disabled_list, variant, list);
	return 0;
}
Exemplo n.º 2
0
void variants_free(void)
{
	struct variant *variant;
	while(!LIST_EMPTY(&variant_list)) {
		variant = LIST_FIRST(&variant_list);
		tupid_tree_rm(&variant_dt_root, &variant->dtnode);
		tupid_tree_rm(&variant_root, &variant->tnode);
		LIST_REMOVE(variant, list);
		vardb_close(&variant->vdb);
		free(variant);
	}
	while(!LIST_EMPTY(&disabled_list)) {
		variant = LIST_FIRST(&disabled_list);
		LIST_REMOVE(variant, list);
		free(variant);
	}
}
Exemplo n.º 3
0
void free_tupid_tree(struct tupid_entries *root)
{
	struct tupid_tree *tt;

	while((tt = RB_ROOT(root)) != NULL) {
		tupid_tree_rm(root, tt);
		free(tt);
	}
}
Exemplo n.º 4
0
void tupid_tree_remove(struct tupid_entries *root, tupid_t tupid)
{
	struct tupid_tree *tt;

	tt = tupid_tree_search(root, tupid);
	if(!tt) {
		return;
	}
	tupid_tree_rm(root, tt);
	free(tt);
}
Exemplo n.º 5
0
void tree_entry_remove(struct tupid_entries *root, tupid_t tupid, int *count)
{
	struct tree_entry *te;
	struct tupid_tree *tt;

	tt = tupid_tree_search(root, tupid);
	if(!tt)
		return;
	tupid_tree_rm(root, tt);
	te = container_of(tt, struct tree_entry, tnode);
	if(count)
		(*count)--;
	free(te);
}
Exemplo n.º 6
0
void dircache_del(struct dircache_root *droot, struct dircache *dc)
{
	tupid_tree_rm(&droot->wd_root, &dc->wd_node);
	tupid_tree_rm(&droot->dt_root, &dc->dt_node);
	free(dc);
}