Esempio n. 1
0
static void print_itree(struct inode_tree *itree)
{
	struct itree_node *cur, *tmp;

	fprintf(stdout, "itree: printing inodes tree\n");
	rbtree_postorder_for_each_entry_safe(cur, tmp, &itree->inodes, inodes_node)
		fprintf(stdout, "\tuuid %lld, inode %ld: %lld pages in memory\n",
			cur->uuid, DUET_UUID_INO(cur->uuid), cur->inmem);

	fprintf(stdout, "itree: printing sorted tree\n");
	rbtree_postorder_for_each_entry_safe(cur, tmp, &itree->sorted, sorted_node)
		fprintf(stdout, "\tuuid %lld, inode %ld: %lld pages in memory\n",
			cur->uuid, DUET_UUID_INO(cur->uuid), cur->inmem);
}
Esempio n. 2
0
static void
rbtree_destroy(struct rb_root *root)
{
    struct iface_node *node, *next;

    rbtree_postorder_for_each_entry_safe(node, next, root, node)
    kfree(node);

    *root = RB_ROOT;
}
Esempio n. 3
0
/* Called when the filesystem is unmounted */
void ext4_release_system_zone(struct super_block *sb)
{
	struct ext4_system_zone	*entry, *n;

	rbtree_postorder_for_each_entry_safe(entry, n,
			&EXT4_SB(sb)->system_blks, node)
		kmem_cache_free(ext4_system_zone_cachep, entry);

	EXT4_SB(sb)->system_blks = RB_ROOT;
}
Esempio n. 4
0
/* frees all zswap entries for the given swap type */
static void zswap_frontswap_invalidate_area(unsigned type)
{
	struct zswap_tree *tree = zswap_trees[type];
	struct zswap_entry *entry, *n;

	if (!tree)
		return;

	/* walk the tree and free everything */
	spin_lock(&tree->lock);
	rbtree_postorder_for_each_entry_safe(entry, n, &tree->rbroot, rbnode)
		zswap_free_entry(entry);
	tree->rbroot = RB_ROOT;
	spin_unlock(&tree->lock);
	kfree(tree);
	zswap_trees[type] = NULL;
}