FreeBSD/sbin/hastd/activemap.c
/*
 * Function should be called after finishing synchronization of one extent.
 * It returns true if on-disk metadata should be updated.
 */
Function should be called after finishing synchronization of one extent.
It returns true if on-disk metadata should be updated.
Function should be called after finishing synchronization of one extent . It returns true if on - disk metadata should be updated .
bool
activemap_extent_complete(struct activemap *amp, int extent)
{
	bool modified;
	int reqs;
	PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC);
	PJDLOG_ASSERT(extent >= 0 && extent < amp->am_nextents);
	modified = false;
	reqs = ext2reqs(amp, extent);
	PJDLOG_ASSERT(amp->am_memtab[extent] >= reqs);
	amp->am_memtab[extent] -= reqs;
	PJDLOG_ASSERT(bit_test(amp->am_memmap, extent));
	if (amp->am_memtab[extent] == 0) {
		bit_clear(amp->am_memmap, extent);
		amp->am_ndirty--;
		modified = true;
	}
	return (modified);
}
bool activemap_extent_complete ( struct activemap * amp , int extent ) { bool modified ; int reqs ; PJDLOG_ASSERT ( amp -> am_magic == ACTIVEMAP_MAGIC ) ; PJDLOG_ASSERT ( extent >= 0 && extent < amp -> am_nextents ) ; modified = false ; reqs = ext2reqs ( amp , extent ) ; PJDLOG_ASSERT ( amp -> am_memtab [ extent ] >= reqs ) ; amp -> am_memtab [ extent ] -= reqs ; PJDLOG_ASSERT ( bit_test ( amp -> am_memmap , extent ) ) ; if ( amp -> am_memtab [ extent ] == 0 ) { bit_clear ( amp -> am_memmap , extent ) ; amp -> am_ndirty -- ; modified = true ; } return ( modified ) ; }
Function should be called after finishing synchronization of one extent.
Function should be called after finishing synchronization of one extent .