FreeBSD/sbin/hastd/activemap.c
/*
 * Mark extent(s) containing the given region for synchronization.
 * Most likely one of the components is unavailable.
 */
Mark extent(s) containing the given region for synchronization.
Most likely one of the components is unavailable.
Mark extent ( s ) containing the given region for synchronization . Most likely one of the components is unavailable .
bool
activemap_need_sync(struct activemap *amp, off_t offset, off_t length)
{
	bool modified;
	off_t end;
	int ext;
	PJDLOG_ASSERT(amp->am_magic == ACTIVEMAP_MAGIC);
	modified = false;
	end = offset + length - 1;
	for (ext = off2ext(amp, offset); ext <= off2ext(amp, end); ext++) {
		if (bit_test(amp->am_syncmap, ext)) {
			PJDLOG_ASSERT(bit_test(amp->am_memmap, ext));
			continue;
		}
		bit_set(amp->am_syncmap, ext);
		if (!bit_test(amp->am_memmap, ext)) {
			bit_set(amp->am_memmap, ext);
			amp->am_ndirty++;
		}
		amp->am_memtab[ext] += ext2reqs(amp, ext);
		modified = true;
	}
	return (modified);
}
bool activemap_need_sync ( struct activemap * amp , off_t offset , off_t length ) { bool modified ; off_t end ; int ext ; PJDLOG_ASSERT ( amp -> am_magic == ACTIVEMAP_MAGIC ) ; modified = false ; end = offset + length - 1 ; for ( ext = off2ext ( amp , offset ) ; ext <= off2ext ( amp , end ) ; ext ++ ) { if ( bit_test ( amp -> am_syncmap , ext ) ) { PJDLOG_ASSERT ( bit_test ( amp -> am_memmap , ext ) ) ; continue ; } bit_set ( amp -> am_syncmap , ext ) ; if ( ! bit_test ( amp -> am_memmap , ext ) ) { bit_set ( amp -> am_memmap , ext ) ; amp -> am_ndirty ++ ; } amp -> am_memtab [ ext ] += ext2reqs ( amp , ext ) ; modified = true ; } return ( modified ) ; }
Mark extent(s) containing the given region for synchronization.
Mark extent ( s ) containing the given region for synchronization .
/* Already marked for synchronization. */