Beispiel #1
0
/* release allocated block */
static void
testfs_put_block_freemap(struct super_block *sb, int block_nr)
{
	assert(sb->block_freemap);
	bitmap_unmark(sb->block_freemap, block_nr);
	testfs_write_block_freemap(sb, block_nr);
}
Beispiel #2
0
/* return free block number or negative value */
static int testfs_get_block_freemap(struct super_block *sb) {
	u_int32_t index;
	int ret;

	assert(sb->block_freemap);
	ret = bitmap_alloc(sb->block_freemap, &index);
	if (ret < 0)
		return ret;
	testfs_write_block_freemap(sb, index);
	return index;
}