FreeBSD/sbin/hastd/activemap.c
/*
 * Function calculates size needed to store bitmap on disk.
 */
Function calculates size needed to store bitmap on disk.
Function calculates size needed to store bitmap on disk .
size_t
activemap_calc_ondisk_size(uint64_t mediasize, uint32_t extentsize,
    uint32_t sectorsize)
{
	uint64_t nextents, mapsize;
	PJDLOG_ASSERT(mediasize > 0);
	PJDLOG_ASSERT(extentsize > 0);
	PJDLOG_ASSERT(powerof2(extentsize));
	PJDLOG_ASSERT(sectorsize > 0);
	PJDLOG_ASSERT(powerof2(sectorsize));
	nextents = ((mediasize - 1) / extentsize) + 1;
	mapsize = bitstr_size(nextents);
	return (roundup2(mapsize, sectorsize));
}
size_t activemap_calc_ondisk_size ( uint64_t mediasize , uint32_t extentsize , uint32_t sectorsize ) { uint64_t nextents , mapsize ; PJDLOG_ASSERT ( mediasize > 0 ) ; PJDLOG_ASSERT ( extentsize > 0 ) ; PJDLOG_ASSERT ( powerof2 ( extentsize ) ) ; PJDLOG_ASSERT ( sectorsize > 0 ) ; PJDLOG_ASSERT ( powerof2 ( sectorsize ) ) ; nextents = ( ( mediasize - 1 ) / extentsize ) + 1 ; mapsize = bitstr_size ( nextents ) ; return ( roundup2 ( mapsize , sectorsize ) ) ; }
Function calculates size needed to store bitmap on disk.
Function calculates size needed to store bitmap on disk .