FreeBSD/sbin/fsck_ffs/gjournal.c
/*
 * Write back all dirty cylinder groups.
 * Free all non-busy cylinder groups.
 */
Write back all dirty cylinder groups.
Free all non-busy cylinder groups.
Write back all dirty cylinder groups . Free all non - busy cylinder groups .
static void
putcgs(void)
{
	struct cgchain *cgc, *cgc2;
	assert(disk != NULL && fs != NULL);
	LIST_FOREACH_SAFE(cgc, &cglist, cgc_next, cgc2) {
		if (cgc->cgc_busy)
			continue;
		LIST_REMOVE(cgc, cgc_next);
		ncgs--;
		if (cgc->cgc_dirty) {
			bcopy(&cgc->cgc_cg, &disk->d_cg,
			    sizeof(cgc->cgc_union));
			if (cgwrite1(disk, cgc->cgc_cg.cg_cgx) == -1)
				err(1, "cgwrite1(%d)", cgc->cgc_cg.cg_cgx);
		}
		free(cgc);
	}
}
static void putcgs ( void ) { struct cgchain * cgc , * cgc2 ; assert ( disk != NULL && fs != NULL ) ; LIST_FOREACH_SAFE ( cgc , & cglist , cgc_next , cgc2 ) { if ( cgc -> cgc_busy ) continue ; LIST_REMOVE ( cgc , cgc_next ) ; ncgs -- ; if ( cgc -> cgc_dirty ) { bcopy ( & cgc -> cgc_cg , & disk -> d_cg , sizeof ( cgc -> cgc_union ) ) ; if ( cgwrite1 ( disk , cgc -> cgc_cg . cg_cgx ) == -1 ) err ( 1 , " " , cgc -> cgc_cg . cg_cgx ) ; } free ( cgc ) ; } }
Write back all dirty cylinder groups.
Write back all dirty cylinder groups .
//printf("%s: Wrote cg=%d\n", __func__, //    cgc->cgc_cg.cg_cgx);