FreeBSD/sbin/growfs/growfs.c
/*
 * Here we add or subtract (sign +1/-1) the available fragments in a given
 * block to or from the fragment statistics. By subtracting before and adding
 * after an operation on the free frag map we can easy update the fragment
 * statistic, which seems to be otherwise a rather complex operation.
 */
Here we add or subtract (sign +1/-1) the available fragments in a given
block to or from the fragment statistics. By subtracting before and adding
after an operation on the free frag map we can easy update the fragment
statistic, which seems to be otherwise a rather complex operation.
Here we add or subtract ( sign + 1 / - 1 ) the available fragments in a given block to or from the fragment statistics . By subtracting before and adding after an operation on the free frag map we can easy update the fragment statistic which seems to be otherwise a rather complex operation .
static void
frag_adjust(ufs2_daddr_t frag, int sign)
{
	DBG_FUNC("frag_adjust")
	int fragsize;
	int f;
	DBG_ENTER;
	fragsize = 0;
	for (f = rounddown(frag, sblock.fs_frag);
	    f < roundup(frag + 1, sblock.fs_frag); f++) {
		if (isset(cg_blksfree(&acg), f)) {
			fragsize++;
		} else {
			if (fragsize && fragsize < sblock.fs_frag) {
				acg.cg_frsum[fragsize] += sign;
				DBG_PRINT2("frag_adjust [%d]+=%d\n",
				    fragsize, sign);
			}
			fragsize = 0;
		}
	}
	if (fragsize && fragsize < sblock.fs_frag) {
		acg.cg_frsum[fragsize] += sign;
		DBG_PRINT2("frag_adjust [%d]+=%d\n", fragsize, sign);
	}
	DBG_PRINT2("frag_adjust [[%d]]+=%d\n", fragsize, sign);
	DBG_LEAVE;
	return;
}
static void frag_adjust ( ufs2_daddr_t frag , int sign ) { DBG_FUNC ( " " ) int fragsize ; int f ; DBG_ENTER ; fragsize = 0 ; for ( f = rounddown ( frag , sblock . fs_frag ) ; f < roundup ( frag + 1 , sblock . fs_frag ) ; f ++ ) { if ( isset ( cg_blksfree ( & acg ) , f ) ) { fragsize ++ ; } else { if ( fragsize && fragsize < sblock . fs_frag ) { acg . cg_frsum [ fragsize ] += sign ; DBG_PRINT2 ( " \n " , fragsize , sign ) ; } fragsize = 0 ; } } if ( fragsize && fragsize < sblock . fs_frag ) { acg . cg_frsum [ fragsize ] += sign ; DBG_PRINT2 ( " \n " , fragsize , sign ) ; } DBG_PRINT2 ( " \n " , fragsize , sign ) ; DBG_LEAVE ; return ; }
Here we add or subtract (sign +1/-1) the available fragments in a given
 block to or from the fragment statistics.
Here we add or subtract ( sign + 1 / - 1 ) the available fragments in a given block to or from the fragment statistics .
/*
	 * Here frag only needs to point to any fragment in the block we want
	 * to examine.
	 */ /*
		 * Count contiguous free fragments.
		 */ /*
				 * We found something in between.
				 */ /*
		 * We found something.
		 */